summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/multimap.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/multimap.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/multimap.c')
-rw-r--r--misc/examples/multimap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/multimap.c b/misc/examples/multimap.c
index ba0bf71b..1d5d259d 100644
--- a/misc/examples/multimap.c
+++ b/misc/examples/multimap.c
@@ -69,7 +69,7 @@ void OlympicLoc_drop(OlympicLoc* self) {
int main()
{
// Define the multimap with destructor defered to when block is completed.
- c_AUTO (csmap_OL, multimap)
+ c_auto (csmap_OL, multimap)
{
const clist_OL empty = clist_OL_init();
@@ -85,14 +85,14 @@ int main()
clist_OL_push_back(list, loc);
}
// Sort locations by year for each country.
- c_FOREACH (country, csmap_OL, multimap)
+ c_foreach (country, csmap_OL, multimap)
clist_OL_sort(&country.ref->second);
// Print the multimap:
- c_FOREACH (country, csmap_OL, multimap)
+ c_foreach (country, csmap_OL, multimap)
{
// Loop the locations for a country sorted by year
- c_FOREACH (loc, clist_OL, country.ref->second)
+ c_foreach (loc, clist_OL, country.ref->second)
printf("%s: %d, %s, %s\n", cstr_str(&country.ref->first),
loc.ref->year,
cstr_str(&loc.ref->city),