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/priority.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/priority.c')
| -rw-r--r-- | misc/examples/priority.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/priority.c b/misc/examples/priority.c index f39c0634..0a1d419b 100644 --- a/misc/examples/priority.c +++ b/misc/examples/priority.c @@ -12,22 +12,22 @@ int main() { intptr_t N = 10000000; stc64_t rng = stc64_new((uint64_t)time(NULL)); stc64_uniform_t dist = stc64_uniform_new(0, N * 10); - c_AUTO (cpque_i, heap) + c_auto (cpque_i, heap) { // Push ten million random numbers to priority queue printf("Push %" c_ZI " numbers\n", N); - c_FORRANGE (N) + c_forrange (N) cpque_i_push(&heap, stc64_uniform(&rng, &dist)); // push some negative numbers too. - c_FORLIST (i, int, {-231, -32, -873, -4, -343}) + c_forlist (i, int, {-231, -32, -873, -4, -343}) cpque_i_push(&heap, *i.ref); - c_FORRANGE (N) + c_forrange (N) cpque_i_push(&heap, stc64_uniform(&rng, &dist)); puts("Extract the hundred smallest."); - c_FORRANGE (100) { + c_forrange (100) { printf("%" PRId64 " ", *cpque_i_top(&heap)); cpque_i_pop(&heap); } |
