summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/sorted_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/sorted_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/sorted_map.c')
-rw-r--r--misc/examples/sorted_map.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/misc/examples/sorted_map.c b/misc/examples/sorted_map.c
index 47509edb..c4a05c76 100644
--- a/misc/examples/sorted_map.c
+++ b/misc/examples/sorted_map.c
@@ -9,7 +9,7 @@ int main()
{
// empty map containers
- c_AUTO (csmap_int, gquiz1, gquiz2)
+ c_auto (csmap_int, gquiz1, gquiz2)
{
// insert elements in random order
csmap_int_insert(&gquiz1, 2, 30);
@@ -22,17 +22,17 @@ int main()
// printing map gquiz1
printf("\nThe map gquiz1 is :\n\tKEY\tELEMENT\n");
- c_FOREACH (itr, csmap_int, gquiz1)
+ c_foreach (itr, csmap_int, gquiz1)
printf("\t%d\t%d\n", itr.ref->first, itr.ref->second);
printf("\n");
// assigning the elements from gquiz1 to gquiz2
- c_FOREACH (i, csmap_int, gquiz1)
+ c_foreach (i, csmap_int, gquiz1)
csmap_int_insert(&gquiz2, i.ref->first, i.ref->second);
// print all elements of the map gquiz2
printf("\nThe map gquiz2 is :\n\tKEY\tELEMENT\n");
- c_FOREACH (itr, csmap_int, gquiz2)
+ c_foreach (itr, csmap_int, gquiz2)
printf("\t%d\t%d\n", itr.ref->first, itr.ref->second);
printf("\n");
@@ -41,7 +41,7 @@ int main()
printf("\tKEY\tELEMENT\n");
csmap_int_erase_range(&gquiz2, csmap_int_begin(&gquiz2),
csmap_int_find(&gquiz2, 3));
- c_FOREACH (itr, csmap_int, gquiz2)
+ c_foreach (itr, csmap_int, gquiz2)
printf("\t%d\t%d\n", itr.ref->first, itr.ref->second);
printf("\n");
@@ -49,7 +49,7 @@ int main()
int num = csmap_int_erase(&gquiz2, 4);
printf("\ngquiz2.erase(4) : %d removed\n", num);
printf("\tKEY\tELEMENT\n");
- c_FOREACH (itr, csmap_int, gquiz2)
+ c_foreach (itr, csmap_int, gquiz2)
printf("\t%d\t%d\n", itr.ref->first, itr.ref->second);
printf("\n");