summaryrefslogtreecommitdiffstats
path: root/src/util/set.h
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-10-20 18:00:09 +0100
committerEric Engestrom <[email protected]>2018-10-25 12:43:18 +0100
commite27902a261361e8a7980db14138ef13753db196d (patch)
tree021b6638314baf37073766f1092e2be736da75aa /src/util/set.h
parentbb84fa146f2252f22999205a2904d8a948bffd3b (diff)
util: use C99 declaration in the for-loop set_foreach() macro
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/util/set.h')
-rw-r--r--src/util/set.h6
1 files changed, 3 insertions, 3 deletions
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