summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/new_map.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/new_map.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/new_map.c')
-rw-r--r--misc/examples/new_map.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/examples/new_map.c b/misc/examples/new_map.c
index 9cee987d..a4d5289c 100644
--- a/misc/examples/new_map.c
+++ b/misc/examples/new_map.c
@@ -42,10 +42,10 @@ int point_cmp(const Point* a, const Point* b) {
int main()
{
- c_AUTO (cmap_int, map)
- c_AUTO (cmap_pnt, pmap)
- c_AUTO (cmap_str, smap)
- c_AUTO (cset_str, sset)
+ c_auto (cmap_int, map)
+ c_auto (cmap_pnt, pmap)
+ c_auto (cmap_str, smap)
+ c_auto (cset_str, sset)
{
cmap_int_insert(&map, 123, 321);
cmap_int_insert(&map, 456, 654);
@@ -53,7 +53,7 @@ int main()
pmap = c_make(cmap_pnt, {{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}});
- c_FOREACH (i, cmap_pnt, pmap)
+ c_foreach (i, cmap_pnt, pmap)
printf(" (%d, %d: %d)", i.ref->first.x, i.ref->first.y, i.ref->second);
puts("");
@@ -68,7 +68,7 @@ int main()
"So long",
});
- c_FOREACH (i, cset_str, sset)
+ c_foreach (i, cset_str, sset)
printf(" %s\n", cstr_str(i.ref));
}
}