src/cx/map.h

changeset 890
54565fd74e74
parent 857
4d12e34bb130
--- a/src/cx/map.h	Wed Sep 18 00:02:18 2024 +0200
+++ b/src/cx/map.h	Sat Sep 28 15:47:28 2024 +0200
@@ -113,7 +113,7 @@
      */
     __attribute__((__nonnull__, __warn_unused_result__))
     void *(*get)(
-            CxMap const *map,
+            const CxMap *map,
             CxHashKey key
     );
 
@@ -131,7 +131,7 @@
      * Creates an iterator for this map.
      */
     __attribute__((__nonnull__, __warn_unused_result__))
-    CxIterator (*iterator)(CxMap const *map, enum cx_map_iterator_type type);
+    CxIterator (*iterator)(const CxMap *map, enum cx_map_iterator_type type);
 };
 
 /**
@@ -141,7 +141,7 @@
     /**
      * A pointer to the key.
      */
-    CxHashKey const *key;
+    const CxHashKey *key;
     /**
      * A pointer to the value.
      */
@@ -195,7 +195,7 @@
  * @see cxMapStorePointers()
  */
 __attribute__((__nonnull__))
-static inline bool cxMapIsStoringPointers(CxMap const *map) {
+static inline bool cxMapIsStoringPointers(const CxMap *map) {
     return map->collection.store_pointer;
 }
 
@@ -227,7 +227,7 @@
  * @return the number of stored elements
  */
 __attribute__((__nonnull__))
-static inline size_t cxMapSize(CxMap const *map) {
+static inline size_t cxMapSize(const CxMap *map) {
     return map->collection.size;
 }
 
@@ -244,7 +244,7 @@
  * @return an iterator for the currently stored values
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIteratorValues(CxMap const *map) {
+static inline CxIterator cxMapIteratorValues(const CxMap *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_VALUES);
 }
 
@@ -260,7 +260,7 @@
  * @return an iterator for the currently stored keys
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIteratorKeys(CxMap const *map) {
+static inline CxIterator cxMapIteratorKeys(const CxMap *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_KEYS);
 }
 
@@ -278,7 +278,7 @@
  * @see cxMapIteratorValues()
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIterator(CxMap const *map) {
+static inline CxIterator cxMapIterator(const CxMap *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS);
 }
 
@@ -391,7 +391,7 @@
 __attribute__((__nonnull__))
 static inline int cxMapPut(
         CxMap *map,
-        char const *key,
+        const char *key,
         void *value
 ) {
     return map->cl->put(map, cx_hash_key_str(key), value);
@@ -406,7 +406,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cxMapGet(
-        CxMap const *map,
+        const CxMap *map,
         CxHashKey const &key
 ) {
     return map->cl->get(map, key);
@@ -421,7 +421,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cxMapGet(
-        CxMap const *map,
+        const CxMap *map,
         cxstring const &key
 ) {
     return map->cl->get(map, cx_hash_key_cxstr(key));
@@ -436,7 +436,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cxMapGet(
-        CxMap const *map,
+        const CxMap *map,
         cxmutstr const &key
 ) {
     return map->cl->get(map, cx_hash_key_cxstr(key));
@@ -451,8 +451,8 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cxMapGet(
-        CxMap const *map,
-        char const *key
+        const CxMap *map,
+        const char *key
 ) {
     return map->cl->get(map, cx_hash_key_str(key));
 }
@@ -540,7 +540,7 @@
 __attribute__((__nonnull__))
 static inline void cxMapRemove(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     (void) map->cl->remove(map, cx_hash_key_str(key), true);
 }
@@ -628,7 +628,7 @@
 __attribute__((__nonnull__))
 static inline void cxMapDetach(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     (void) map->cl->remove(map, cx_hash_key_str(key), false);
 }
@@ -736,7 +736,7 @@
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cxMapRemoveAndGet(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     return map->cl->remove(map, cx_hash_key_str(key), !map->store_pointer);
 }
@@ -805,7 +805,7 @@
 __attribute__((__nonnull__))
 static inline int cx_map_put_str(
         CxMap *map,
-        char const *key,
+        const char *key,
         void *value
 ) {
     return map->cl->put(map, cx_hash_key_str(key), value);
@@ -824,7 +824,7 @@
     cxstring: cx_map_put_cxstr,                   \
     cxmutstr: cx_map_put_mustr,                   \
     char*: cx_map_put_str,                        \
-    char const*: cx_map_put_str)                  \
+    const char*: cx_map_put_str)                  \
     (map, key, value)
 
 /**
@@ -836,7 +836,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cx_map_get(
-        CxMap const *map,
+        const CxMap *map,
         CxHashKey key
 ) {
     return map->cl->get(map, key);
@@ -851,7 +851,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cx_map_get_cxstr(
-        CxMap const *map,
+        const CxMap *map,
         cxstring key
 ) {
     return map->cl->get(map, cx_hash_key_cxstr(key));
@@ -866,7 +866,7 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cx_map_get_mustr(
-        CxMap const *map,
+        const CxMap *map,
         cxmutstr key
 ) {
     return map->cl->get(map, cx_hash_key_cxstr(key));
@@ -881,8 +881,8 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cx_map_get_str(
-        CxMap const *map,
-        char const *key
+        const CxMap *map,
+        const char *key
 ) {
     return map->cl->get(map, cx_hash_key_str(key));
 }
@@ -899,7 +899,7 @@
     cxstring: cx_map_get_cxstr,            \
     cxmutstr: cx_map_get_mustr,            \
     char*: cx_map_get_str,                 \
-    char const*: cx_map_get_str)           \
+    const char*: cx_map_get_str)           \
     (map, key)
 
 /**
@@ -953,7 +953,7 @@
 __attribute__((__nonnull__))
 static inline void cx_map_remove_str(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     (void) map->cl->remove(map, cx_hash_key_str(key), true);
 }
@@ -977,7 +977,7 @@
     cxstring: cx_map_remove_cxstr,            \
     cxmutstr: cx_map_remove_mustr,            \
     char*: cx_map_remove_str,                 \
-    char const*: cx_map_remove_str)           \
+    const char*: cx_map_remove_str)           \
     (map, key)
 
 /**
@@ -1035,7 +1035,7 @@
 __attribute__((__nonnull__))
 static inline void cx_map_detach_str(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     (void) map->cl->remove(map, cx_hash_key_str(key), false);
 }
@@ -1059,7 +1059,7 @@
     cxstring: cx_map_detach_cxstr,            \
     cxmutstr: cx_map_detach_mustr,            \
     char*: cx_map_detach_str,                 \
-    char const*: cx_map_detach_str)           \
+    const char*: cx_map_detach_str)           \
     (map, key)
 
 /**
@@ -1121,7 +1121,7 @@
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline void *cx_map_remove_and_get_str(
         CxMap *map,
-        char const *key
+        const char *key
 ) {
     return map->cl->remove(map, cx_hash_key_str(key), !map->collection.store_pointer);
 }
@@ -1150,7 +1150,7 @@
     cxstring: cx_map_remove_and_get_cxstr,          \
     cxmutstr: cx_map_remove_and_get_mustr,          \
     char*: cx_map_remove_and_get_str,               \
-    char const*: cx_map_remove_and_get_str)         \
+    const char*: cx_map_remove_and_get_str)         \
     (map, key)
 
 #endif // __cplusplus

mercurial