Without this commit, sparse warns:
lib/util.c:921:15: warning: symbol 'count_1bits_8' was not declared.
Should it be static?
Introduced by commit
c3cc4d2dd2658 (util: Better count_1bits().).
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
return log_2_floor(n) + !is_pow2(n);
}
return log_2_floor(n) + !is_pow2(n);
}
+extern const uint8_t count_1bits_8[256];
+
/* Returns the number of 1-bits in 'x', between 0 and 32 inclusive. */
static inline unsigned int
count_1bits_32(uint32_t x)
/* Returns the number of 1-bits in 'x', between 0 and 32 inclusive. */
static inline unsigned int
count_1bits_32(uint32_t x)
/* __builtin_popcount() is fast only when supported by the CPU. */
return __builtin_popcount(x);
#else
/* __builtin_popcount() is fast only when supported by the CPU. */
return __builtin_popcount(x);
#else
- extern const uint8_t count_1bits_8[256];
/* This portable implementation is the fastest one we know of for 32 bits,
* and faster than GCC __builtin_popcount(). */
return (count_1bits_8[x & 0xff] +
/* This portable implementation is the fastest one we know of for 32 bits,
* and faster than GCC __builtin_popcount(). */
return (count_1bits_8[x & 0xff] +