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/new_sptr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/new_sptr.c') diff --git a/examples/new_sptr.c b/examples/new_sptr.c index 61eaf5ae..2fb058df 100644 --- a/examples/new_sptr.c +++ b/examples/new_sptr.c @@ -10,7 +10,7 @@ Person Person_clone(Person p) { return p; } void Person_drop(Person* p) { - printf("drop: %s %s\n", p->name.str, p->last.str); + printf("drop: %s %s\n", cstr_str(&p->name), cstr_str(&p->last)); c_drop(cstr, &p->name, &p->last); } @@ -37,7 +37,7 @@ int main(void) { q = carc_person_clone(p); r = carc_person_clone(p); s = carc_person_from(Person_clone(*p.get)); // deep copy - printf("%s %s. uses: %lu\n", r.get->name.str, s.get->last.str, *p.use_count); + printf("%s %s. uses: %lu\n", cstr_str(&r.get->name), cstr_str(&s.get->last), *p.use_count); } c_auto (cstack_iptr, stk) { -- cgit v1.2.3