diff options
author | Frank Mehnert <frank.mehnert@kernkonzept.com> | 2024-07-29 13:57:17 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2024-07-30 02:36:47 +0200 |
commit | eef17b261634e8f34dd4fb31c6e1b9658a79a21b (patch) | |
tree | 3ba75a3936179712285f18d787e2e77682d81f9e /libiconv | |
parent | d603dd52109d4f5c3f50aecebb0dbd47f6b16141 (diff) |
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 <marcus.haehnel@kernkonzept.com>
Diffstat (limited to 'libiconv')
-rw-r--r-- | libiconv/iconv.c | 4 |
1 files changed, 2 insertions, 2 deletions
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]; } |