Skip to content

Commit b18eae7

Browse files
committed
Updates to ExprTk
1 parent 177136f commit b18eae7

File tree

1 file changed

+37
-39
lines changed

1 file changed

+37
-39
lines changed

exprtk/exprtk.hpp

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13830,7 +13830,7 @@ namespace exprtk
1383013830
bfunc_t p2)
1383113831
{
1383213832
return allocator
13833-
.template allocate_type<node_type,T0,T1,bfunc_t&>
13833+
.template allocate_type<node_type, T0, T1, bfunc_t&>
1383413834
(p0, p1, p2);
1383513835
}
1383613836

@@ -13918,7 +13918,7 @@ namespace exprtk
1391813918
static inline expression_node<T>* allocate(Allocator& allocator, T0 p0, T1 p1, T2 p2, bfunc_t p3, bfunc_t p4)
1391913919
{
1392013920
return allocator
13921-
.template allocate_type<node_type,T0,T1,T2,bfunc_t,bfunc_t>
13921+
.template allocate_type<node_type, T0, T1, T2, bfunc_t, bfunc_t>
1392213922
(p0, p1, p2, p3, p4);
1392313923
}
1392413924

@@ -14015,7 +14015,7 @@ namespace exprtk
1401514015
bfunc_t p4, bfunc_t p5, bfunc_t p6)
1401614016
{
1401714017
return allocator
14018-
.template allocate_type<node_type,T0,T1,T2,T3,bfunc_t,bfunc_t>
14018+
.template allocate_type<node_type, T0, T1, T2, T3, bfunc_t, bfunc_t>
1401914019
(p0, p1, p2, p3, p4, p5, p6);
1402014020
}
1402114021

@@ -14100,7 +14100,7 @@ namespace exprtk
1410014100
static inline expression_node<T>* allocate(Allocator& allocator, T0 p0, T1 p1, T2 p2, tfunc_t p3)
1410114101
{
1410214102
return allocator
14103-
.template allocate_type<node_type,T0,T1,T2,tfunc_t>
14103+
.template allocate_type<node_type, T0, T1, T2, tfunc_t>
1410414104
(p0, p1, p2, p3);
1410514105
}
1410614106

@@ -14191,7 +14191,7 @@ namespace exprtk
1419114191
static inline expression_node<T>* allocate(Allocator& allocator, T0 p0, T1 p1, T2 p2)
1419214192
{
1419314193
return allocator
14194-
.template allocate_type<node_type,T0,T1,T2>
14194+
.template allocate_type<node_type, T0, T1, T2>
1419514195
(p0, p1, p2);
1419614196
}
1419714197

@@ -14292,7 +14292,7 @@ namespace exprtk
1429214292
static inline expression_node<T>* allocate(Allocator& allocator, T0 p0, T1 p1, T2 p2, T3 p3, qfunc_t p4)
1429314293
{
1429414294
return allocator
14295-
.template allocate_type<node_type,T0,T1,T2,T3,qfunc_t>
14295+
.template allocate_type<node_type, T0, T1, T2, T3, qfunc_t>
1429614296
(p0, p1, p2, p3, p4);
1429714297
}
1429814298

@@ -14375,7 +14375,7 @@ namespace exprtk
1437514375
static inline expression_node<T>* allocate(Allocator& allocator, T0 p0, T1 p1, T2 p2, T3 p3)
1437614376
{
1437714377
return allocator
14378-
.template allocate_type<node_type,T0,T1,T2,T3>
14378+
.template allocate_type<node_type, T0, T1, T2, T3>
1437914379
(p0, p1, p2, p3);
1438014380
}
1438114381

@@ -15501,37 +15501,37 @@ namespace exprtk
1550115501
template <typename ResultNode, typename OpType, typename ExprNode>
1550215502
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[1])
1550315503
{
15504-
return allocate<ResultNode>(operation,branch[0]);
15504+
return allocate<ResultNode>(operation, branch[0]);
1550515505
}
1550615506

