diff options
| author | Tyge Løvset <[email protected]> | 2023-05-20 00:40:54 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-05-20 00:40:54 +0200 |
| commit | bb59d9c87f8d99f50c439351480c0ec8d6eea38e (patch) | |
| tree | c8e273e7a63332ca37a5a15e9c81e534b8af7e44 /misc | |
| parent | 26513bb1352ab4e4ffe931aabd80868216afc551 (diff) | |
| download | STC-modified-bb59d9c87f8d99f50c439351480c0ec8d6eea38e.tar.gz STC-modified-bb59d9c87f8d99f50c439351480c0ec8d6eea38e.zip | |
Rename c_make() macro to c_init(). c_make still available, but deprecated.
Diffstat (limited to 'misc')
| -rw-r--r-- | misc/examples/arcvec_erase.c | 2 | ||||
| -rw-r--r-- | misc/examples/cointerleave.c | 4 | ||||
| -rw-r--r-- | misc/examples/convert.c | 2 | ||||
| -rw-r--r-- | misc/examples/csmap_erase.c | 2 | ||||
| -rw-r--r-- | misc/examples/csmap_find.c | 2 | ||||
| -rw-r--r-- | misc/examples/csmap_insert.c | 2 | ||||
| -rw-r--r-- | misc/examples/csset_erase.c | 2 | ||||
| -rw-r--r-- | misc/examples/forfilter.c | 2 | ||||
| -rw-r--r-- | misc/examples/forloops.c | 4 | ||||
| -rw-r--r-- | misc/examples/inits.c | 6 | ||||
| -rw-r--r-- | misc/examples/list.c | 2 | ||||
| -rw-r--r-- | misc/examples/list_erase.c | 2 | ||||
| -rw-r--r-- | misc/examples/list_splice.c | 4 | ||||
| -rw-r--r-- | misc/examples/lower_bound.c | 4 | ||||
| -rw-r--r-- | misc/examples/multidim.c | 2 | ||||
| -rw-r--r-- | misc/examples/music_arc.c | 2 | ||||
| -rw-r--r-- | misc/examples/new_list.c | 4 | ||||
| -rw-r--r-- | misc/examples/new_map.c | 6 | ||||
| -rw-r--r-- | misc/examples/new_pque.c | 2 | ||||
| -rw-r--r-- | misc/examples/new_smap.c | 4 | ||||
| -rw-r--r-- | misc/examples/phonebook.c | 2 | ||||
| -rw-r--r-- | misc/examples/printspan.c | 8 | ||||
| -rw-r--r-- | misc/examples/scheduler.c | 2 |
23 files changed, 36 insertions, 36 deletions
diff --git a/misc/examples/arcvec_erase.c b/misc/examples/arcvec_erase.c index 3bf41559..28160c1c 100644 --- a/misc/examples/arcvec_erase.c +++ b/misc/examples/arcvec_erase.c @@ -15,7 +15,7 @@ void show_drop(int* x) { printf("drop: %d\n", *x); } int main() { - Vec vec = c_make(Vec, {2012, 1990, 2012, 2019, 2015}); + Vec vec = c_init(Vec, {2012, 1990, 2012, 2019, 2015}); // clone the second 2012 and push it back. // note: cloning make sure that vec.data[2] has ref count 2. diff --git a/misc/examples/cointerleave.c b/misc/examples/cointerleave.c index aa57808e..e11b2bf3 100644 --- a/misc/examples/cointerleave.c +++ b/misc/examples/cointerleave.c @@ -38,8 +38,8 @@ void interleaved(struct Generator* g) void Use(void) { - IVec a = c_make(IVec, {2, 4, 6, 8, 10, 11}); - IVec b = c_make(IVec, {3, 5, 7, 9}); + IVec a = c_init(IVec, {2, 4, 6, 8, 10, 11}); + IVec b = c_init(IVec, {3, 5, 7, 9}); struct Generator g = {{&a}, {&b}}; diff --git a/misc/examples/convert.c b/misc/examples/convert.c index 138035e9..c5649c55 100644 --- a/misc/examples/convert.c +++ b/misc/examples/convert.c @@ -25,7 +25,7 @@ int main() cvec_str_drop(&values), clist_str_drop(&list) ){ - map = c_make(cmap_str, { + map = c_init(cmap_str, { {"green", "#00ff00"}, {"blue", "#0000ff"}, {"yellow", "#ffff00"}, diff --git a/misc/examples/csmap_erase.c b/misc/examples/csmap_erase.c index 697e6c09..568dae29 100644 --- a/misc/examples/csmap_erase.c +++ b/misc/examples/csmap_erase.c @@ -34,7 +34,7 @@ int main() printmap(m1); // Fill in some data to test with - mymap m2 = c_make(mymap, { + mymap m2 = c_init(mymap, { {10, "Bob"}, {11, "Rob"}, {12, "Robert"}, diff --git a/misc/examples/csmap_find.c b/misc/examples/csmap_find.c index c417567a..92dd0031 100644 --- a/misc/examples/csmap_find.c +++ b/misc/examples/csmap_find.c @@ -42,7 +42,7 @@ void findit(csmap_istr c, csmap_istr_key val) int main() { - csmap_istr m1 = c_make(csmap_istr, {{40, "Zr"}, {45, "Rh"}}); + csmap_istr m1 = c_init(csmap_istr, {{40, "Zr"}, {45, "Rh"}}); cvec_istr v = {0}; puts("The starting map m1 is (key, value):"); diff --git a/misc/examples/csmap_insert.c b/misc/examples/csmap_insert.c index 3da245c7..7708fdc9 100644 --- a/misc/examples/csmap_insert.c +++ b/misc/examples/csmap_insert.c @@ -96,7 +96,7 @@ int main() csmap_ii m4 = {0}; // Insert the elements from an initializer_list - m4 = c_make(csmap_ii, {{4, 44}, {2, 22}, {3, 33}, {1, 11}, {5, 55}}); + m4 = c_init(csmap_ii, {{4, 44}, {2, 22}, {3, 33}, {1, 11}, {5, 55}}); puts("After initializer_list insertion, m4 contains:"); print_ii(m4); puts(""); diff --git a/misc/examples/csset_erase.c b/misc/examples/csset_erase.c index 9fa40682..5fe3fcba 100644 --- a/misc/examples/csset_erase.c +++ b/misc/examples/csset_erase.c @@ -5,7 +5,7 @@ int main() { - csset_int set = c_make(csset_int, {30, 20, 80, 40, 60, 90, 10, 70, 50}); + csset_int set = c_init(csset_int, {30, 20, 80, 40, 60, 90, 10, 70, 50}); c_foreach (k, csset_int, set) printf(" %d", *k.ref); diff --git a/misc/examples/forfilter.c b/misc/examples/forfilter.c index fbb7280f..8ea3e6a1 100644 --- a/misc/examples/forfilter.c +++ b/misc/examples/forfilter.c @@ -17,7 +17,7 @@ void demo1(void) { - IVec vec = c_make(IVec, {0, 1, 2, 3, 4, 5, 80, 6, 7, 80, 8, 9, 80, + IVec vec = c_init(IVec, {0, 1, 2, 3, 4, 5, 80, 6, 7, 80, 8, 9, 80, 10, 11, 12, 13, 14, 15, 80, 16, 17}); c_forfilter (i, IVec, vec, flt_skipValue(i, 80)) diff --git a/misc/examples/forloops.c b/misc/examples/forloops.c index 1fc00614..337cfaa1 100644 --- a/misc/examples/forloops.c +++ b/misc/examples/forloops.c @@ -34,8 +34,8 @@ int main() printf(" %s", *i.ref);
puts("");
- IVec vec = c_make(IVec, {12, 23, 453, 65, 113, 215, 676, 34, 67, 20, 27, 66, 189, 45, 280, 199});
- IMap map = c_make(IMap, {{12, 23}, {453, 65}, {676, 123}, {34, 67}});
+ IVec vec = c_init(IVec, {12, 23, 453, 65, 113, 215, 676, 34, 67, 20, 27, 66, 189, 45, 280, 199});
+ IMap map = c_init(IMap, {{12, 23}, {453, 65}, {676, 123}, {34, 67}});
puts("\n\nc_foreach:");
c_foreach (i, IVec, vec)
diff --git a/misc/examples/inits.c b/misc/examples/inits.c index e098422e..1f01f88a 100644 --- a/misc/examples/inits.c +++ b/misc/examples/inits.c @@ -66,7 +66,7 @@ int main(void) // CMAP CNT - cmap_cnt countries = c_make(cmap_cnt, { + cmap_cnt countries = c_init(cmap_cnt, { {"Norway", 100}, {"Denmark", 50}, {"Iceland", 10}, @@ -88,7 +88,7 @@ int main(void) // CVEC PAIR - cvec_ip pairs1 = c_make(cvec_ip, {{5, 6}, {3, 4}, {1, 2}, {7, 8}}); + cvec_ip pairs1 = c_init(cvec_ip, {{5, 6}, {3, 4}, {1, 2}, {7, 8}}); cvec_ip_sort(&pairs1); c_foreach (i, cvec_ip, pairs1) @@ -98,7 +98,7 @@ int main(void) // CLIST PAIR - clist_ip pairs2 = c_make(clist_ip, {{5, 6}, {3, 4}, {1, 2}, {7, 8}}); + clist_ip pairs2 = c_init(clist_ip, {{5, 6}, {3, 4}, {1, 2}, {7, 8}}); clist_ip_sort(&pairs2); c_foreach (i, clist_ip, pairs2) diff --git a/misc/examples/list.c b/misc/examples/list.c index 363d7fec..ed27aa50 100644 --- a/misc/examples/list.c +++ b/misc/examples/list.c @@ -34,7 +34,7 @@ int main() { puts(""); DList_drop(&list); - list = c_make(DList, {10, 20, 30, 40, 30, 50}); + list = c_init(DList, {10, 20, 30, 40, 30, 50}); const double* v = DList_get(&list, 30); printf("found: %f\n", *v); diff --git a/misc/examples/list_erase.c b/misc/examples/list_erase.c index 0201c2d9..17adf11f 100644 --- a/misc/examples/list_erase.c +++ b/misc/examples/list_erase.c @@ -7,7 +7,7 @@ int main () { - IList L = c_make(IList, {10, 20, 30, 40, 50}); + IList L = c_init(IList, {10, 20, 30, 40, 50}); c_foreach (x, IList, L) printf("%d ", *x.ref); diff --git a/misc/examples/list_splice.c b/misc/examples/list_splice.c index baebca29..73015454 100644 --- a/misc/examples/list_splice.c +++ b/misc/examples/list_splice.c @@ -16,8 +16,8 @@ void print_ilist(const char* s, clist_i list) int main () { - clist_i list1 = c_make(clist_i, {1, 2, 3, 4, 5}); - clist_i list2 = c_make(clist_i, {10, 20, 30, 40, 50}); + clist_i list1 = c_init(clist_i, {1, 2, 3, 4, 5}); + clist_i list2 = c_init(clist_i, {10, 20, 30, 40, 50}); print_ilist("list1:", list1); print_ilist("list2:", list2); diff --git a/misc/examples/lower_bound.c b/misc/examples/lower_bound.c index 6ec7544c..d146c4d9 100644 --- a/misc/examples/lower_bound.c +++ b/misc/examples/lower_bound.c @@ -11,7 +11,7 @@ int main() // TEST SORTED VECTOR { int key, *res; - cvec_int vec = c_make(cvec_int, {40, 600, 1, 7000, 2, 500, 30}); + cvec_int vec = c_init(cvec_int, {40, 600, 1, 7000, 2, 500, 30}); cvec_int_sort(&vec); @@ -40,7 +40,7 @@ int main() // TEST SORTED SET { int key, *res; - csset_int set = c_make(csset_int, {40, 600, 1, 7000, 2, 500, 30}); + csset_int set = c_init(csset_int, {40, 600, 1, 7000, 2, 500, 30}); key = 100; res = csset_int_lower_bound(&set, key).ref; diff --git a/misc/examples/multidim.c b/misc/examples/multidim.c index 3980e6d8..2f3ad907 100644 --- a/misc/examples/multidim.c +++ b/misc/examples/multidim.c @@ -8,7 +8,7 @@ using_cspan3(ispan, int); int main() { - cstack_int v = c_make(cstack_int, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}); + cstack_int v = c_init(cstack_int, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}); // View data as contiguous memory representing 24 ints ispan ms1 = cspan_from(&v); diff --git a/misc/examples/music_arc.c b/misc/examples/music_arc.c index 3714e1d5..87a57783 100644 --- a/misc/examples/music_arc.c +++ b/misc/examples/music_arc.c @@ -32,7 +32,7 @@ void Song_drop(Song* s) { void example3() { - SongVec vec1 = c_make(SongVec, { + SongVec vec1 = c_init(SongVec, { Song_make("Bob Dylan", "The Times They Are A Changing"), Song_make("Aretha Franklin", "Bridge Over Troubled Water"), Song_make("Thalia", "Entre El Mar y Una Estrella") diff --git a/misc/examples/new_list.c b/misc/examples/new_list.c index 14fabb4a..993f1aac 100644 --- a/misc/examples/new_list.c +++ b/misc/examples/new_list.c @@ -48,7 +48,7 @@ int main() clist_pnt_push_back(&my.pntlst, (Point){123, 456}); MyStruct_drop(&my); - clist_pnt plst = c_make(clist_pnt, {{42, 14}, {32, 94}, {62, 81}}); + clist_pnt plst = c_init(clist_pnt, {{42, 14}, {32, 94}, {62, 81}}); clist_pnt_sort(&plst); c_foreach (i, clist_pnt, plst) @@ -57,7 +57,7 @@ int main() clist_pnt_drop(&plst); - clist_float flst = c_make(clist_float, {123.3f, 321.2f, -32.2f, 78.2f}); + clist_float flst = c_init(clist_float, {123.3f, 321.2f, -32.2f, 78.2f}); clist_float_sort(&flst); c_foreach (i, clist_float, flst) diff --git a/misc/examples/new_map.c b/misc/examples/new_map.c index f01db64f..1f50db83 100644 --- a/misc/examples/new_map.c +++ b/misc/examples/new_map.c @@ -42,18 +42,18 @@ int point_cmp(const Point* a, const Point* b) { int main() { - cmap_pnt pmap = c_make(cmap_pnt, {{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}}); + cmap_pnt pmap = c_init(cmap_pnt, {{{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}}); c_foreach (i, cmap_pnt, pmap) printf(" (%d, %d: %d)", i.ref->first.x, i.ref->first.y, i.ref->second); puts(""); - cmap_str smap = c_make(cmap_str, { + cmap_str smap = c_init(cmap_str, { {"Hello, friend", "long time no see"}, {"So long", "see you around"}, }); - cset_str sset = c_make(cset_str, { + cset_str sset = c_init(cset_str, { "Hello, friend", "Nice to see you again", "So long", diff --git a/misc/examples/new_pque.c b/misc/examples/new_pque.c index 5b26b3de..dc2ecf12 100644 --- a/misc/examples/new_pque.c +++ b/misc/examples/new_pque.c @@ -10,7 +10,7 @@ typedef struct Point { int x, y; } Point; int main() { - PointQ pque = c_make(PointQ, {{23, 80}, {12, 32}, {54, 74}, {12, 62}}); + PointQ pque = c_init(PointQ, {{23, 80}, {12, 32}, {54, 74}, {12, 62}}); // print for (; !PointQ_empty(&pque); PointQ_pop(&pque)) { diff --git a/misc/examples/new_smap.c b/misc/examples/new_smap.c index f930eba2..2eaae836 100644 --- a/misc/examples/new_smap.c +++ b/misc/examples/new_smap.c @@ -37,12 +37,12 @@ int point_cmp(const Point* a, const Point* b) { int main() { - PMap pmap = c_make(PMap, { + PMap pmap = c_init(PMap, { {{42, 14}, 1}, {{32, 94}, 2}, {{62, 81}, 3}, }); - SMap smap = c_make(SMap, { + SMap smap = c_init(SMap, { {"Hello, friend", "this is the mapped value"}, {"The brown fox", "jumped"}, {"This is the time", "for all good things"}, diff --git a/misc/examples/phonebook.c b/misc/examples/phonebook.c index c0007cb7..38a71089 100644 --- a/misc/examples/phonebook.c +++ b/misc/examples/phonebook.c @@ -38,7 +38,7 @@ void print_phone_book(cmap_str phone_book) int main(int argc, char **argv) { - cmap_str phone_book = c_make(cmap_str, { + cmap_str phone_book = c_init(cmap_str, { {"Lilia Friedman", "(892) 670-4739"}, {"Tariq Beltran", "(489) 600-7575"}, {"Laiba Juarez", "(303) 885-5692"}, diff --git a/misc/examples/printspan.c b/misc/examples/printspan.c index 60a2d934..b9ec2476 100644 --- a/misc/examples/printspan.c +++ b/misc/examples/printspan.c @@ -24,21 +24,21 @@ int main() intspan sp1 = cspan_make(intspan, {1, 2}); printMe( sp1 ); - printMe( c_make(intspan, {1, 2, 3}) ); + printMe( c_init(intspan, {1, 2, 3}) ); int arr[] = {1, 2, 3, 4, 5, 6}; intspan sp2 = cspan_from_array(arr); printMe( (intspan)cspan_subspan(&sp2, 1, 4) ); - cvec_int vec = c_make(cvec_int, {1, 2, 3, 4, 5}); + cvec_int vec = c_init(cvec_int, {1, 2, 3, 4, 5}); printMe( (intspan)cspan_from(&vec) ); printMe( sp2 ); - cstack_int stk = c_make(cstack_int, {1, 2, 3, 4, 5, 6, 7}); + cstack_int stk = c_init(cstack_int, {1, 2, 3, 4, 5, 6, 7}); printMe( (intspan)cspan_from(&stk) ); - csset_str set = c_make(csset_str, {"5", "7", "4", "3", "8", "2", "1", "9", "6"}); + csset_str set = c_init(csset_str, {"5", "7", "4", "3", "8", "2", "1", "9", "6"}); printf("%d:", (int)csset_str_size(&set)); c_foreach (e, csset_str, set) printf(" %s", cstr_str(e.ref)); diff --git a/misc/examples/scheduler.c b/misc/examples/scheduler.c index bad5201b..14c85f56 100644 --- a/misc/examples/scheduler.c +++ b/misc/examples/scheduler.c @@ -58,7 +58,7 @@ static bool taskB(struct Task* task) void Use(void) { - Scheduler scheduler = c_make(Scheduler, { + Scheduler scheduler = c_init(Scheduler, { {taskA, &scheduler}, {taskB, &scheduler}, }); |
