summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-02-22 14:23:00 +0100
committerTyge Løvset <[email protected]>2021-02-22 14:23:00 +0100
commit23ec0fe83e8efbc3a758af4049ce990ee67ea47c (patch)
tree4fd323c7a4862cd69532901661710cefd4c138cc /examples
parent48a3e856a233326308621c6665c74291744a90e2 (diff)
downloadSTC-modified-23ec0fe83e8efbc3a758af4049ce990ee67ea47c.tar.gz
STC-modified-23ec0fe83e8efbc3a758af4049ce990ee67ea47c.zip
Many internal renames. Reverted to specify both _del and _clone parameter when giving _del.
Diffstat (limited to 'examples')
-rw-r--r--examples/complex.c8
-rw-r--r--examples/csmap_v1.h20
-rw-r--r--examples/inits.c2
-rw-r--r--examples/mapmap.c2
4 files changed, 16 insertions, 16 deletions
diff --git a/examples/complex.c b/examples/complex.c
index 05d74557..161d0b31 100644
--- a/examples/complex.c
+++ b/examples/complex.c
@@ -5,10 +5,10 @@
void check_del(float* v) {printf("destroy %g\n", *v);}
-using_carray(f, float, check_del);
-using_clist(a, carray2f, c_no_compare, carray2f_del);
-using_cmap(l, int, clist_a, c_default_equals, c_default_hash, clist_a_del);
-using_cmap_strkey(s, cmap_l, cmap_l_del);
+using_carray(f, float, check_del, c_plain_fromraw);
+using_clist(a, carray2f, c_no_compare, carray2f_del, c_no_clone);
+using_cmap(l, int, clist_a, c_default_equals, c_default_hash, clist_a_del, c_no_clone);
+using_cmap_strkey(s, cmap_l, cmap_l_del, c_no_clone);
int main() {
int xdim = 4, ydim = 6;
diff --git a/examples/csmap_v1.h b/examples/csmap_v1.h
index 11602f83..78e40431 100644
--- a/examples/csmap_v1.h
+++ b/examples/csmap_v1.h
@@ -50,19 +50,19 @@ int main(void) {
using_csmap_4(X, Key, Mapped, c_default_compare)
#define using_csmap_4(X, Key, Mapped, keyCompare) \
- using_csmap_6(X, Key, Mapped, keyCompare, c_default_del, c_default_fromraw)
+ using_csmap_6(X, Key, Mapped, keyCompare, c_plain_del, c_plain_fromraw)
#define using_csmap_6(X, Key, Mapped, keyCompare, mappedDel, mappedClone) \
- using_csmap_8(X, Key, Mapped, keyCompare, mappedDel, mappedClone, c_default_del, c_default_fromraw)
+ using_csmap_8(X, Key, Mapped, keyCompare, mappedDel, mappedClone, c_plain_del, c_plain_fromraw)
#define using_csmap_8(X, Key, Mapped, keyCompare, mappedDel, mappedClone, keyDel, keyClone) \
using_csmap_10(X, Key, Mapped, keyCompare, mappedDel, mappedClone, \
- keyDel, keyClone, c_default_toraw, Key)
+ keyDel, keyClone, c_plain_toraw, Key)
#define using_csmap_10(X, Key, Mapped, keyCompareRaw, mappedDel, mappedClone, \
keyDel, keyFromRaw, keyToRaw, RawKey) \
_using_CBST(X, csmap, Key, Mapped, keyCompareRaw, mappedDel, keyDel, \
- keyFromRaw, keyToRaw, RawKey, mappedClone, c_default_toraw, Mapped)
+ keyFromRaw, keyToRaw, RawKey, mappedClone, c_plain_toraw, Mapped)
/* csset: */
#define using_csset(...) \
@@ -72,10 +72,10 @@ int main(void) {
using_csset_3(X, Key, c_default_compare)
#define using_csset_3(X, Key, keyCompare) \
- using_csset_5(X, Key, keyCompare, c_default_del, c_default_fromraw)
+ using_csset_5(X, Key, keyCompare, c_plain_del, c_plain_fromraw)
#define using_csset_5(X, Key, keyCompare, keyDel, keyClone) \
- using_csset_7(X, Key, keyCompare, keyDel, keyClone, c_default_toraw, Key)
+ using_csset_7(X, Key, keyCompare, keyDel, keyClone, c_plain_toraw, Key)
#define using_csset_7(X, Key, keyCompareRaw, keyDel, keyFromRaw, keyToRaw, RawKey) \
_using_CBST(X, csset, Key, Key, keyCompareRaw, _UNUSED_, keyDel, \
@@ -92,14 +92,14 @@ int main(void) {
c_MACRO_OVERLOAD(using_csmap_strkey, __VA_ARGS__)
#define using_csmap_strkey_2(X, Mapped) \
- _using_CBST_strkey(X, csmap, Mapped, c_default_del, c_default_fromraw)
+ _using_CBST_strkey(X, csmap, Mapped, c_plain_del, c_plain_fromraw)
#define using_csmap_strkey_4(X, Mapped, mappedDel, mappedClone) \
_using_CBST_strkey(X, csmap, Mapped, mappedDel, mappedClone)
#define _using_CBST_strkey(X, C, Mapped, mappedDel, mappedClone) \
_using_CBST(X, C, cstr_t, Mapped, cstr_compare_raw, mappedDel, cstr_del, \
- cstr_from, cstr_c_str, const char*, mappedClone, c_default_toraw, Mapped)
+ cstr_from, cstr_c_str, const char*, mappedClone, c_plain_toraw, Mapped)
#define using_csmap_strval(...) \
c_MACRO_OVERLOAD(using_csmap_strval, __VA_ARGS__)
@@ -108,10 +108,10 @@ int main(void) {
using_csmap_strval_3(X, Key, c_default_compare)
#define using_csmap_strval_3(X, Key, keyCompare) \
- using_csmap_strval_5(X, Key, keyCompare, c_default_del, c_default_fromraw)
+ using_csmap_strval_5(X, Key, keyCompare, c_plain_del, c_plain_fromraw)
#define using_csmap_strval_5(X, Key, keyCompare, keyDel, keyClone) \
- using_csmap_strval_7(X, Key, keyCompare, keyDel, keyClone, c_default_toraw, Key)
+ using_csmap_strval_7(X, Key, keyCompare, keyDel, keyClone, c_plain_toraw, Key)
#define using_csmap_strval_7(X, Key, keyCompare, keyDel, keyFromRaw, keyToRaw, RawKey) \
_using_CBST(X, csmap, Key, cstr_t, keyCompare, cstr_del, keyDel, \
diff --git a/examples/inits.c b/examples/inits.c
index bf209e88..edcb4336 100644
--- a/examples/inits.c
+++ b/examples/inits.c
@@ -5,7 +5,7 @@
#include <stc/cpque.h>
#include <stc/clist.h>
-using_cmap(id, int, cstr, c_default_equals, c_default_hash, cstr_del); // Map of int -> cstr
+using_cmap(id, int, cstr, c_default_equals, c_default_hash, cstr_del, c_no_clone); // Map of int -> cstr
using_cmap_strkey(cnt, int);
typedef struct {int x, y;} ipair_t;
diff --git a/examples/mapmap.c b/examples/mapmap.c
index 5a5996f6..c775d870 100644
--- a/examples/mapmap.c
+++ b/examples/mapmap.c
@@ -4,7 +4,7 @@
#include <stc/cstr.h>
using_cmap_str();
-using_cmap_strkey(cfg, cmap_str, cmap_str_del);
+using_cmap_strkey(cfg, cmap_str, cmap_str_del, c_no_clone);
int main(void) {
cmap_cfg config = cmap_cfg_init();