util: use uint32_t instead of unsigned in bitscan.h

uint32_t is more exact than unsigned for these functions

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>
This commit is contained in:
Yonggang Luo 2023-06-20 09:49:10 +08:00 committed by Marge Bot
parent 3aa929ca46
commit b45fb614a4

View file

@ -122,13 +122,13 @@ u_bit_scan64(uint64_t *mask)
((b) = ffsll(__dword) - 1, __dword); \
__dword &= ~(1ull << (b)))
/* Determine if an unsigned value is a power of two.
/* Determine if an uint32_t value is a power of two.
*
* \note
* Zero is treated as a power of two.
*/
static inline bool
util_is_power_of_two_or_zero(unsigned v)
util_is_power_of_two_or_zero(uint32_t v)
{
return IS_POT(v);
}
@ -144,13 +144,13 @@ util_is_power_of_two_or_zero64(uint64_t v)
return IS_POT(v);
}
/* Determine if an unsigned value is a power of two.
/* Determine if an uint32_t value is a power of two.
*
* \note
* Zero is \b not treated as a power of two.
*/
static inline bool
util_is_power_of_two_nonzero(unsigned v)
util_is_power_of_two_nonzero(uint32_t v)
{
/* __POPCNT__ is different from HAVE___BUILTIN_POPCOUNT. The latter
* indicates the existence of the __builtin_popcount function. The former