fgerlits commented on a change in pull request #848:
URL: https://github.com/apache/nifi-minifi-cpp/pull/848#discussion_r463111602



##########
File path: libminifi/include/io/Serializable.h
##########
@@ -44,8 +44,9 @@ Integral byteSwap(Integral i) {
 #ifdef htonll
   return htonll(i);
 #else
-  #define htonll_r(x) ((((uint64_t)htonl(x)) << 32) + htonl((x) >> 32))
-  return htonll_r(i);
+  uint32_t lower_32_bits = static_cast<uint32_t>(i);

Review comment:
       The new code is equivalent to the old code which used the `#define`, but 
you are right that it's not always equivalent to `htonll`.  We check 
`is_little_endian` every time before we call `byteSwap`; it would probably be 
better to move that check inside `byteSwap`, but I didn't think that was in 
scope for this change.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to