About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatalie Vock <natalie.vock@gmx.de>2025-10-21 11:12:22 +0200
committerMarge Bot <marge-bot@fdo.invalid>2025-11-06 21:34:33 +0000
commit1920a99115949dc946f044b10f0ba978319acddb (patch)
tree37036ce0aa5167e4f49a4b7ee661ffb8bc4e8319
parent12e22d5bc1afe302206897ad7ea51dcd22f0e857 (diff)
util/bitset: Wrap __size in braces
Otherwise funny things can happen with the < operator because of precedence rules. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37908>
-rw-r--r--src/util/bitset.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index 7e10b78c2eb..0f13b4ce2ec 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -423,7 +423,7 @@ __bitset_next_set(unsigned i, BITSET_WORD *tmp,
#define BITSET_FOREACH_SET(__i, __set, __size) \
for (BITSET_WORD __tmp = (__size) == 0 ? 0 : *(__set), *__foo = &__tmp; __foo != NULL; __foo = NULL) \
for (__i = 0; \
- (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
+ (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < (__size);)
static inline void
__bitset_next_range(unsigned *start, unsigned *end, const BITSET_WORD *set,