summaryrefslogtreecommitdiffhomepage
path: root/examples/hashmap.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/hashmap.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/hashmap.c')
-rw-r--r--examples/hashmap.c6
1 files changed, 3 insertions, 3 deletions
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("");
}