Verification: popcount- Avoid conflict variable names/types

This commit is contained in:
Hesham Almatary 2017-06-29 12:04:35 +10:00
parent d3e90341d6
commit 3aa244cc14

View file

@ -125,17 +125,17 @@ int __builtin_popcountl (unsigned long x);
/** DONT_TRANSLATE */
static inline long
CONST popcountl(unsigned long v)
CONST popcountl(unsigned long mask)
{
#ifndef __POPCNT__
unsigned int c; // c accumulates the total bits set in v
for (c = 0; v; c++) {
v &= v - 1; // clear the least significant bit set
unsigned int count; // c accumulates the total bits set in v
for (count = 0; mask; count++) {
mask &= mask - 1; // clear the least significant bit set
}
return c;
return count;
#else
return __builtin_popcountl(x);
return __builtin_popcountl(mask);
#endif
}