summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/stack.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/stack.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/stack.c')
-rw-r--r--misc/examples/stack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/stack.c b/misc/examples/stack.c
index 86099607..50dc8eb7 100644
--- a/misc/examples/stack.c
+++ b/misc/examples/stack.c
@@ -11,18 +11,18 @@
#include <stc/cstack.h>
int main() {
- c_AUTO (cstack_i, stack)
- c_AUTO (cstack_c, chars)
+ c_auto (cstack_i, stack)
+ c_auto (cstack_c, chars)
{
- c_FORRANGE (i, 101)
+ c_forrange (i, 101)
cstack_i_push(&stack, (int)(i*i));
printf("%d\n", *cstack_i_top(&stack));
- c_FORRANGE (i, 90)
+ c_forrange (i, 90)
cstack_i_pop(&stack);
- c_FOREACH (i, cstack_i, stack)
+ c_foreach (i, cstack_i, stack)
printf(" %d", *i.ref);
puts("");
printf("top: %d\n", *cstack_i_top(&stack));