331 |
if (arg->exprType() == REAL_EXPR) { |
if (arg->exprType() == REAL_EXPR) { |
332 |
VMRealExpr* expr = arg->asReal(); |
VMRealExpr* expr = arg->asReal(); |
333 |
return successRealResult({ |
return successRealResult({ |
334 |
.value = ::fabs(expr->evalReal()), |
.value = static_cast<vmfloat>(::fabs(expr->evalReal())), |
335 |
.unitFactor = expr->unitFactor() |
.unitFactor = expr->unitFactor() |
336 |
}); |
}); |
337 |
} else { |
} else { |
338 |
VMIntExpr* expr = arg->asInt(); |
VMIntExpr* expr = arg->asInt(); |
339 |
return successIntResult({ |
return successIntResult({ |
340 |
.value = ::abs(expr->evalInt()), |
.value = std::abs(expr->evalInt()), |
341 |
.unitFactor = expr->unitFactor() |
.unitFactor = expr->unitFactor() |
342 |
}); |
}); |
343 |
} |
} |
1038 |
class T_accessor> // T_accessor is either IntArrayAccessor or RealArrayAccessor |
class T_accessor> // T_accessor is either IntArrayAccessor or RealArrayAccessor |
1039 |
class ArrElemRef : protected ArrElemPOD<T_array> { |
class ArrElemRef : protected ArrElemPOD<T_array> { |
1040 |
public: |
public: |
1041 |
typedef ScalarNmbrVal<T_value> ScalarNmbrVal; |
typedef ::LinuxSampler::ScalarNmbrVal<T_value> ScalarNmbrVal; // GCC 8.x requires this very detailed form of typedef (that is ::LinuxSampler:: as prefix), IMO a GCC bug |
1042 |
|
|
1043 |
inline ArrElemRef(T_array* a, vmint index) { |
inline ArrElemRef(T_array* a, vmint index) { |
1044 |
this->m_array = a; |
this->m_array = a; |
1131 |
public: |
public: |
1132 |
typedef std::random_access_iterator_tag iterator_category; |
typedef std::random_access_iterator_tag iterator_category; |
1133 |
typedef ssize_t difference_type; |
typedef ssize_t difference_type; |
1134 |
typedef ArrElemRef<T_array, T_value, T_accessor> ArrElemRef; |
typedef ::LinuxSampler::ArrElemRef<T_array, T_value, T_accessor> ArrElemRef; // GCC 8.x requires this very detailed form of typedef (that is ::LinuxSampler:: as prefix), IMO a GCC bug |
1135 |
typedef ArrElemRef reference; // type used by STL for access by reference |
typedef ArrElemRef reference; // type used by STL for access by reference |
1136 |
typedef void pointer; // type used by STL for -> operator result, we don't use that operator at all so just void it |
typedef void pointer; // type used by STL for -> operator result, we don't use that operator at all so just void it |
1137 |
typedef ScalarNmbrVal<T_value> value_type; // type used by STL for temporary values |
typedef ScalarNmbrVal<T_value> value_type; // type used by STL for temporary values |
1212 |
typedef ArrExprIter<VMRealArrayExpr,vmfloat,RealArrayAccessor> RealArrExprIter; |
typedef ArrExprIter<VMRealArrayExpr,vmfloat,RealArrayAccessor> RealArrExprIter; |
1213 |
|
|
1214 |
// intentionally not a template function to avoid potential clashes with other (i.e. system's) swap() functions |
// intentionally not a template function to avoid potential clashes with other (i.e. system's) swap() functions |
1215 |
static inline void swap(IntArrExprIter::ArrElemRef a, |
inline void swap(IntArrExprIter::ArrElemRef a, |
1216 |
IntArrExprIter::ArrElemRef b) |
IntArrExprIter::ArrElemRef b) |
1217 |
{ |
{ |
1218 |
vmint valueA = a.getPrimValue(); |
vmint valueA = a.getPrimValue(); |
1219 |
vmint valueB = b.getPrimValue(); |
vmint valueB = b.getPrimValue(); |
1226 |
} |
} |
1227 |
|
|
1228 |
// intentionally not a template function to avoid potential clashes with other (i.e. system's) swap() functions |
// intentionally not a template function to avoid potential clashes with other (i.e. system's) swap() functions |
1229 |
static inline void swap(RealArrExprIter::ArrElemRef a, |
inline void swap(RealArrExprIter::ArrElemRef a, |
1230 |
RealArrExprIter::ArrElemRef b) |
RealArrExprIter::ArrElemRef b) |
1231 |
{ |
{ |
1232 |
vmfloat valueA = a.getPrimValue(); |
vmfloat valueA = a.getPrimValue(); |
1233 |
vmfloat valueB = b.getPrimValue(); |
vmfloat valueB = b.getPrimValue(); |
1546 |
}); |
}); |
1547 |
} else { |
} else { |
1548 |
return successResult({ |
return successResult({ |
1549 |
.value = ::pow(a,b), |
.value = static_cast<vmfloat>(::pow(a,b)), |
1550 |
.unitFactor = arg0->unitFactor() |
.unitFactor = arg0->unitFactor() |
1551 |
}); |
}); |
1552 |
} |
} |