From eef17b261634e8f34dd4fb31c6e1b9658a79a21b Mon Sep 17 00:00:00 2001 From: Frank Mehnert Date: Mon, 29 Jul 2024 13:57:17 +0200 Subject: iconv: explicitly state operator precedence gcc suggests to set parentheses around '-'/'+' inside '<<' if the corresponding warnings are enabled. Make the compiler happy and make the code easier to understand for developers. Signed-off-by: Marcus Haehnel --- libiconv/iconv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libiconv') diff --git a/libiconv/iconv.c b/libiconv/iconv.c index ca92de8dd..6876ab5f7 100644 --- a/libiconv/iconv.c +++ b/libiconv/iconv.c @@ -199,7 +199,7 @@ static void put_16(unsigned char *s, unsigned c, int e) static unsigned get_32(const unsigned char *s, int e) { e &= 3; - return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3]; + return (s[e]+0U)<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3]; } static void put_32(unsigned char *s, unsigned c, int e) @@ -331,7 +331,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]; } -- cgit v1.2.3