From d3b7d6febef6d0ae588ac4b176a735d7bc522942 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 23 Sep 2022 11:15:16 +0200 Subject: Renamed c_forloop* macros to more descriptive c_forwhile*. --- include/stc/ccommon.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index d01254a6..59056905 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -176,11 +176,11 @@ STC_INLINE char* c_strnstrn(const char *s, const char *needle, #define c_forfilter5(it, C, cnt, filter, cond) \ c_forfilter_s(it, C, C##_begin(&cnt), filter, cond) #define c_forfilter_s(it, C, start, filter, cond) \ - c_forloop_s(it, C, start, cond) if (!((filter) && ++it.count)) ; else + c_forwhile_s(it, C, start, cond) if (!((filter) && ++it.count)) ; else -#define c_forloop(i, C, cnt, cond) \ - c_forloop_s(i, C, C##_begin(&cnt), cond) -#define c_forloop_s(i, C, start, cond) \ +#define c_forwhile(i, C, cnt, cond) \ + c_forwhile_s(i, C, C##_begin(&cnt), cond) +#define c_forwhile_s(i, C, start, cond) \ for (struct {C##_iter it; const C##_value *ref; size_t index, count;} \ i = {.it=start, .ref=i.it.ref}; i.ref && (cond) \ ; C##_next(&i.it), i.ref = i.it.ref, ++i.index) -- cgit v1.2.3