1550715507
template <typename ResultNode, typename OpType, typename ExprNode>
1550815508
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[2])
1550915509
{
15510-
return allocate<ResultNode>(operation,branch[0],branch[1]);
15510+
return allocate<ResultNode>(operation, branch[0], branch[1]);
1551115511
}
1551215512

1551315513
template <typename ResultNode, typename OpType, typename ExprNode>
1551415514
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[3])
1551515515
{
15516-
return allocate<ResultNode>(operation,branch[0],branch[1],branch[2]);
15516+
return allocate<ResultNode>(operation, branch[0], branch[1], branch[2]);
1551715517
}
1551815518

1551915519
template <typename ResultNode, typename OpType, typename ExprNode>
1552015520
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[4])
1552115521
{
15522-
return allocate<ResultNode>(operation,branch[0],branch[1],branch[2],branch[3]);
15522+
return allocate<ResultNode>(operation, branch[0], branch[1], branch[2], branch[3]);
1552315523
}
1552415524

1552515525
template <typename ResultNode, typename OpType, typename ExprNode>
1552615526
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[5])
1552715527
{
15528-
return allocate<ResultNode>(operation,branch[0],branch[1],branch[2],branch[3],branch[4]);
15528+
return allocate<ResultNode>(operation, branch[0],branch[1], branch[2], branch[3], branch[4]);
1552915529
}
1553015530

1553115531
template <typename ResultNode, typename OpType, typename ExprNode>
1553215532
inline expression_node<typename ResultNode::value_type>* allocate(OpType& operation, ExprNode (&branch)[6])
1553315533
{
15534-
return allocate<ResultNode>(operation,branch[0],branch[1],branch[2],branch[3],branch[4],branch[5]);
15534+
return allocate<ResultNode>(operation, branch[0], branch[1], branch[2], branch[3], branch[4], branch[5]);
1553515535
}
1553615536

1553715537
template <typename node_type>
@@ -16094,20 +16094,20 @@ namespace exprtk
1609416094

1609516095
typedef T (*ff00_functor)();
1609616096
typedef T (*ff01_functor)(T);
16097-
typedef T (*ff02_functor)(T,T);
16098-
typedef T (*ff03_functor)(T,T,T);
16099-
typedef T (*ff04_functor)(T,T,T,T);
16100-
typedef T (*ff05_functor)(T,T,T,T,T);
16101-
typedef T (*ff06_functor)(T,T,T,T,T,T);
16102-
typedef T (*ff07_functor)(T,T,T,T,T,T,T);
16103-
typedef T (*ff08_functor)(T,T,T,T,T,T,T,T);
16104-
typedef T (*ff09_functor)(T,T,T,T,T,T,T,T,T);
16105-
typedef T (*ff10_functor)(T,T,T,T,T,T,T,T,T,T);
16106-
typedef T (*ff11_functor)(T,T,T,T,T,T,T,T,T,T,T);
16107-
typedef T (*ff12_functor)(T,T,T,T,T,T,T,T,T,T,T,T);
16108-
typedef T (*ff13_functor)(T,T,T,T,T,T,T,T,T,T,T,T,T);
16109-
typedef T (*ff14_functor)(T,T,T,T,T,T,T,T,T,T,T,T,T,T);
16110-
typedef T (*ff15_functor)(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);
16097+
typedef T (*ff02_functor)(T, T);
16098+
typedef T (*ff03_functor)(T, T, T);
16099+
typedef T (*ff04_functor)(T, T, T, T);
16100+
typedef T (*ff05_functor)(T, T, T, T, T);
16101+
typedef T (*ff06_functor)(T, T, T, T, T, T);
16102+
typedef T (*ff07_functor)(T, T, T, T, T, T, T);
16103+
typedef T (*ff08_functor)(T, T, T, T, T, T, T, T);
16104+
typedef T (*ff09_functor)(T, T, T, T, T, T, T, T, T);
16105+
typedef T (*ff10_functor)(T, T, T, T, T, T, T, T, T, T);
16106+
typedef T (*ff11_functor)(T, T, T, T, T, T, T, T, T, T, T);
16107+
typedef T (*ff12_functor)(T, T, T, T, T, T, T, T, T, T, T, T);
16108+
typedef T (*ff13_functor)(T, T, T, T, T, T, T, T, T, T, T, T, T);
16109+
typedef T (*ff14_functor)(T, T, T, T, T, T, T, T, T, T, T, T, T, T);
16110+
typedef T (*ff15_functor)(T, T, T, T, T, T, T, T, T, T, T, T, T, T, T);
1611116111

