summaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-18 17:31:06 +0100
committerTyge Løvset <[email protected]>2023-01-18 18:03:25 +0100
commit5503f7a513a21f833bdba1d70973deaafb2f7a96 (patch)
tree9f17c350650ec81d8598fe68752c25cbf5115621 /misc
parent90aab650b31febadcea45cfa60d0620b4d807ee9 (diff)
downloadSTC-modified-5503f7a513a21f833bdba1d70973deaafb2f7a96.tar.gz
STC-modified-5503f7a513a21f833bdba1d70973deaafb2f7a96.zip
Improved error messages.
Diffstat (limited to 'misc')
-rw-r--r--misc/examples/arc_containers.c2
-rw-r--r--misc/examples/arc_demo.c1
-rw-r--r--misc/examples/arcvec_erase.c2
-rw-r--r--misc/examples/new_sptr.c1
-rw-r--r--misc/examples/shape.c1
5 files changed, 5 insertions, 2 deletions
diff --git a/misc/examples/arc_containers.c b/misc/examples/arc_containers.c
index 026f9eb5..bfe15150 100644
--- a/misc/examples/arc_containers.c
+++ b/misc/examples/arc_containers.c
@@ -12,7 +12,7 @@
#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|c_no_lookup
+#define i_opt c_no_atomic|c_no_lookup|c_no_clone
#include <stc/carc.h>
#define i_type Stack
diff --git a/misc/examples/arc_demo.c b/misc/examples/arc_demo.c
index f1cf3fda..564ebd6d 100644
--- a/misc/examples/arc_demo.c
+++ b/misc/examples/arc_demo.c
@@ -11,6 +11,7 @@ void int_drop(int* x) {
#define i_type Arc // set type name to be defined (instead of 'carc_int')
#define i_val int
#define i_valdrop int_drop // optional, just to display the elements destroyed
+#define i_no_clone // required because of valdrop
#include <stc/carc.h> // Arc
#define i_keyboxed Arc // note: use i_keyboxed instead of i_key for carc/cbox elements
diff --git a/misc/examples/arcvec_erase.c b/misc/examples/arcvec_erase.c
index eb54084a..8385ed65 100644
--- a/misc/examples/arcvec_erase.c
+++ b/misc/examples/arcvec_erase.c
@@ -5,7 +5,7 @@ void show_drop(int* x) { printf("drop: %d\n", *x); }
#define i_type Arc
#define i_val int
#define i_valdrop show_drop
-#define i_cmp c_default_cmp // enable object comparisons (default ptr compare)
+#define i_no_clone // required because of valdrop
#include <stc/carc.h> // Shared pointer to int
#define i_type Vec
diff --git a/misc/examples/new_sptr.c b/misc/examples/new_sptr.c
index 90ce30b2..5441ae01 100644
--- a/misc/examples/new_sptr.c
+++ b/misc/examples/new_sptr.c
@@ -16,6 +16,7 @@ uint64_t Person_hash(const Person* p);
#define i_type IPtr
#define i_val int
#define i_valdrop(x) printf("drop: %d\n", *x)
+#define i_no_clone
#include <stc/carc.h>
#define i_type IPStack
diff --git a/misc/examples/shape.c b/misc/examples/shape.c
index 4f7903da..ed0c3fe1 100644
--- a/misc/examples/shape.c
+++ b/misc/examples/shape.c
@@ -127,6 +127,7 @@ static struct ShapeAPI Polygon_api = {
#define i_type Shapes
#define i_val Shape*
#define i_valdrop(x) Shape_delete(*x)
+#define i_no_clone
#include <stc/cstack.h>
void testShape(const Shape* shape)