Fri, 21 Apr 2023 20:50:19 +0200
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 |
1.1 --- a/src/cx/map.h Fri Apr 21 20:28:55 2023 +0200 1.2 +++ b/src/cx/map.h Fri Apr 21 20:50:19 2023 +0200 1.3 @@ -810,7 +810,8 @@ 1.4 CxHashKey: cx_map_put, \ 1.5 cxstring: cx_map_put_cxstr, \ 1.6 cxmutstr: cx_map_put_mustr, \ 1.7 - char*: cx_map_put_str) \ 1.8 + char*: cx_map_put_str, \ 1.9 + char const*: cx_map_put_str) \ 1.10 (map, key, value) 1.11 1.12 /** 1.13 @@ -884,7 +885,8 @@ 1.14 CxHashKey: cx_map_get, \ 1.15 cxstring: cx_map_get_cxstr, \ 1.16 cxmutstr: cx_map_get_mustr, \ 1.17 - char*: cx_map_get_str) \ 1.18 + char*: cx_map_get_str, \ 1.19 + char const*: cx_map_get_str) \ 1.20 (map, key) 1.21 1.22 /** 1.23 @@ -961,7 +963,8 @@ 1.24 CxHashKey: cx_map_remove, \ 1.25 cxstring: cx_map_remove_cxstr, \ 1.26 cxmutstr: cx_map_remove_mustr, \ 1.27 - char*: cx_map_remove_str) \ 1.28 + char*: cx_map_remove_str, \ 1.29 + char const*: cx_map_remove_str) \ 1.30 (map, key) 1.31 1.32 /** 1.33 @@ -1042,7 +1045,8 @@ 1.34 CxHashKey: cx_map_detach, \ 1.35 cxstring: cx_map_detach_cxstr, \ 1.36 cxmutstr: cx_map_detach_mustr, \ 1.37 - char*: cx_map_detach_str) \ 1.38 + char*: cx_map_detach_str, \ 1.39 + char const*: cx_map_detach_str) \ 1.40 (map, key) 1.41 1.42 /** 1.43 @@ -1132,7 +1136,8 @@ 1.44 CxHashKey: cx_map_remove_and_get, \ 1.45 cxstring: cx_map_remove_and_get_cxstr, \ 1.46 cxmutstr: cx_map_remove_and_get_mustr, \ 1.47 - char*: cx_map_remove_and_get_str) \ 1.48 + char*: cx_map_remove_and_get_str, \ 1.49 + char const*: cx_map_remove_and_get_str) \ 1.50 (map, key) 1.51 1.52 #endif // __cplusplus
2.1 --- a/tests/test_map_generics.c Fri Apr 21 20:28:55 2023 +0200 2.2 +++ b/tests/test_map_generics.c Fri Apr 21 20:50:19 2023 +0200 2.3 @@ -42,7 +42,8 @@ 2.4 void test_map_generics_step_2(CxMap *map) { 2.5 // note: we don't have a destructor here, so remove and detach are the same 2.6 cxMapRemove(map, cx_str("test")); 2.7 - cxMapDetach(map, "hallo"); 2.8 + char const* hallo = "hallo"; 2.9 + cxMapDetach(map, hallo); 2.10 cxMapPut(map, cx_hash_key_str("key"), "value"); 2.11 } 2.12