diff options
author | neel <neel@FreeBSD.org> | 2010-08-11 02:28:39 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2010-08-11 02:28:39 +0000 |
commit | 707ea62774f5580b39adb488c590c825ec93c718 (patch) | |
tree | 42027a9f43dccf72c9c6f7ba4b73a0be35a03c4f | |
parent | d7725ba6bbfc90b75ff4df6cce1ccfd3e3f391db (diff) | |
download | FreeBSD-src-707ea62774f5580b39adb488c590c825ec93c718.zip FreeBSD-src-707ea62774f5580b39adb488c590c825ec93c718.tar.gz |
Add parentheses around the argument 'x' used in the __bswapXX(x) macros. Revert
r211130 in favor of this more general fix.
This fixes a compilation error for mips 64-bit little endian build.
libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type
Suggested by: stefanf, jchandra, bde
-rw-r--r-- | libexec/rtld-elf/mips/reloc.c | 2 | ||||
-rw-r--r-- | sys/mips/include/endian.h | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c index 15a0e37..0195df6 100644 --- a/libexec/rtld-elf/mips/reloc.c +++ b/libexec/rtld-elf/mips/reloc.c @@ -83,7 +83,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr); #undef ELF_R_SYM #undef ELF_R_TYPE #define ELF_R_SYM(r_info) ((r_info) & 0xffffffff) -#define ELF_R_TYPE(r_info) bswap32(((r_info) >> 32)) +#define ELF_R_TYPE(r_info) bswap32((r_info) >> 32) #endif #else #define ELF_R_NXTTYPE_64_P(r_type) (0) diff --git a/sys/mips/include/endian.h b/sys/mips/include/endian.h index b43b1e9..ead6dc4 100644 --- a/sys/mips/include/endian.h +++ b/sys/mips/include/endian.h @@ -108,12 +108,12 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__uint16_t)(__is_constant(x) ? \ - __bswap16_const((__uint16_t)x) : __bswap16_var((__uint16_t)x)) -#define __bswap32(x) (__uint32_t)(__is_constant(x) ? \ - __bswap32_const((__uint32_t)x) : __bswap32_var((__uint32_t)x)) -#define __bswap64(x) (__uint64_t)(__is_constant(x) ? \ - __bswap64_const((__uint64_t)x) : __bswap64_var((__uint64_t)x)) +#define __bswap16(x) ((__uint16_t)(__is_constant((x)) ? \ + __bswap16_const((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x)))) +#define __bswap32(x) ((__uint32_t)(__is_constant((x)) ? \ + __bswap32_const((__uint32_t)(x)) : __bswap32_var((__uint32_t)(x)))) +#define __bswap64(x) ((__uint64_t)(__is_constant((x)) ? \ + __bswap64_const((__uint64_t)(x)) : __bswap64_var((__uint64_t)(x)))) #ifdef __MIPSEB__ #define __htonl(x) ((__uint32_t)(x)) |