# HG changeset patch # User Mike Becker # Date 1682103019 -7200 # Node ID ac827d873c17a77fcc9a0551e4772e70a560dd30 # Parent 494d9b20b99e77bc0560d13080d9f1a76eadcc24 fix missing controlling-expression for char const* diff -r 494d9b20b99e -r ac827d873c17 src/cx/map.h --- 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 diff -r 494d9b20b99e -r ac827d873c17 tests/test_map_generics.c --- 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"); }