Test for ticket system bug #14.
[bertos.git] / mware / byteorder.h
index e2d7e481a390fb3f09009c46ba632ac0ec25d176..0ed874bbf68910da09c38ee7565fa05d30cc58ea 100644 (file)
@@ -69,8 +69,8 @@ INLINE uint32_t swab32(uint32_t x)
  */
 INLINE uint64_t swab64(uint64_t x)
 {
-       return ( (uint64_t)swab32((x >> 32))
-               | (uint64_t)swab32(x & (uint32_t)0xFFFFFFFFUL) << 32);
+       return (uint64_t)swab32(x >> 32)
+               | ((uint64_t)swab32(x & 0xFFFFFFFFUL) << 32);
 }
 
 /**
@@ -219,7 +219,7 @@ template<> INLINE uint32_t swab(uint32_t x) { return swab32(x); }
 template<> INLINE uint64_t swab(uint64_t x) { return swab64(x); }
 template<> INLINE int16_t  swab(int16_t x)  { return static_cast<int16_t>(swab16(static_cast<uint16_t>(x))); }
 template<> INLINE int32_t  swab(int32_t x)  { return static_cast<int32_t>(swab32(static_cast<uint32_t>(x))); }
-template<> INLINE int64_t  swab(int64_t x)  { return static_cast<int64_t>(swab32(static_cast<uint64_t>(x))); }
+template<> INLINE int64_t  swab(int64_t x)  { return static_cast<int64_t>(swab64(static_cast<uint64_t>(x))); }
 template<> INLINE float    swab(float x)    { return swab_float(x); }
 
 /// Type generic conversion from CPU byte order to big-endian byte order.