util: Remove tmp argument from BITSET_FOREACH_SET macro
[mesa.git] / src / util / bitset.h
index f58d9f214e647c98ecb3f8752212c50fe6dda08b..0fdfe205f39e93ed525ae8f74bebd5310bce06dc 100644 (file)
@@ -133,13 +133,13 @@ __bitset_next_set(unsigned i, BITSET_WORD *tmp,
  * Iterates over each set bit in a set
  *
  * @param __i    iteration variable, bit number
- * @param __tmp  an internally-used temporary bitset
  * @param __set  the bitset to iterate (will not be modified)
  * @param __size number of bits in the set to consider
  */
-#define BITSET_FOREACH_SET(__i, __tmp, __set, __size) \
-   for (__tmp = *(__set), __i = 0; \
-        (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
+#define BITSET_FOREACH_SET(__i, __set, __size) \
+   for (BITSET_WORD __tmp = *(__set), *__foo = &__tmp; __foo != NULL; __foo = NULL) \
+      for (__i = 0; \
+           (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
 
 #ifdef __cplusplus