From a099185cd65195a0d0a79ac2338919133bd8f843 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Mar 2018 20:28:36 +0000 Subject: [PATCH] round: fix types for shifts --- Library/libs/round.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/libs/round.c b/Library/libs/round.c index edf3316b..634230b8 100644 --- a/Library/libs/round.c +++ b/Library/libs/round.c @@ -20,17 +20,17 @@ double round(double x) EXTRACT_WORDS(msw, lsw, x); /* Extract exponent field. */ - exponent_less_1023 = ((msw & 0x7ff00000) >> 20) - 1023; + exponent_less_1023 = ((msw & 0x7ff00000UL) >> 20) - 1023; if (exponent_less_1023 < 20) { if (exponent_less_1023 < 0) { - msw &= 0x80000000; + msw &= 0x80000000UL; if (exponent_less_1023 == -1) /* Result is +1.0 or -1.0. */ - msw |= (1023 << 20); + msw |= (1023UL << 20); lsw = 0; } else { - uint32_t exponent_mask = 0x000fffff >> exponent_less_1023; + uint32_t exponent_mask = 0x000fffffUL >> exponent_less_1023; if ((msw & exponent_mask) == 0 && lsw == 0) /* x in an integral value. */ return x; -- 2.34.1