summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-22 20:52:18 +0200
committerTyge Løvset <[email protected]>2022-05-22 20:52:18 +0200
commit1c3e7b683469904d224f3f8f1ee0096f1c5b1b9d (patch)
tree826ca6560cd952996eb9793cb3356a9791753f2e /docs
parent314a41be6b39b6c5967d79555dbf018dbc7eb5f6 (diff)
downloadSTC-modified-1c3e7b683469904d224f3f8f1ee0096f1c5b1b9d.tar.gz
STC-modified-1c3e7b683469904d224f3f8f1ee0096f1c5b1b9d.zip
Changed c_apply(v, ..) macro to make it more consistent with c_apply_arr(v, ..) and c_foreach (i, ..): v changed to a pointer - not value.
Note: also c_pair(v) is changed correspondingly, so usage with c_apply(v) is unchanged.
Diffstat (limited to 'docs')
-rw-r--r--docs/cbox_api.md2
-rw-r--r--docs/cdeq_api.md2
-rw-r--r--docs/clist_api.md8
-rw-r--r--docs/cpque_api.md2
-rw-r--r--docs/cset_api.md4
-rw-r--r--docs/csset_api.md4
-rw-r--r--docs/cvec_api.md2
7 files changed, 12 insertions, 12 deletions
diff --git a/docs/cbox_api.md b/docs/cbox_api.md
index 59c44e02..8709548a 100644
--- a/docs/cbox_api.md
+++ b/docs/cbox_api.md
@@ -84,7 +84,7 @@ int main()
c_auto (IVec, vec) // declare and init vec, call drop at scope exit
c_auto (ISet, set) // similar
{
- c_apply(v, IVec_push(&vec, v), IBox, {
+ c_apply(v, IVec_push(&vec, *v), IBox, {
IBox_make(2021), IBox_make(2012),
IBox_make(2022), IBox_make(2015),
});
diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md
index 4a416d09..a1f1228f 100644
--- a/docs/cdeq_api.md
+++ b/docs/cdeq_api.md
@@ -110,7 +110,7 @@ int main() {
printf(" %d", *i.ref);
puts("");
- c_apply(v, cdeq_i_push_back(&q, v), int, {1, 4, 5, 22, 33, 2});
+ c_apply(v, cdeq_i_push_back(&q, *v), int, {1, 4, 5, 22, 33, 2});
c_foreach (i, cdeq_i, q)
printf(" %d", *i.ref);
puts("");
diff --git a/docs/clist_api.md b/docs/clist_api.md
index 5dd5d524..58970a19 100644
--- a/docs/clist_api.md
+++ b/docs/clist_api.md
@@ -109,7 +109,7 @@ Interleave *push_front()* / *push_back()* then *sort()*:
int main() {
clist_d list = clist_d_init();
- c_apply(v, clist_d_push_back(&list, v), double, {
+ c_apply(v, clist_d_push_back(&list, *v), double, {
10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0
});
@@ -150,7 +150,7 @@ Use of *erase_at()* and *erase_range()*:
int main ()
{
clist_i L = clist_i_init();
- c_apply(v, clist_i_push_back(&L, v), int, {10, 20, 30, 40, 50});
+ c_apply(v, clist_i_push_back(&L, *v), int, {10, 20, 30, 40, 50});
// 10 20 30 40 50
clist_i_iter it = clist_i_begin(&L); // ^
clist_i_next(&it);
@@ -185,8 +185,8 @@ Splice `[30, 40]` from *L2* into *L1* before `3`:
int main() {
c_auto (clist_i, L1, L2)
{
- c_apply(v, clist_i_push_back(&L1, v), int, {1, 2, 3, 4, 5});
- c_apply(v, clist_i_push_back(&L2, v), int, {10, 20, 30, 40, 50});
+ c_apply(v, clist_i_push_back(&L1, *v), int, {1, 2, 3, 4, 5});
+ c_apply(v, clist_i_push_back(&L2, *v), int, {10, 20, 30, 40, 50});
clist_i_iter i = clist_i_advance(clist_i_begin(&L1), 2);
clist_i_iter j1 = clist_i_advance(clist_i_begin(&L2), 2), j2 = clist_i_advance(j1, 2);
diff --git a/docs/cpque_api.md b/docs/cpque_api.md
index 1842c1b6..d9a381cc 100644
--- a/docs/cpque_api.md
+++ b/docs/cpque_api.md
@@ -78,7 +78,7 @@ int main()
// Push ten million random numbers to priority queue, plus some negative ones.
c_forrange (N)
cpque_i_push(&heap, stc64_uniform(&rng, &dist));
- c_apply(v, cpque_i_push(&heap, v), int, {-231, -32, -873, -4, -343});
+ c_apply(v, cpque_i_push(&heap, *v), int, {-231, -32, -873, -4, -343});
// Extract and display the fifty smallest.
c_forrange (50) {
diff --git a/docs/cset_api.md b/docs/cset_api.md
index 1e361799..2d20c303 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -86,9 +86,9 @@ int main ()
c_auto (cset_str, first, second)
c_auto (cset_str, third, fourth)
{
- c_apply(v, cset_str_emplace(&second, v), const char*,
+ c_apply(v, cset_str_emplace(&second, *v), const char*,
{"red", "green", "blue"});
- c_apply(v, cset_str_emplace(&third, v), const char*,
+ c_apply(v, cset_str_emplace(&third, *v), const char*,
{"orange", "pink", "yellow"});
cset_str_emplace(&fourth, "potatoes");
diff --git a/docs/csset_api.md b/docs/csset_api.md
index 1f252d13..a87bb6a2 100644
--- a/docs/csset_api.md
+++ b/docs/csset_api.md
@@ -85,9 +85,9 @@ c_auto (csset_str, fifth)
c_auto (csset_str, first, second)
c_auto (csset_str, third, fourth)
{
- c_apply(v, csset_str_emplace(&second, v), const char*,
+ c_apply(v, csset_str_emplace(&second, *v), const char*,
{"red", "green", "blue"});
- c_apply(v, csset_str_emplace(&third, v), const char*,
+ c_apply(v, csset_str_emplace(&third, *v), const char*,
{"orange", "pink", "yellow"});
csset_str_emplace(&fourth, "potatoes");
diff --git a/docs/cvec_api.md b/docs/cvec_api.md
index 3e12e5e2..2ea52e56 100644
--- a/docs/cvec_api.md
+++ b/docs/cvec_api.md
@@ -123,7 +123,7 @@ int main()
cvec_int_push(&vec, 13);
// Append a set of numbers
- c_apply(v, cvec_int_push(&vec, v), int, {7, 5, 16, 8});
+ c_apply(v, cvec_int_push(&vec, *v), int, {7, 5, 16, 8});
printf("initial:");
c_foreach (k, cvec_int, vec) {