summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/powerpc/include/endian.h4
-rw-r--r--sys/sparc64/include/endian.h4
-rw-r--r--sys/x86/include/endian.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h
index 15dd7db..bfca169 100644
--- a/sys/powerpc/include/endian.h
+++ b/sys/powerpc/include/endian.h
@@ -124,8 +124,8 @@ __bswap64_var(__uint64_t _x)
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
-#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \
- __bswap16_var(x))
+#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \
+ __bswap16_var(x)))
#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \
__bswap32_var(x))
#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \
diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h
index 2ca467e..38e7c30 100644
--- a/sys/sparc64/include/endian.h
+++ b/sys/sparc64/include/endian.h
@@ -109,8 +109,8 @@ __bswap64_var(__uint64_t _x)
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
-#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \
- __bswap16_var(x))
+#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \
+ __bswap16_var(x)))
#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \
__bswap32_var(x))
#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \
diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h
index ba101fa..2f95320 100644
--- a/sys/x86/include/endian.h
+++ b/sys/x86/include/endian.h
@@ -71,8 +71,8 @@
#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P
#define __bswap16(x) \
- (__uint16_t)(__builtin_constant_p(x) ? \
- __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))
+ ((__uint16_t)(__builtin_constant_p(x) ? \
+ __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
#define __bswap32(x) \
(__builtin_constant_p(x) ? \
__bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
OpenPOWER on IntegriCloud