diff options
| author | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-23 23:55:10 +0100 |
| commit | d623c6c85071b9af5d607bb5d9aceceaea05220a (patch) | |
| tree | f20fc3714f86e1553d1103bed6dc8efefcbd9d6b /misc/examples/new_sptr.c | |
| parent | 5f57d597cd27aef55adbcb3b452973b0c6e33667 (diff) | |
| download | STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.tar.gz STC-modified-d623c6c85071b9af5d607bb5d9aceceaea05220a.zip | |
Experimental uppercase macros.
Diffstat (limited to 'misc/examples/new_sptr.c')
| -rw-r--r-- | misc/examples/new_sptr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/new_sptr.c b/misc/examples/new_sptr.c index 2c6b28d6..90ce30b2 100644 --- a/misc/examples/new_sptr.c +++ b/misc/examples/new_sptr.c @@ -42,12 +42,12 @@ Person Person_clone(Person p) { } void Person_drop(Person* p) { printf("drop: %s %s\n", cstr_str(&p->name), cstr_str(&p->last)); - c_drop(cstr, &p->name, &p->last); + c_DROP(cstr, &p->name, &p->last); } int main(void) { - c_auto (PersonArc, p, q, r, s) + c_AUTO (PersonArc, p, q, r, s) { puts("Ex1"); p = PersonArc_from(Person_make("John", "Smiths")); @@ -56,7 +56,7 @@ int main(void) { s = PersonArc_from(Person_clone(*p.get)); // deep copy printf("%s %s: refs %ld\n", cstr_str(&p.get->name), cstr_str(&p.get->last), *p.use_count); } - c_auto (IPStack, vec) + c_AUTO (IPStack, vec) { puts("Ex2"); IPStack_push(&vec, IPtr_from(10)); @@ -65,7 +65,7 @@ int main(void) { IPStack_push(&vec, IPtr_clone(*IPStack_back(&vec))); IPStack_push(&vec, IPtr_clone(*IPStack_front(&vec))); - c_foreach (i, IPStack, vec) + c_FOREACH (i, IPStack, vec) printf(" (%d: refs %ld)", *i.ref->get, *i.ref->use_count); puts(""); } |
