diff options
| author | Tyge Løvset <[email protected]> | 2023-02-08 16:16:49 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-08 17:18:24 +0100 |
| commit | c4441f5fc665194fbd7a894a67a64a08c3beac42 (patch) | |
| tree | 82f231b6e8fcb75625166f98aa785baaa265a3d6 /include/stc/clist.h | |
| parent | 673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff) | |
| download | STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip | |
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'include/stc/clist.h')
| -rw-r--r-- | include/stc/clist.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h index de874927..f257bc19 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -34,19 +34,19 @@ int main() { - c_AUTO (clist_ix, list) + c_auto (clist_ix, list) { int n; for (int i = 0; i < 1000000; ++i) // one million clist_ix_push_back(&list, crandom() >> 32); n = 0; - c_FOREACH (i, clist_ix, list) + c_foreach (i, clist_ix, list) if (++n % 10000 == 0) printf("%8d: %10zu\n", n, *i.ref); // Sort them... clist_ix_sort(&list); // mergesort O(n*log n) n = 0; puts("sorted"); - c_FOREACH (i, clist_ix, list) + c_foreach (i, clist_ix, list) if (++n % 10000 == 0) printf("%8d: %10zu\n", n, *i.ref); } } @@ -273,7 +273,7 @@ _clist_mergesort(clist_VOID_node *list, int (*cmp)(const clist_VOID_node*, const STC_DEF _cx_self _cx_memb(_clone)(_cx_self cx) { _cx_self out = _cx_memb(_init)(); - c_FOREACH (it, _cx_self, cx) + c_foreach (it, _cx_self, cx) _cx_memb(_push_back)(&out, i_keyclone((*it.ref))); return out; } @@ -406,7 +406,7 @@ _cx_memb(_split_off)(_cx_self* self, _cx_iter it1, _cx_iter it2) { STC_DEF _cx_iter _cx_memb(_find_in)(_cx_iter it1, _cx_iter it2, _cx_raw val) { - c_FOREACH (it, _cx_self, it1, it2) { + c_foreach (it, _cx_self, it1, it2) { _cx_raw r = i_keyto(it.ref); if (i_eq((&r), (&val))) return it; |
