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 /misc/examples/functor.c | |
| 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 'misc/examples/functor.c')
| -rw-r--r-- | misc/examples/functor.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/functor.c b/misc/examples/functor.c index f1db3644..6d42c4f8 100644 --- a/misc/examples/functor.c +++ b/misc/examples/functor.c @@ -45,23 +45,23 @@ int main() { const int data[] = {1,8,5,6,3,4,0,9,7,2}, n = c_ARRAYLEN(data); printf("data: \t"); - c_FORRANGE (i, n) printf("%d ", data[i]); + c_forrange (i, n) printf("%d ", data[i]); puts(""); IPQueue q1 = {ipque_init(), int_less}; // Max priority queue IPQueue minq1 = {ipque_init(), int_greater}; // Min priority queue IPQueue q5 = {ipque_init(), int_lambda}; // Using lambda to compare elements. - c_DEFER (ipque_drop(&q1.Q), ipque_drop(&minq1.Q), ipque_drop(&q5.Q)) + c_defer (ipque_drop(&q1.Q), ipque_drop(&minq1.Q), ipque_drop(&q5.Q)) { - c_FORRANGE (i, n) + c_forrange (i, n) ipque_push(&q1.Q, data[i]); print_queue("q1", q1); - c_FORRANGE (i, n) + c_forrange (i, n) ipque_push(&minq1.Q, data[i]); print_queue("minq1", minq1); - c_FORRANGE (i, n) + c_forrange (i, n) ipque_push(&q5.Q, data[i]); print_queue("q5", q5); } |
