projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17b03b5
)
util: use *unsigned* ints for bit operations
author
Eric Engestrom
<eric.engestrom@intel.com>
Tue, 16 Oct 2018 08:43:07 +0000
(09:43 +0100)
committer
Eric Engestrom
<eric.engestrom@intel.com>
Tue, 23 Oct 2018 10:44:02 +0000
(11:44 +0100)
Fixes errors thrown by GCC's Undefined Behaviour sanitizer (ubsan) every
time this macro is used.
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/util/bitset.h
patch
|
blob
|
history
diff --git
a/src/util/bitset.h
b/src/util/bitset.h
index adafc72a5f74d46e118a1333cc84900f0e468932..3b18abac793a0694c611da29dd411e92e7f62c6b 100644
(file)
--- 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) (1
u
<< ((b) % BITSET_WORDBITS))
/* single bit operations
*/