diff options
| author | Tyge Løvset <[email protected]> | 2020-11-03 08:38:26 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-11-03 08:38:26 +0100 |
| commit | cc8fd2c9d8b5b8170a02ec33168d60bb92cd781d (patch) | |
| tree | cf7a840ddb4b3a557302eb114831a38025ef44cb /examples | |
| parent | 7171182ce7e0106f8f0fc47ed8f1fe1f58b2ea5d (diff) | |
| download | STC-modified-cc8fd2c9d8b5b8170a02ec33168d60bb92cd781d.tar.gz STC-modified-cc8fd2c9d8b5b8170a02ec33168d60bb92cd781d.zip | |
renamed __init to _inits
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/benchmark.c | 2 | ||||
| -rw-r--r-- | examples/complex.c | 6 | ||||
| -rw-r--r-- | examples/demos.c | 14 | ||||
| -rw-r--r-- | examples/inits.c | 10 | ||||
| -rw-r--r-- | examples/list.c | 2 | ||||
| -rw-r--r-- | examples/mapmap.c | 4 | ||||
| -rw-r--r-- | examples/phonebook.c | 2 | ||||
| -rw-r--r-- | examples/words.c | 6 |
8 files changed, 23 insertions, 23 deletions
diff --git a/examples/benchmark.c b/examples/benchmark.c index 419e7a8f..ab500429 100644 --- a/examples/benchmark.c +++ b/examples/benchmark.c @@ -33,7 +33,7 @@ crand_rng64_t rng; #define RAND(N) (crand_i64(&rng) & ((1 << N) - 1))
-#define CMAP_SETUP(X, Key, Value) cmap_##X map = cmap__init \
+#define CMAP_SETUP(X, Key, Value) cmap_##X map = cmap_inits \
; cmap_##X##_set_load_factors(&map, max_load_factor, 0.0)
#define CMAP_PUT(X, key, val) cmap_##X##_put(&map, key, val).first->second
#define CMAP_EMPLACE(X, key, val) cmap_##X##_emplace(&map, key, val)
diff --git a/examples/complex.c b/examples/complex.c index ff97c141..9f12b424 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -14,14 +14,14 @@ int main() { int xdim = 4, ydim = 6;
int x = 1, y = 5, tableKey = 42;
const char* strKey = "first";
- cmap_s myMap = cmap__init;
+ cmap_s myMap = cmap_inits;
{ // Construct.
carray2f table = carray2f_init(ydim, xdim, 0.f);
c_print(1, "table: ({}, {})\n", carray2_ydim(table), carray2_xdim(table));
- clist_y tableList = clist__init;
+ clist_y tableList = clist_inits;
// Put in some data.
- cmap_g listMap = cmap__init;
+ cmap_g listMap = cmap_inits;
*carray2f_at(&table, y, x) = 3.1415927f; // table[y][x]
clist_y_push_back(&tableList, table);
diff --git a/examples/demos.c b/examples/demos.c index 580942f1..4c7e6a01 100644 --- a/examples/demos.c +++ b/examples/demos.c @@ -39,7 +39,7 @@ using_cvec(ix, int64_t); // ix is just an example tag name. void vectordemo1()
{
c_print(1, "\nVECTORDEMO1\n");
- cvec_ix bignums = cvec__init; // = (cvec_ix) cvec__init; if initializing after declaration.
+ cvec_ix bignums = cvec_inits; // = (cvec_ix) cvec_inits; if initializing after declaration.
cvec_ix_reserve(&bignums, 100);
c_forrange (i, 101)
cvec_ix_push_back(&bignums, i * i * i);
@@ -60,7 +60,7 @@ using_cvec_str(); void vectordemo2()
{
c_print(1, "\nVECTORDEMO2\n");
- cvec_str names = cvec__init;
+ cvec_str names = cvec_inits;
cvec_str_emplace_back(&names, "Mary");
cvec_str_emplace_back(&names, "Joe");
cvec_str_emplace_back(&names, "Chris");
@@ -78,7 +78,7 @@ using_clist(ix, int); void listdemo1()
{
c_print(1, "\nLISTDEMO1\n");
- clist_ix nums = clist__init, nums2 = clist__init;
+ clist_ix nums = clist_inits, nums2 = clist_inits;
c_forrange (i, 10)
clist_ix_push_back(&nums, i);
c_forrange (i, int, 100, 110)
@@ -105,7 +105,7 @@ using_cset(i, int); void setdemo1()
{
c_print(1, "\nSETDEMO1\n");
- cset_i nums = cset__init;
+ cset_i nums = cset_inits;
cset_i_insert(&nums, 8);
cset_i_insert(&nums, 11);
@@ -120,7 +120,7 @@ using_cmap(ii, int, int); void mapdemo1()
{
c_print(1, "\nMAPDEMO1\n");
- cmap_ii nums = cmap__init;
+ cmap_ii nums = cmap_inits;
cmap_ii_put(&nums, 8, 64);
cmap_ii_put(&nums, 11, 121);
c_print(1, "val 8: {}\n", *cmap_ii_at(&nums, 8));
@@ -133,7 +133,7 @@ using_cmap_strkey(si, int); // Shorthand macro for the general using_cmap expans void mapdemo2()
{
c_print(1, "\nMAPDEMO2\n");
- cmap_si nums = cmap__init;
+ cmap_si nums = cmap_inits;
cmap_si_put(&nums, "Hello", 64);
cmap_si_put(&nums, "Groovy", 121);
cmap_si_put(&nums, "Groovy", 200); // overwrite previous
@@ -155,7 +155,7 @@ using_cmap_str(); void mapdemo3()
{
c_print(1, "\nMAPDEMO3\n");
- cmap_str table = cmap__init;
+ cmap_str table = cmap_inits;
cmap_str_put(&table, "Map", "test");
cmap_str_put(&table, "Make", "my");
cmap_str_put(&table, "Sunny", "day");
diff --git a/examples/inits.c b/examples/inits.c index 42be17fb..eb480ee6 100644 --- a/examples/inits.c +++ b/examples/inits.c @@ -23,7 +23,7 @@ int main(void) {
// CVEC FLOAT / PRIORITY QUEUE
- cvec_f floats = cvec__init;
+ cvec_f floats = cvec_inits;
c_push_items(&floats, cvec_f, {4.0f, 2.0f, 5.0f, 3.0f, 1.0f});
c_foreach (i, cvec_f, floats) c_print(1, "{:.1f} ", *i.val);
@@ -45,7 +45,7 @@ int main(void) // CMAP ID
int year = 2020;
- cmap_id idnames = cmap__init;
+ cmap_id idnames = cmap_inits;
c_push_items(&idnames, cmap_id, {
{100, cstr_from("Hello")},
{110, cstr_from("World")},
@@ -59,7 +59,7 @@ int main(void) // CMAP CNT
- cmap_cnt countries = cmap__init;
+ cmap_cnt countries = cmap_inits;
c_push_items(&countries, cmap_cnt, {
{"Norway", 100},
{"Denmark", 50},
@@ -82,7 +82,7 @@ int main(void) // CVEC PAIR
- cvec_ip pairs1 = cvec__init;
+ cvec_ip pairs1 = cvec_inits;
c_push_items(&pairs1, cvec_ip, {
{5, 6}, {3, 4}, {1, 2}, {7, 8},
});
@@ -95,7 +95,7 @@ int main(void) // CLIST PAIR
- clist_ip pairs2 = clist__init;
+ clist_ip pairs2 = clist_inits;
c_push_items(&pairs2, clist_ip, {
{5, 6}, {3, 4}, {1, 2}, {7, 8},
});
diff --git a/examples/list.c b/examples/list.c index bdac3ef0..81865020 100644 --- a/examples/list.c +++ b/examples/list.c @@ -9,7 +9,7 @@ int main() { int k;
const int n = 2000000;
- clist_fx list = clist__init;
+ clist_fx list = clist_inits;
crand_rng64_t eng = crand_rng64_init(1234);
crand_uniform_f64_t dist = crand_uniform_f64_init(100.0f, n);
int m = 0;
diff --git a/examples/mapmap.c b/examples/mapmap.c index 0e4b6991..9e637dde 100644 --- a/examples/mapmap.c +++ b/examples/mapmap.c @@ -7,8 +7,8 @@ using_cmap_str(); using_cmap_strkey(cfg, cmap_str, cmap_str_del);
int main(void) {
- cmap_cfg config = cmap__init;
- cmap_str init = cmap__init;
+ cmap_cfg config = cmap_inits;
+ cmap_str init = cmap_inits;
cmap_str_put(&cmap_cfg_emplace(&config, "user", init).first->second, "name", "Joe");
cmap_str_put(&cmap_cfg_emplace(&config, "user", init).first->second, "groups", "proj1,proj3");
cmap_str_put(&cmap_cfg_emplace(&config, "group", init).first->second, "proj1", "Energy");
diff --git a/examples/phonebook.c b/examples/phonebook.c index a1249ae5..b929de4e 100644 --- a/examples/phonebook.c +++ b/examples/phonebook.c @@ -36,7 +36,7 @@ void print_phone_book(cmap_str phone_book) int main(int argc, char **argv)
{
bool erased;
- cmap_str phone_book = cmap__init;
+ cmap_str phone_book = cmap_inits;
c_push_items(&phone_book, cmap_str, {
{"Lilia Friedman", "(892) 670-4739"},
{"Tariq Beltran", "(489) 600-7575"},
diff --git a/examples/words.c b/examples/words.c index 3ee285e8..cde1ffa0 100644 --- a/examples/words.c +++ b/examples/words.c @@ -11,7 +11,7 @@ using_cmap_strkey(si, int); int main1() { - clist_str lwords = clist__init; + clist_str lwords = clist_inits; c_push_items(&lwords, clist_str, { "this", "sentence", "is", "not", "a", "sentence", "this", "sentence", "is", "a", "hoax" @@ -21,13 +21,13 @@ int main1() c_print(1, "{}\n", w.val->str); puts(""); - cvec_str words = cvec__init; + cvec_str words = cvec_inits; c_push_items(&words, cvec_str, { "this", "sentence", "is", "not", "a", "sentence", "this", "sentence", "is", "a", "hoax" }); - cmap_si word_map = cmap__init; + cmap_si word_map = cmap_inits; c_foreach (w, cvec_str, words) cmap_si_emplace(&word_map, w.val->str, 0).first->second += 1; |
