From d623c6c85071b9af5d607bb5d9aceceaea05220a Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 23 Dec 2022 23:55:10 +0100 Subject: Experimental uppercase macros. --- misc/examples/multimap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'misc/examples/multimap.c') diff --git a/misc/examples/multimap.c b/misc/examples/multimap.c index e72bdce3..8797c24e 100644 --- a/misc/examples/multimap.c +++ b/misc/examples/multimap.c @@ -60,17 +60,17 @@ OlympicLocation OlympicLocation_clone(OlympicLocation loc) { return loc; } void OlympicLocation_drop(OlympicLocation* self) { - c_drop(cstr, &self->city, &self->date); + c_DROP(cstr, &self->city, &self->date); } 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(); - for (size_t i = 0; i < c_arraylen(ol_data); ++i) + for (size_t i = 0; i < c_ARRAYLEN(ol_data); ++i) { struct OlympicsData* d = &ol_data[i]; OlympicLocation loc = {.year = d->year, @@ -82,14 +82,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), -- cgit v1.2.3