AK: Fix usage of undefined variables

The commit that introduced BuiltinWrappers (548529a) accidentally used
`val` instead of `value` in the non `__GNUC__` and `__clang__` versions
of the functions.
This commit is contained in:
Filiph Sandström 2022-07-31 05:36:29 +02:00 committed by Linus Groh
parent fcc0e4d538
commit 5a281336c5

View file

@ -23,7 +23,7 @@ inline constexpr int popcount(IntType value)
#else #else
int ones = 0; int ones = 0;
for (size_t i = 0; i < 8 * sizeof(IntType); ++i) { for (size_t i = 0; i < 8 * sizeof(IntType); ++i) {
if ((val >> i) & 1) { if ((value >> i) & 1) {
++ones; ++ones;
} }
} }
@ -50,7 +50,7 @@ inline constexpr int count_trailing_zeroes(IntType value)
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
#else #else
for (size_t i = 0; i < 8 * sizeof(IntType); ++i) { for (size_t i = 0; i < 8 * sizeof(IntType); ++i) {
if ((val >> i) & 1) { if ((value >> i) & 1) {
return i; return i;
} }
} }
@ -89,7 +89,7 @@ inline constexpr int count_leading_zeroes(IntType value)
#else #else
// Wrap around, catch going past zero by noticing that i is greater than the number of bits in the number // Wrap around, catch going past zero by noticing that i is greater than the number of bits in the number
for (size_t i = (8 * sizeof(IntType)) - 1; i < 8 * sizeof(IntType); --i) { for (size_t i = (8 * sizeof(IntType)) - 1; i < 8 * sizeof(IntType); --i) {
if ((val >> i) & 1) { if ((value >> i) & 1) {
return i; return i;
} }
} }