diff mbox series

Fix compiler warnings in stdio-common/_itoa.c and stdio-common/_itowa.c

Message ID ZrO-x0wyVIrWaHDO@mx3210.local
State New
Headers show
Series Fix compiler warnings in stdio-common/_itoa.c and stdio-common/_itowa.c | expand

Commit Message

John David Anglin Aug. 7, 2024, 6:36 p.m. UTC
This changes fixes several warning seen building glibc on
hppa-linux-gnu.

Okay for master?

Dave
---

Fix compiler warnings in stdio-common/_itoa.c and stdio-common/_itowa.c
diff mbox series

Patch

diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
index 36f9c177e8..3cf385229f 100644
--- a/stdio-common/_itoa.c
+++ b/stdio-common/_itoa.c
@@ -340,8 +340,8 @@  _itoa (unsigned long long int value, char *buflim, unsigned int base,
 		if (big_normalization_steps == 0)
 		  xh = 0;
 		else
-		  xh = (mp_limb_t) (value >> 64 - big_normalization_steps);
-		xl = (mp_limb_t) (value >> 32 - big_normalization_steps);
+		  xh = (mp_limb_t) (value >> (64 - big_normalization_steps));
+		xl = (mp_limb_t) (value >> (32 - big_normalization_steps));
 		udiv_qrnnd (x1hi, r, xh, xl, big_base_norm);
 
 		xl = ((mp_limb_t) value) << big_normalization_steps;
@@ -352,7 +352,7 @@  _itoa (unsigned long long int value, char *buflim, unsigned int base,
 		  xh = x1hi;
 		else
 		  xh = ((x1hi << big_normalization_steps)
-			| (x1lo >> 32 - big_normalization_steps));
+			| (x1lo >> (32 - big_normalization_steps)));
 		xl = x1lo << big_normalization_steps;
 		udiv_qrnnd (t[0], x, xh, xl, big_base_norm);
 		t[1] = x >> big_normalization_steps;
diff --git a/stdio-common/_itowa.c b/stdio-common/_itowa.c
index 53a6cb64e6..7a4b216a13 100644
--- a/stdio-common/_itowa.c
+++ b/stdio-common/_itowa.c
@@ -228,8 +228,8 @@  _itowa (unsigned long long int value, wchar_t *buflim, unsigned int base,
 		if (big_normalization_steps == 0)
 		  xh = 0;
 		else
-		  xh = (mp_limb_t) (value >> 64 - big_normalization_steps);
-		xl = (mp_limb_t) (value >> 32 - big_normalization_steps);
+		  xh = (mp_limb_t) (value >> (64 - big_normalization_steps));
+		xl = (mp_limb_t) (value >> (32 - big_normalization_steps));
 		udiv_qrnnd (x1hi, r, xh, xl, big_base_norm);
 
 		xl = ((mp_limb_t) value) << big_normalization_steps;
@@ -240,7 +240,7 @@  _itowa (unsigned long long int value, wchar_t *buflim, unsigned int base,
 		  xh = x1hi;
 		else
 		  xh = ((x1hi << big_normalization_steps)
-			| (x1lo >> 32 - big_normalization_steps));
+			| (x1lo >> (32 - big_normalization_steps)));
 		xl = x1lo << big_normalization_steps;
 		udiv_qrnnd (t[0], x, xh, xl, big_base_norm);
 		t[1] = x >> big_normalization_steps;