fix missing controlling-expression for char const*

Fri, 21 Apr 2023 20:50:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 21 Apr 2023 20:50:19 +0200
changeset 694
ac827d873c17
parent 693
494d9b20b99e
child 695
eb1884a8b096

fix missing controlling-expression for char const*

src/cx/map.h file | annotate | diff | comparison | revisions
tests/test_map_generics.c file | annotate | diff | comparison | revisions
--- a/src/cx/map.h	Fri Apr 21 20:28:55 2023 +0200
+++ b/src/cx/map.h	Fri Apr 21 20:50:19 2023 +0200
@@ -810,7 +810,8 @@
     CxHashKey: cx_map_put,                        \
     cxstring: cx_map_put_cxstr,                   \
     cxmutstr: cx_map_put_mustr,                   \
-    char*: cx_map_put_str)                        \
+    char*: cx_map_put_str,                        \
+    char const*: cx_map_put_str)                  \
     (map, key, value)
 
 /**
@@ -884,7 +885,8 @@
     CxHashKey: cx_map_get,                 \
     cxstring: cx_map_get_cxstr,            \
     cxmutstr: cx_map_get_mustr,            \
-    char*: cx_map_get_str)                 \
+    char*: cx_map_get_str,                 \
+    char const*: cx_map_get_str)           \
     (map, key)
 
 /**
@@ -961,7 +963,8 @@
     CxHashKey: cx_map_remove,                 \
     cxstring: cx_map_remove_cxstr,            \
     cxmutstr: cx_map_remove_mustr,            \
-    char*: cx_map_remove_str)                 \
+    char*: cx_map_remove_str,                 \
+    char const*: cx_map_remove_str)           \
     (map, key)
 
 /**
@@ -1042,7 +1045,8 @@
     CxHashKey: cx_map_detach,                 \
     cxstring: cx_map_detach_cxstr,            \
     cxmutstr: cx_map_detach_mustr,            \
-    char*: cx_map_detach_str)                 \
+    char*: cx_map_detach_str,                 \
+    char const*: cx_map_detach_str)           \
     (map, key)
 
 /**
@@ -1132,7 +1136,8 @@
     CxHashKey: cx_map_remove_and_get,               \
     cxstring: cx_map_remove_and_get_cxstr,          \
     cxmutstr: cx_map_remove_and_get_mustr,          \
-    char*: cx_map_remove_and_get_str)               \
+    char*: cx_map_remove_and_get_str,               \
+    char const*: cx_map_remove_and_get_str)         \
     (map, key)
 
 #endif // __cplusplus
--- a/tests/test_map_generics.c	Fri Apr 21 20:28:55 2023 +0200
+++ b/tests/test_map_generics.c	Fri Apr 21 20:50:19 2023 +0200
@@ -42,7 +42,8 @@
 void test_map_generics_step_2(CxMap *map) {
     // note: we don't have a destructor here, so remove and detach are the same
     cxMapRemove(map, cx_str("test"));
-    cxMapDetach(map, "hallo");
+    char const* hallo = "hallo";
+    cxMapDetach(map, hallo);
     cxMapPut(map, cx_hash_key_str("key"), "value");
 }
 

mercurial