diff options
Diffstat (limited to 'misc/archived/csmap.h')
| -rw-r--r-- | misc/archived/csmap.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/archived/csmap.h b/misc/archived/csmap.h index 4b4e764c..f035ff11 100644 --- a/misc/archived/csmap.h +++ b/misc/archived/csmap.h @@ -32,7 +32,7 @@ #include <stc/csmap.h> int main(void) { - c_with (csmap_sx m = csmap_sx_init(), csmap_sx_drop(&m)) + c_WITH (csmap_sx m = csmap_sx_init(), csmap_sx_drop(&m)) { csmap_sx_emplace(&m, "Testing one", 1.234); csmap_sx_emplace(&m, "Testing two", 12.34); @@ -43,7 +43,7 @@ int main(void) { csmap_sx_emplace_or_assign(&m, "Testing three", 1000.0); // update csmap_sx_erase(&m, "Testing two"); - c_foreach (i, csmap_sx, m) + c_FOREACH (i, csmap_sx, m) printf("map %s: %g\n", cstr_str(&i.ref->first), i.ref->second); } } @@ -113,7 +113,7 @@ STC_API void _cx_memb(_next)(_cx_iter* it); STC_INLINE bool _cx_memb(_empty)(_cx_self cx) { return cx.size == 0; } STC_INLINE size_t _cx_memb(_size)(_cx_self cx) { return cx.size; } -STC_INLINE void _cx_memb(_swap)(_cx_self* a, _cx_self* b) { c_swap(_cx_self, *a, *b); } +STC_INLINE void _cx_memb(_swap)(_cx_self* a, _cx_self* b) { c_SWAP(_cx_self, *a, *b); } STC_INLINE _cx_iter _cx_memb(_find)(const _cx_self* self, i_keyraw rkey) { _cx_iter it; _cx_memb(_find_it)(self, rkey, &it); return it; } STC_INLINE bool _cx_memb(_contains)(const _cx_self* self, i_keyraw rkey) @@ -354,7 +354,7 @@ _cx_memb(_insert_entry_i_)(_cx_node* tn, const _cx_rawkey* rkey, _cx_result* res dir = (c < 0); tx = tx->link[dir]; } - tn = c_alloc(_cx_node); + tn = c_ALLOC(_cx_node); tn->link[0] = tn->link[1] = (_cx_node*)&_csmap_sentinel; tn->level = 1; res->ref = &tn->value, res->inserted = true; @@ -401,7 +401,7 @@ _cx_memb(_erase_r_)(_cx_node *tn, const _cx_rawkey* rkey, int *erased) { } else { /* unlink node */ tx = tn; tn = tn->link[tn->link[0]->level == 0]; - c_free(tx); + c_FREE(tx); } } if (tn->link[0]->level < tn->level - 1 || tn->link[1]->level < tn->level - 1) { @@ -461,7 +461,7 @@ static _cx_node* _cx_memb(_clone_r_)(_cx_node *tn) { if (! tn->level) return tn; - _cx_node *cn = c_alloc(_cx_node); + _cx_node *cn = c_ALLOC(_cx_node); cn->level = tn->level; cn->value = _cx_memb(_value_clone)(tn->value); cn->link[0] = _cx_memb(_clone_r_)(tn->link[0]); @@ -493,7 +493,7 @@ _cx_memb(_drop_r_)(_cx_node* tn) { _cx_memb(_drop_r_)(tn->link[0]); _cx_memb(_drop_r_)(tn->link[1]); _cx_memb(_value_drop)(&tn->value); - c_free(tn); + c_FREE(tn); } } |
