summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/multidim.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/multidim.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/multidim.c')
-rw-r--r--misc/examples/multidim.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/misc/examples/multidim.c b/misc/examples/multidim.c
index e61959ca..3980e6d8 100644
--- a/misc/examples/multidim.c
+++ b/misc/examples/multidim.c
@@ -8,9 +8,7 @@ using_cspan3(ispan, int);
int main()
{
- cstack_int v = {0};
- c_FORLIST (i, int, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24})
- cstack_int_push(&v, *i.ref);
+ cstack_int v = c_make(cstack_int, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24});
// View data as contiguous memory representing 24 ints
ispan ms1 = cspan_from(&v);
@@ -44,7 +42,7 @@ int main()
}
puts("Iterate ss3 flat:");
- c_FOREACH (i, ispan3, ss3)
+ c_foreach (i, ispan3, ss3)
printf(" %d", *i.ref);
puts("");
@@ -62,7 +60,7 @@ int main()
puts("iterate subspan ms3[1]:");
ispan2 sub = cspan_submd3(&ms3, 1);
- c_FOREACH (i, ispan2, sub)
+ c_foreach (i, ispan2, sub)
printf(" %d", *i.ref);
puts("");