From 00804d9ff488f63468a0bb528c7b807aea7c3ea3 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 18 Apr 2022 00:44:51 +0200 Subject: Converted all example to use cstr_str(&s) instead of s.str to allow SSO string. Fixed misc warnings. --- examples/hashmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/hashmap.c') diff --git a/examples/hashmap.c b/examples/hashmap.c index c3e9afce..e81a0405 100644 --- a/examples/hashmap.c +++ b/examples/hashmap.c @@ -26,14 +26,14 @@ int main(void) { const cmap_str_value* v; if ((v = cmap_str_get(&contacts, "Daniel"))) - printf("Calling Daniel: %s\n", call(v->second.str)); + printf("Calling Daniel: %s\n", call(cstr_str(&v->second))); else printf("Don't have Daniel's number."); cmap_str_emplace(&contacts, "Daniel", "164-6743"); if ((v = cmap_str_get(&contacts, "Ashley"))) - printf("Calling Ashley: %s\n", call(v->second.str)); + printf("Calling Ashley: %s\n", call(cstr_str(&v->second))); else printf("Don't have Ashley's number."); @@ -41,7 +41,7 @@ int main(void) { puts(""); c_forpair (contact, number, cmap_str, contacts) { - printf("Calling %s: %s\n", _.contact.str, call(_.number.str)); + printf("Calling %s: %s\n", cstr_str(&_.contact), call(cstr_str(&_.number))); } puts(""); } -- cgit v1.2.3