From 347fdeccf9268cefa40b8389790e465a3e2e6587 Mon Sep 17 00:00:00 2001 From: Nick Bray Date: Thu, 17 Jan 2019 15:53:46 -0800 Subject: [PATCH] eliminate strict parentheses warnings for byteswaps adding these parentheses eliminates a warning from -Wparentheses, but does not change the semantics of the code. --- include/byteswap.h | 4 ++-- include/endian.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/byteswap.h b/include/byteswap.h index 00b9df3c..928be2b3 100644 --- a/include/byteswap.h +++ b/include/byteswap.h @@ -11,12 +11,12 @@ static __inline uint16_t __bswap_16(uint16_t __x) static __inline uint32_t __bswap_32(uint32_t __x) { - return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; + return __x>>24 | (__x>>8&0xff00) | (__x<<8&0xff0000) | __x<<24; } static __inline uint64_t __bswap_64(uint64_t __x) { - return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32); + return (__bswap_32(__x)+0ULL)<<32 | __bswap_32(__x>>32); } #define bswap_16(x) __bswap_16(x) diff --git a/include/endian.h b/include/endian.h index 1bd44451..88c3347b 100644 --- a/include/endian.h +++ b/include/endian.h @@ -29,12 +29,12 @@ static __inline uint16_t __bswap16(uint16_t __x) static __inline uint32_t __bswap32(uint32_t __x) { - return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24; + return __x>>24 | (__x>>8&0xff00) | (__x<<8&0xff0000) | __x<<24; } static __inline uint64_t __bswap64(uint64_t __x) { - return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32); + return (__bswap32(__x)+0ULL)<<32 | __bswap32(__x>>32); } #if __BYTE_ORDER == __LITTLE_ENDIAN -- 2.21.0.rc0.258.g878e2cd30e-goog