src/hash_map.c

changeset 890
54565fd74e74
parent 856
6bbbf219251d
--- a/src/hash_map.c	Wed Sep 18 00:02:18 2024 +0200
+++ b/src/hash_map.c	Sat Sep 28 15:47:28 2024 +0200
@@ -84,7 +84,7 @@
         void *value
 ) {
     struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map;
-    CxAllocator const *allocator = map->collection.allocator;
+    const CxAllocator *allocator = map->collection.allocator;
 
     unsigned hash = key.hash;
     if (hash == 0) {
@@ -223,7 +223,7 @@
 }
 
 static void *cx_hash_map_get(
-        CxMap const *map,
+        const CxMap *map,
         CxHashKey key
 ) {
     // we can safely cast, because we know the map stays untouched
@@ -238,21 +238,21 @@
     return cx_hash_map_get_remove(map, key, true, destroy);
 }
 
-static void *cx_hash_map_iter_current_entry(void const *it) {
-    struct cx_iterator_s const *iter = it;
+static void *cx_hash_map_iter_current_entry(const void *it) {
+    const struct cx_iterator_s *iter = it;
     // struct has to have a compatible signature
     return (struct cx_map_entry_s *) &(iter->kv_data);
 }
 
-static void *cx_hash_map_iter_current_key(void const *it) {
-    struct cx_iterator_s const *iter = it;
+static void *cx_hash_map_iter_current_key(const void *it) {
+    const struct cx_iterator_s *iter = it;
     struct cx_hash_map_element_s *elm = iter->elem_handle;
     return &elm->key;
 }
 
-static void *cx_hash_map_iter_current_value(void const *it) {
-    struct cx_iterator_s const *iter = it;
-    struct cx_hash_map_s const *map = iter->src_handle.c;
+static void *cx_hash_map_iter_current_value(const void *it) {
+    const struct cx_iterator_s *iter = it;
+    const struct cx_hash_map_s *map = iter->src_handle.c;
     struct cx_hash_map_element_s *elm = iter->elem_handle;
     if (map->base.collection.store_pointer) {
         return *(void **) elm->data;
@@ -261,8 +261,8 @@
     }
 }
 
-static bool cx_hash_map_iter_valid(void const *it) {
-    struct cx_iterator_s const *iter = it;
+static bool cx_hash_map_iter_valid(const void *it) {
+    const struct cx_iterator_s *iter = it;
     return iter->elem_handle != NULL;
 }
 
@@ -324,7 +324,7 @@
 }
 
 static CxIterator cx_hash_map_iterator(
-        CxMap const *map,
+        const CxMap *map,
         enum cx_map_iterator_type type
 ) {
     CxIterator iter;
@@ -389,7 +389,7 @@
 };
 
 CxMap *cxHashMapCreate(
-        CxAllocator const *allocator,
+        const CxAllocator *allocator,
         size_t itemsize,
         size_t buckets
 ) {

mercurial