From: Eric Engestrom Date: Tue, 16 Oct 2018 08:43:07 +0000 (+0100) Subject: util: use *unsigned* ints for bit operations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc021be78d2d5a36376494fca7eaf7f0728c6a29;p=mesa.git util: use *unsigned* ints for bit operations Fixes errors thrown by GCC's Undefined Behaviour sanitizer (ubsan) every time this macro is used. Signed-off-by: Eric Engestrom Reviewed-by: Eric Anholt --- diff --git a/src/util/bitset.h b/src/util/bitset.h index adafc72a5f7..3b18abac793 100644 --- a/src/util/bitset.h +++ b/src/util/bitset.h @@ -54,7 +54,7 @@ #define BITSET_ONES(x) memset( (x), 0xff, sizeof (x) ) #define BITSET_BITWORD(b) ((b) / BITSET_WORDBITS) -#define BITSET_BIT(b) (1 << ((b) % BITSET_WORDBITS)) +#define BITSET_BIT(b) (1u << ((b) % BITSET_WORDBITS)) /* single bit operations */