diff options
| author | Tyge Løvset <[email protected]> | 2023-02-08 16:16:49 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-08 17:18:24 +0100 |
| commit | c4441f5fc665194fbd7a894a67a64a08c3beac42 (patch) | |
| tree | 82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/new_sptr.c | |
| parent | 673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff) | |
| download | STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip | |
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/examples/new_sptr.c')
| -rw-r--r-- | misc/examples/new_sptr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/new_sptr.c b/misc/examples/new_sptr.c index 116827a4..68454970 100644 --- a/misc/examples/new_sptr.c +++ b/misc/examples/new_sptr.c @@ -48,7 +48,7 @@ void Person_drop(Person* p) { 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")); @@ -57,7 +57,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)); @@ -66,7 +66,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(""); } |
