summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-15 18:50:49 +0100
committerTyge Løvset <[email protected]>2022-11-15 18:50:49 +0100
commit178f4f9048cc4b4db30d5ee694c3eb3158c34749 (patch)
tree9d3a67ce3f5b6d8029cc0b7484e89c4874298da4 /examples
parent688aa900792cf6629c2aa8c814dd590306ae05e0 (diff)
downloadSTC-modified-178f4f9048cc4b4db30d5ee694c3eb3158c34749.tar.gz
STC-modified-178f4f9048cc4b4db30d5ee694c3eb3158c34749.zip
More internal cleanup and fixes for cbox and carc.
Diffstat (limited to 'examples')
-rw-r--r--examples/arc_containers.c6
-rw-r--r--examples/box2.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/arc_containers.c b/examples/arc_containers.c
index 5a8b3653..b577f2c8 100644
--- a/examples/arc_containers.c
+++ b/examples/arc_containers.c
@@ -12,15 +12,17 @@
#define i_val Map
#define i_valdrop(p) (printf("drop Arc:\n"), Map_drop(p))
// no need for atomic ref. count in single thread:
-#define i_opt c_no_atomic
+#define i_opt c_no_atomic|c_no_lookup
#include <stc/carc.h>
#define i_type Stack
#define i_valboxed Arc // define i_valboxed for carc/cbox value (not i_val)
-#include <stc/cstack.h>
+#define i_opt c_no_cmp
+#include <stc/cvec.h>
#define i_type List
#define i_valboxed Arc // as above
+#define i_opt c_no_cmp
#include <stc/clist.h>
int main()
diff --git a/examples/box2.c b/examples/box2.c
index 03f7d8bd..b9628eeb 100644
--- a/examples/box2.c
+++ b/examples/box2.c
@@ -18,15 +18,18 @@ struct {
} typedef Rectangle;
#define i_val Point
+#define i_opt c_no_lookup
#include <stc/cbox.h> // cbox_Point
#define i_val Rectangle
+#define i_opt c_no_lookup
#include <stc/cbox.h> // cbox_Rectangle
// Box in box:
#define i_valboxed cbox_Point // NB: use i_valboxed when value is a cbox or carc!
// it will auto define i_valdrop, i_valfrom, and i_cmp.
#define i_tag BoxPoint
+#define i_opt c_no_lookup
#include <stc/cbox.h> // cbox_BoxPoint
Point origin(void) {