diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-04 19:07:28 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-04 19:07:28 +0000 |
commit | 827366c155aca75749dbf934e25cb6ccdfd4f9f3 (patch) | |
tree | 15d5f912de8256edf241e5207f9bec8f960db44e | |
parent | fcb45007e64daf1b8068feed146c8d843f6b0dee (diff) | |
download | FreeBSD-src-827366c155aca75749dbf934e25cb6ccdfd4f9f3.zip FreeBSD-src-827366c155aca75749dbf934e25cb6ccdfd4f9f3.tar.gz |
Use casts to enforce the return type of bswap16() and bswap32().
-rw-r--r-- | sys/arm/include/endian.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arm/include/endian.h b/sys/arm/include/endian.h index 135392a..ad666fe 100644 --- a/sys/arm/include/endian.h +++ b/sys/arm/include/endian.h @@ -108,14 +108,14 @@ __bswap16_var(__uint32_t v) (((x) & 0x00ff) << 8)) #define __bswap16(x) \ - (__builtin_constant_p(x) ? \ - __bswap16_constant(x) : \ - __bswap16_var(x)) + ((__uint16_t)(__builtin_constant_p(x) ? \ + __bswap16_constant(x) : \ + __bswap16_var(x))) #define __bswap32(x) \ - (__builtin_constant_p(x) ? \ - __bswap32_constant(x) : \ - __bswap32_var(x)) + ((__uint32_t)(__builtin_constant_p(x) ? \ + __bswap32_constant(x) : \ + __bswap32_var(x))) #else #define __bswap16(x) __bswap16_var(x) |