diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/set.c | 6 | ||||
-rw-r--r-- | src/util/set.h | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/util/set.c b/src/util/set.c index feef96d16ea..fe5b10f0fee 100644 --- a/src/util/set.c +++ b/src/util/set.c @@ -168,8 +168,6 @@ _mesa_set_destroy(struct set *ht, void (*delete_function)(struct set_entry *entr return; if (delete_function) { - struct set_entry *entry; - set_foreach (ht, entry) { delete_function(entry); } @@ -187,8 +185,6 @@ _mesa_set_destroy(struct set *ht, void (*delete_function)(struct set_entry *entr void _mesa_set_clear(struct set *set, void (*delete_function)(struct set_entry *entry)) { - struct set_entry *entry; - if (!set) return; @@ -256,7 +252,7 @@ static void set_rehash(struct set *ht, unsigned new_size_index) { struct set old_ht; - struct set_entry *table, *entry; + struct set_entry *table; if (new_size_index >= ARRAY_SIZE(hash_sizes)) return; diff --git a/src/util/set.h b/src/util/set.h index ffd19a798bd..54719e4c8ab 100644 --- a/src/util/set.h +++ b/src/util/set.h @@ -96,9 +96,9 @@ _mesa_set_random_entry(struct set *set, * insertion (which may rehash the set, making entry a dangling * pointer). */ -#define set_foreach(set, entry) \ - for (entry = _mesa_set_next_entry(set, NULL); \ - entry != NULL; \ +#define set_foreach(set, entry) \ + for (struct set_entry *entry = _mesa_set_next_entry(set, NULL); \ + entry != NULL; \ entry = _mesa_set_next_entry(set, entry)) #ifdef __cplusplus |