summaryrefslogtreecommitdiffhomepage
path: root/examples/multimap.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-18 00:44:51 +0200
committerTyge Løvset <[email protected]>2022-04-18 00:44:51 +0200
commit00804d9ff488f63468a0bb528c7b807aea7c3ea3 (patch)
tree51b47787adc853bd1a10ec820a6ef5c184fa2498 /examples/multimap.c
parent4436a1c0ac37dc2e73a2134d5ad85c010340b35d (diff)
downloadSTC-modified-00804d9ff488f63468a0bb528c7b807aea7c3ea3.tar.gz
STC-modified-00804d9ff488f63468a0bb528c7b807aea7c3ea3.zip
Converted all example to use cstr_str(&s) instead of s.str to allow SSO string. Fixed misc warnings.
Diffstat (limited to 'examples/multimap.c')
-rw-r--r--examples/multimap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/multimap.c b/examples/multimap.c
index 472af8aa..08fd8ad5 100644
--- a/examples/multimap.c
+++ b/examples/multimap.c
@@ -70,7 +70,7 @@ int main()
{
const clist_OL empty = clist_OL_init();
- for (int 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,
@@ -90,9 +90,10 @@ int main()
{
// Loop the locations for a country sorted by year
c_foreach (loc, clist_OL, country.ref->second)
- printf("%s: %d, %s, %s\n", country.ref->first.str, loc.ref->year,
- loc.ref->city.str,
- loc.ref->date.str);
+ printf("%s: %d, %s, %s\n", cstr_str(&country.ref->first),
+ loc.ref->year,
+ cstr_str(&loc.ref->city),
+ cstr_str(&loc.ref->date));
}
}
}