1611216112
protected:
1611316113

@@ -36950,11 +36950,9 @@ namespace exprtk
3695036950

3695136951
inline T operator() (const std::size_t& ps_index, parameter_list_t parameters)
3695236952
{
36953-
std::string file_name;
36953+
std::string file_name = to_str(string_t(parameters[0]));
3695436954
std::string access;
3695536955

36956-
file_name = to_str(string_t(parameters[0]));
36957-
3695836956
if (file_name.empty())
3695936957
return T(0);
3696036958

@@ -37035,27 +37033,27 @@ namespace exprtk
3703537033
case 0 : {
3703637034
const string_t buffer(parameters[1]);
3703737035
amount = buffer.size();
37038-
return T(fd->write(buffer,amount) ? 1 : 0);
37036+
return T(fd->write(buffer, amount) ? 1 : 0);
3703937037
}
3704037038

3704137039
case 1 : {
3704237040
const string_t buffer(parameters[1]);
3704337041
amount = std::min(buffer.size(),
3704437042
static_cast<std::size_t>(scalar_t(parameters[2])()));
37045-
return T(fd->write(buffer,amount) ? 1 : 0);
37043+
return T(fd->write(buffer, amount) ? 1 : 0);
3704637044
}
3704737045

3704837046
case 2 : {
3704937047
const vector_t vec(parameters[1]);
3705037048
amount = vec.size();
37051-
return T(fd->write(vec,amount) ? 1 : 0);
37049+
return T(fd->write(vec, amount) ? 1 : 0);
3705237050
}
3705337051

3705437052
case 3 : {
3705537053
const vector_t vec(parameters[1]);
3705637054
amount = std::min(vec.size(),
3705737055
static_cast<std::size_t>(scalar_t(parameters[2])()));
37058-
return T(fd->write(vec,amount) ? 1 : 0);
37056+
return T(fd->write(vec, amount) ? 1 : 0);
3705937057
}
3706037058
}
3706137059

@@ -37256,10 +37254,10 @@ namespace exprtk
3725637254
namespace details
3725737255
{
3725837256
template <typename T>
37259-
inline void kahan_sum(T& sum, T& error, T v)
37257+
inline void kahan_sum(T& sum, T& error, const T v)
3726037258
{
37261-
T x = v - error;
37262-
T y = sum + x;
37259+
const T x = v - error;
37260+
const T y = sum + x;
3726337261
error = (y - sum) - x;
3726437262
sum = y;
3726537263
}
@@ -37983,7 +37981,7 @@ namespace exprtk
3798337981
else if (helper::invalid_range(y, r0, r1))
3798437982
return std::numeric_limits<T>::quiet_NaN();
3798537983

37986-
T a = scalar_t(parameters[0])();
37984+
const T a = scalar_t(parameters[0])();
3798737985

3798837986
for (std::size_t i = r0; i <= r1; ++i)
3798937987
{
@@ -38081,7 +38079,7 @@ namespace exprtk
3808138079
else if (helper::invalid_range(z, r0, r1))
3808238080
return std::numeric_limits<T>::quiet_NaN();
3808338081

38084-
T a = scalar_t(parameters[0])();
38082+
const T a = scalar_t(parameters[0])();
3808538083

3808638084
for (std::size_t i = r0; i <= r1; ++i)
3808738085
{

0 commit comments

Comments
 (0)