phrocker commented on a change in pull request #472: MINIFICPP-710 - Fix errors
in Property StringToInt conversion
URL: https://github.com/apache/nifi-minifi-cpp/pull/472#discussion_r246971618
##########
File path: libminifi/include/core/TypedValues.h
##########
@@ -141,6 +141,47 @@ class TimePeriodValue : public TransformableValue, public
state::response::UInt6
* format <numeric> <byte size>.
*/
class DataSizeValue : public TransformableValue, public
state::response::UInt64Value {
+private:
+
+ //Signed
+ template<typename T, typename std::enable_if<std::is_signed<T>::value,
T>::type* = nullptr>
+ static bool AssignIfFits(int64_t base, uint64_t mult, T& output) {
+ int64_t val = base * mult;
+ if(val >= std::numeric_limits<T>::min() && val <=
std::numeric_limits<T>::max()) {
+ output = val;
+ return true;
+ }
+ return false;
+ }
+
Review comment:
Does this code compile in windows? I'm not sure that it will.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services