summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/queue.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/queue.c
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-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/queue.c')
-rw-r--r--misc/examples/queue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/queue.c b/misc/examples/queue.c
index ee537b58..4064cc77 100644
--- a/misc/examples/queue.c
+++ b/misc/examples/queue.c
@@ -11,15 +11,15 @@ int main() {
stc64_t rng = stc64_new(1234);
dist = stc64_uniform_new(0, n);
- c_AUTO (cqueue_i, queue)
+ c_auto (cqueue_i, queue)
{
// Push ten million random numbers onto the queue.
- c_FORRANGE (n)
+ c_forrange (n)
cqueue_i_push(&queue, (int)stc64_uniform(&rng, &dist));
// Push or pop on the queue ten million times
printf("%d\n", n);
- c_FORRANGE (n) { // forrange uses initial n only.
+ c_forrange (n) { // forrange uses initial n only.
int r = (int)stc64_uniform(&rng, &dist);
if (r & 1)
++n, cqueue_i_push(&queue, r);