About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2020-01-21 15:07:24 -0800
committerMarge Bot <eric+marge@anholt.net>2020-01-23 01:52:43 +0000
commit4413537c80b58978f61f468a5a36d1d75756d6b3 (patch)
tree67363cae1c92d1d406bee03f5016318bc55b5c78 /src/util
parentd3eb2a0951ede3c7dcce891c3a153f3ebbb59bae (diff)
util: Remove tmp argument from BITSET_FOREACH_SET macro
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3499> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3499>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bitset.h8
-rw-r--r--src/util/register_allocate.c3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index f58d9f214e6..0fdfe205f39 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -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
diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
index 35273630459..85453d25290 100644
--- a/src/util/register_allocate.c
+++ b/src/util/register_allocate.c
@@ -342,10 +342,9 @@ void
ra_make_reg_conflicts_transitive(struct ra_regs *regs, unsigned int r)
{
struct ra_reg *reg = &regs->regs[r];
- BITSET_WORD tmp;
int c;
- BITSET_FOREACH_SET(c, tmp, reg->conflicts, regs->count) {
+ BITSET_FOREACH_SET(c, reg->conflicts, regs->count) {
struct ra_reg *other = &regs->regs[c];
unsigned i;
for (i = 0; i < BITSET_WORDS(regs->count); i++)