Changed for_each var to value
This commit is contained in:
1 parent
fa40f35235
commit
524bc30b69
5 files changed
+66
-66
No files matched your search
+23
-23
@@ -14,31 +14,31 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define FOR_EACH(PFX, SNAME, V, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
V var; \
|
||||
SNAME##_iter iter; \
|
||||
PFX##_iter_new(&iter, TARGET); \
|
||||
while (PFX##_iter_next(&iter, &var, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
#define FOR_EACH(PFX, SNAME, V, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
V value; \
|
||||
SNAME##_iter iter; \
|
||||
PFX##_iter_new(&iter, TARGET); \
|
||||
while (PFX##_iter_next(&iter, &value, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define FOR_EACH_REV(PFX, SNAME, V, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
V var; \
|
||||
SNAME##_iter iter; \
|
||||
PFX##_iter_new(&iter, TARGET); \
|
||||
PFX##_iter_toend(&iter); \
|
||||
while (PFX##_iter_prev(&iter, &var, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
#define FOR_EACH_REV(PFX, SNAME, V, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
V value; \
|
||||
SNAME##_iter iter; \
|
||||
PFX##_iter_new(&iter, TARGET); \
|
||||
PFX##_iter_toend(&iter); \
|
||||
while (PFX##_iter_prev(&iter, &value, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define FOR_EACH_MAP(PFX, SNAME, K, V, TARGET, BODY) \
|
||||
|
||||
Reference in new issue
Block a user