From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14421 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Issam Maghni Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 3/5] fix warning bitwise-op-parentheses Date: Mon, 22 Jul 2019 14:07:38 -0400 Message-ID: <20190722180740.16951-3-me@concati.me> References: <20190722180740.16951-1-me@concati.me> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148533"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Issam Maghni To: musl@lists.openwall.com Original-X-From: musl-return-14437-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 22 20:11:35 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hpcmc-000cYW-L7 for gllmg-musl@m.gmane.org; Mon, 22 Jul 2019 20:11:34 +0200 Original-Received: (qmail 24101 invoked by uid 550); 22 Jul 2019 18:11:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19559 invoked from network); 22 Jul 2019 18:07:47 -0000 X-Originating-IP: 87.101.92.157 X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722180740.16951-1-me@concati.me> Xref: news.gmane.org gmane.linux.lib.musl.general:14421 Archived-At: Signed-off-by: Issam Maghni --- include/byteswap.h | 2 +- include/endian.h | 2 +- src/locale/__mo_lookup.c | 2 +- src/locale/iconv.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/byteswap.h b/include/byteswap.h index 00b9df3c..861c3aa1 100644 --- a/include/byteswap.h +++ b/include/byteswap.h @@ -11,7 +11,7 @@ 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) diff --git a/include/endian.h b/include/endian.h index 1bd44451..60716508 100644 --- a/include/endian.h +++ b/include/endian.h @@ -29,7 +29,7 @@ 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) diff --git a/src/locale/__mo_lookup.c b/src/locale/__mo_lookup.c index d18ab774..fac204e2 100644 --- a/src/locale/__mo_lookup.c +++ b/src/locale/__mo_lookup.c @@ -3,7 +3,7 @@ static inline uint32_t swapc(uint32_t x, int c) { - return c ? x>>24 | x>>8&0xff00 | x<<8&0xff0000 | x<<24 : x; + return c ? x>>24 | (x>>8&0xff00) | (x<<8&0xff0000) | x<<24 : x; } const char *__mo_lookup(const void *p, size_t size, const char *s) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index ecb57bc2..28c7709e 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -201,7 +201,7 @@ static unsigned legacy_map(const unsigned char *map, unsigned c) { if (c < 4*map[-1]) return c; unsigned x = c - 4*map[-1]; - x = map[x*5/4]>>2*x%8 | map[x*5/4+1]<<8-2*x%8 & 1023; + x = map[x*5/4]>>2*x%8 | (map[x*5/4+1]<<8-2*x%8 & 1023); return x < 256 ? x : legacy_chars[x-256]; } -- 2.22.0