summaryrefslogtreecommitdiffhomepage
path: root/include/stc/alt
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-11-21 23:17:24 +0100
committerTyge Løvset <[email protected]>2021-11-21 23:17:24 +0100
commitee09c3627dee4eb2ec87fda9783be1bb15e132d9 (patch)
treeecc646a430e75f618e00c2a95ce2372e1021ba5d /include/stc/alt
parent879f7a1c5637a5f67d430d3583fc7ba34b687234 (diff)
downloadSTC-modified-ee09c3627dee4eb2ec87fda9783be1bb15e132d9.tar.gz
STC-modified-ee09c3627dee4eb2ec87fda9783be1bb15e132d9.zip
BREAKING CHANGE: Replaced c_new(T) with c_new(T, ...). This now is similar to the c++ new operator. The previous c_new(T) is renamed to c_alloc(T), and c_new_n(T,n) => c_alloc_n(T,n). Old usage of c_new() will fail as it requires additional argument. Sorry for the inconvenience.
Diffstat (limited to 'include/stc/alt')
-rw-r--r--include/stc/alt/clist.h2
-rw-r--r--include/stc/alt/csmap.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/alt/clist.h b/include/stc/alt/clist.h
index ea1bb9a5..6695a26e 100644
--- a/include/stc/alt/clist.h
+++ b/include/stc/alt/clist.h
@@ -294,7 +294,7 @@ STC_API size_t _clist_count(const clist_VOID* self);
#define _c_clist_insert_after(self, _cx_self, node, val) \
- _cx_node *entry = c_new (_cx_node); \
+ _cx_node *entry = c_alloc (_cx_node); \
if (node) entry->next = node->next, node->next = entry; \
else entry->next = entry; \
entry->value = val
diff --git a/include/stc/alt/csmap.h b/include/stc/alt/csmap.h
index 699e18c1..0e1650ee 100644
--- a/include/stc/alt/csmap.h
+++ b/include/stc/alt/csmap.h
@@ -299,7 +299,7 @@ static csmap_SENTINEL_node _aatree_sentinel = {&_aatree_sentinel, &_aatree_senti
if (!(c = i_cmp(&r, rkey))) {res->ref = &tx->value; return tn; } \
tx = tx->link[(dir = (c < 0))]; \
} \
- tn = c_new(_cx_node); \
+ tn = c_alloc(_cx_node); \
res->ref = &tn->value, res->inserted = true; \
tn->link[0] = tn->link[1] = (_cx_node*) &_aatree_sentinel, tn->level = 1; \
if (top == 0) return tn; \
@@ -382,7 +382,7 @@ static csmap_SENTINEL_node _aatree_sentinel = {&_aatree_sentinel, &_aatree_senti
STC_DEF _cx_node* \
_cx_memb(_clone_r_)(_cx_node *tn) { \
if (! tn->level) return tn; \
- _cx_node *cn = c_new(_cx_node); \
+ _cx_node *cn = c_alloc(_cx_node); \
cn->link[0] = _cx_memb(_clone_r_)(tn->link[0]); \
cn->link[1] = _cx_memb(_clone_r_)(tn->link[1]); \
cn->level = tn->level; \