summaryrefslogtreecommitdiffhomepage
path: root/examples/new_smap.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/new_smap.c')
-rw-r--r--examples/new_smap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/new_smap.c b/examples/new_smap.c
index 7f0730db..2cb35b99 100644
--- a/examples/new_smap.c
+++ b/examples/new_smap.c
@@ -15,14 +15,14 @@ struct MyStruct {
// Point => int map
struct Point { int x, y; } typedef Point;
-int point_compare(const Point* a, const Point* b) {
- int c = c_default_compare(&a->x, &b->x);
- return c ? c : c_default_compare(&a->y, &b->y);
+int point_cmp(const Point* a, const Point* b) {
+ int c = a->x - b->x;
+ return c ? c : a->y - b->y;
}
#define i_key Point
#define i_val int
-#define i_cmp point_compare
+#define i_cmp point_cmp
#define i_opt c_is_fwd
#define i_tag pnt
#include <stc/csmap.h>