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>
This commit is contained in:
Natalie Vock 2025-10-21 11:12:22 +02:00 committed by Marge Bot
parent 12e22d5bc1
commit 1920a99115

View file

@ -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,