diff options
| author | Tyge Løvset <[email protected]> | 2022-09-22 18:41:08 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-22 18:41:08 +0200 |
| commit | d70bcf4d875c14da30a39acfc37d00391cc1e7a9 (patch) | |
| tree | 9ff98aeb2fbb5894fc9720146f67165b519d1602 /include | |
| parent | 047044ba50d73d81ed6ed1c77324c9bf873876cb (diff) | |
| download | STC-modified-d70bcf4d875c14da30a39acfc37d00391cc1e7a9.tar.gz STC-modified-d70bcf4d875c14da30a39acfc37d00391cc1e7a9.zip | |
mend
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/ccommon.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 29cb0761..9dab76c9 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -181,9 +181,9 @@ STC_INLINE char* c_strnstrn(const char *s, const char *needle, #define c_forloop(i, C, cnt, cond) \ c_forloop_s(i, C, C##_begin(&cnt), cond) #define c_forloop_s(i, C, start, cond) \ - for (struct {C##_iter it; const C##_value *ref; size_t idx, taken;} \ - i = {.it=start, .ref=i.it.ref, .idx=0, .taken=0} \ - ; i.ref && (cond); C##_next(&i.it), i.ref = i.it.ref, ++i.idx) + for (struct {C##_iter it; const C##_value *ref; size_t index, taken;} \ + i = {.it=start, .ref=i.it.ref}; i.ref && (cond) \ + ; C##_next(&i.it), i.ref = i.it.ref, ++i.index) #define c_forpair(key, val, C, cnt) /* structured binding */ \ for (struct {C##_iter _it; const C##_key* key; C##_mapped* val;} _ = {C##_begin(&cnt)} \ |
