summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/printspan.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-23 00:00:15 +0100
committerTyge Løvset <[email protected]>2023-01-23 00:00:15 +0100
commitd23fb483c4fc98a68eb9cdb0d544002c26accb0a (patch)
treea5ce653bddefeed2472058b2fbd20c4163cc5d76 /misc/examples/printspan.c
parent6275a2e475a9643f6a65a2ad9f13615aec9e48a5 (diff)
downloadSTC-modified-d23fb483c4fc98a68eb9cdb0d544002c26accb0a.tar.gz
STC-modified-d23fb483c4fc98a68eb9cdb0d544002c26accb0a.zip
Renamed c_init() to c_make().
Diffstat (limited to 'misc/examples/printspan.c')
-rw-r--r--misc/examples/printspan.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/misc/examples/printspan.c b/misc/examples/printspan.c
index 8d0b0321..227fd2ed 100644
--- a/misc/examples/printspan.c
+++ b/misc/examples/printspan.c
@@ -27,25 +27,28 @@ int main()
c_AUTO (cdeq_int, deq)
c_AUTO (cset_str, set)
{
- printMe( c_init(intspan, {1, 2, 3}) );
+ intspan sp1 = cspan_init(intspan, {1, 2});
+ printMe( sp1 );
+
+ printMe( c_make(intspan, {1, 2, 3}) );
int arr[] = {1, 2, 3, 4, 5, 6};
- intspan span = cspan_from_array(arr);
- printMe( (intspan)cspan_subspan(&span, 1, 4) );
+ intspan sp2 = cspan_from_array(arr);
+ printMe( (intspan)cspan_subspan(&sp2, 1, 4) );
c_FORLIST (i, int, {1, 2, 3, 4, 5})
cvec_int_push(&vec, *i.ref);
printMe( (intspan)cspan_from(&vec) );
- printMe( span );
+ printMe( sp2 );
- stk = c_init(cstack_int, {1, 2, 3, 4, 5, 6, 7});
+ stk = c_make(cstack_int, {1, 2, 3, 4, 5, 6, 7});
printMe( (intspan)cspan_from(&stk) );
- deq = c_init(cdeq_int, {1, 2, 3, 4, 5, 6, 7, 8});
+ deq = c_make(cdeq_int, {1, 2, 3, 4, 5, 6, 7, 8});
printMe( (intspan)cspan_from(&deq) );
- set = c_init(cset_str, {"1", "2", "3", "4", "5", "6", "7", "8", "9"});
+ set = c_make(cset_str, {"1", "2", "3", "4", "5", "6", "7", "8", "9"});
printf("%d:", (int)cset_str_size(&set));
c_FOREACH (e, cset_str, set)
printf(" %s", cstr_str(e.ref));