Updating foreach macros with the new iterators API
This commit is contained in:
1 parent
7c82fff41d
commit
e4a7b01d3a
1 file changed
+4
-4
+4
-4
@@ -21,11 +21,11 @@
|
|||||||
#define CMC_FOREACH_H
|
#define CMC_FOREACH_H
|
||||||
|
|
||||||
#define CMC_FOREACH(PFX, SNAME, ITERNAME, TARGET) \
|
#define CMC_FOREACH(PFX, SNAME, ITERNAME, TARGET) \
|
||||||
for (struct SNAME##_iter ITERNAME = (TARGET)->it_start(TARGET); \
|
for (struct SNAME##_iter ITERNAME = PFX##_iter_start(TARGET); \
|
||||||
!PFX##_iter_end(&ITERNAME); PFX##_iter_next(&ITERNAME))
|
!PFX##_iter_at_end(&ITERNAME); PFX##_iter_next(&ITERNAME))
|
||||||
|
|
||||||
#define CMC_FOREACH_REV(PFX, SNAME, ITERNAME, TARGET) \
|
#define CMC_FOREACH_REV(PFX, SNAME, ITERNAME, TARGET) \
|
||||||
for (struct SNAME##_iter ITERNAME = (TARGET)->it_end(TARGET); \
|
for (struct SNAME##_iter ITERNAME = PFX##_iter_end(TARGET); \
|
||||||
!PFX##_iter_start(&ITERNAME); PFX##_iter_prev(&ITERNAME))
|
!PFX##_iter_at_start(&ITERNAME); PFX##_iter_prev(&ITERNAME))
|
||||||
|
|
||||||
#endif /* CMC_FOREACH_H */
|
#endif /* CMC_FOREACH_H */
|
||||||
Reference in new issue
Block a user