From 45d10e3d8d6b6785f44098eb998c21f598d6ccf6 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sat, 10 Aug 2024 11:02:41 +0200 Subject: [PATCH] Revert "Cast clz() calls to unsigned int where necessary" This reverts commit 13dca0b8c5732c8a2d3766b759f54019f71f98e8. --- udivdi3.c | 2 +- udivsi3.c | 2 +- umoddi3.c | 2 +- umodsi3.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/udivdi3.c b/udivdi3.c index b86b687..5caabf4 100644 --- a/udivdi3.c +++ b/udivdi3.c @@ -21,7 +21,7 @@ COMPILER_RT_ABI du_int __udivdi3(du_int n, du_int d) { const unsigned N = sizeof(du_int) * CHAR_BIT; // d == 0 cases are unspecified. - unsigned sr = (d ? (unsigned)clz(d) : N) - (n ? (unsigned)clz(n) : N); + unsigned sr = (d ? clz(d) : N) - (n ? clz(n) : N); // 0 <= sr <= N - 1 or sr is very large. if (sr > N - 1) // n < d return 0; diff --git a/udivsi3.c b/udivsi3.c index 07d8ceb..0e5d76d 100644 --- a/udivsi3.c +++ b/udivsi3.c @@ -21,7 +21,7 @@ COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d) { const unsigned N = sizeof(su_int) * CHAR_BIT; // d == 0 cases are unspecified. - unsigned sr = (d ? (unsigned)clz(d) : N) - (n ? (unsigned)clz(n) : N); + unsigned sr = (d ? clz(d) : N) - (n ? clz(n) : N); // 0 <= sr <= N - 1 or sr is very large. if (sr > N - 1) // n < d return 0; diff --git a/umoddi3.c b/umoddi3.c index 87cc2bf..3f843ea 100644 --- a/umoddi3.c +++ b/umoddi3.c @@ -21,7 +21,7 @@ COMPILER_RT_ABI du_int __umoddi3(du_int n, du_int d) { const unsigned N = sizeof(du_int) * CHAR_BIT; // d == 0 cases are unspecified. - unsigned sr = (d ? (unsigned)clz(d) : N) - (n ? (unsigned)clz(n) : N); + unsigned sr = (d ? clz(d) : N) - (n ? clz(n) : N); // 0 <= sr <= N - 1 or sr is very large. if (sr > N - 1) // n < d return n; diff --git a/umodsi3.c b/umodsi3.c index bd8c8e4..798c395 100644 --- a/umodsi3.c +++ b/umodsi3.c @@ -21,7 +21,7 @@ COMPILER_RT_ABI su_int __umodsi3(su_int n, su_int d) { const unsigned N = sizeof(su_int) * CHAR_BIT; // d == 0 cases are unspecified. - unsigned sr = (d ? (unsigned)clz(d) : N) - (n ? (unsigned)clz(n) : N); + unsigned sr = (d ? clz(d) : N) - (n ? clz(n) : N); // 0 <= sr <= N - 1 or sr is very large. if (sr > N - 1) // n < d return n;