From owner-svn-src-all@FreeBSD.ORG Wed Aug 11 02:28:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6591106566B; Wed, 11 Aug 2010 02:28:39 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB4518FC0A; Wed, 11 Aug 2010 02:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B2Sdql006782; Wed, 11 Aug 2010 02:28:39 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B2Sdef006779; Wed, 11 Aug 2010 02:28:39 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201008110228.o7B2Sdef006779@svn.freebsd.org> From: Neel Natu Date: Wed, 11 Aug 2010 02:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211159 - in head: libexec/rtld-elf/mips sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 02:28:40 -0000 Author: neel Date: Wed Aug 11 02:28:39 2010 New Revision: 211159 URL: http://svn.freebsd.org/changeset/base/211159 Log: 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 Modified: head/libexec/rtld-elf/mips/reloc.c head/sys/mips/include/endian.h Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Wed Aug 11 02:13:50 2010 (r211158) +++ head/libexec/rtld-elf/mips/reloc.c Wed Aug 11 02:28:39 2010 (r211159) @@ -83,7 +83,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn #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) Modified: head/sys/mips/include/endian.h ============================================================================== --- head/sys/mips/include/endian.h Wed Aug 11 02:13:50 2010 (r211158) +++ head/sys/mips/include/endian.h Wed Aug 11 02:28:39 2010 (r211159) @@ -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))