aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-20 18:12:34 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-20 18:12:34 +0100
commit209cb97557aa6fae5c9e8d062f590e7e11a420cc (patch)
tree18a395f2b680c597e01faf2073b5ce8aa9f805b3
parent858ae4d03def568a03f53826c31842f24d9c49c0 (diff)
fix parameters
-rw-r--r--cheesemap.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/cheesemap.h b/cheesemap.h
index 0afdf5a..9d7139d 100644
--- a/cheesemap.h
+++ b/cheesemap.h
@@ -94,10 +94,11 @@ struct cheesemap {
struct cheesemap_raw raw;
};
-static inline struct cheesemap cm_new(uintptr_t entry_size, uint8_t* mem_usr,
- cm_malloc_fn malloc, cm_free_fn free,
- uint8_t* map_usr, cm_hash_fn hash,
- cm_compare_fn compare) {
+static inline void cm_new(struct cheesemap* map, uintptr_t entry_size,
+ uint8_t* mem_usr, cm_malloc_fn malloc, cm_free_fn free,
+ uint8_t* map_usr, cm_hash_fn hash,
+ cm_compare_fn compare) {
+ assert(map != NULL);
assert(malloc != NULL && free != NULL);
assert(hash != NULL && compare != NULL);
@@ -107,7 +108,7 @@ static inline struct cheesemap cm_new(uintptr_t entry_size, uint8_t* mem_usr,
hash, compare, //
};
- return (struct cheesemap){entry_size, fns, cm_raw_new()};
+ *map = (struct cheesemap){entry_size, fns, cm_raw_new()};
}
static inline void cm_drop(struct cheesemap* map) {