X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=mware%2Fbyteorder.h;h=0ed874bbf68910da09c38ee7565fa05d30cc58ea;hb=4654a69f5df97af36ee5456d20cbccdc19012dc2;hp=e2d7e481a390fb3f09009c46ba632ac0ec25d176;hpb=71d0e7c9860cee75382c4989e7c586eeea6ba898;p=bertos.git diff --git a/mware/byteorder.h b/mware/byteorder.h index e2d7e481..0ed874bb 100644 --- a/mware/byteorder.h +++ b/mware/byteorder.h @@ -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(swab16(static_cast(x))); } template<> INLINE int32_t swab(int32_t x) { return static_cast(swab32(static_cast(x))); } -template<> INLINE int64_t swab(int64_t x) { return static_cast(swab32(static_cast(x))); } +template<> INLINE int64_t swab(int64_t x) { return static_cast(swab64(static_cast(x))); } template<> INLINE float swab(float x) { return swab_float(x); } /// Type generic conversion from CPU byte order to big-endian byte order.