summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/mapmap.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/mapmap.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/mapmap.c')
-rw-r--r--misc/examples/mapmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/mapmap.c b/misc/examples/mapmap.c
index d5fe9c81..cad5e462 100644
--- a/misc/examples/mapmap.c
+++ b/misc/examples/mapmap.c
@@ -36,7 +36,7 @@ void add(Departments* deps, const char* name, const char* email, const char* dep
int contains(Departments* map, const char* name)
{
int count = 0;
- c_FOREACH (i, Departments, *map)
+ c_foreach (i, Departments, *map)
if (People_contains(&i.ref->second, name))
++count;
return count;
@@ -44,7 +44,7 @@ int contains(Departments* map, const char* name)
int main(void)
{
- c_AUTO (Departments, map)
+ c_auto (Departments, map)
{
add(&map, "Anna Kendro", "[email protected]", "Support");
add(&map, "Terry Dane", "[email protected]", "Development");
@@ -60,8 +60,8 @@ int main(void)
add(&map, "Dennis Kay", "[email protected]", "Marketing");
add(&map, "Anne Dickens", "[email protected]", "Development");
- c_FOREACH (i, Departments, map)
- c_FORPAIR (name, email, People, i.ref->second)
+ c_foreach (i, Departments, map)
+ c_forpair (name, email, People, i.ref->second)
printf("%s: %s - %s\n", cstr_str(&i.ref->first), cstr_str(_.name), cstr_str(_.email));
puts("");