aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/map.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-04 12:02:56 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-04 12:02:56 +0200
commite6be287bbfa6beda038ec8b085300c5dc9c2ecd8 (patch)
tree55d0acb9efde811985157068f3656514b90344cf /src/solvers/h48/map.h
parent2ac46cb4d4133e5d5de90bacfc9b6e979d1d6046 (diff)
downloadnissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.tar.gz
nissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.zip
Use macro for [static N]
Diffstat (limited to '')
-rw-r--r--src/solvers/h48/map.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/solvers/h48/map.h b/src/solvers/h48/map.h
index b603ee3..c9cfb06 100644
--- a/src/solvers/h48/map.h
+++ b/src/solvers/h48/map.h
@@ -1,13 +1,13 @@
1STATIC void h48map_create(h48map_t [static 1], uint64_t, uint64_t); 1STATIC void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t);
2STATIC void h48map_clear(h48map_t [static 1]); 2STATIC void h48map_clear(h48map_t [NON_NULL]);
3STATIC void h48map_destroy(h48map_t [static 1]); 3STATIC void h48map_destroy(h48map_t [NON_NULL]);
4STATIC uint64_t h48map_lookup(h48map_t [static 1], uint64_t); 4STATIC uint64_t h48map_lookup(h48map_t [NON_NULL], uint64_t);
5STATIC void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); 5STATIC void h48map_insertmin(h48map_t [NON_NULL], uint64_t, uint64_t);
6STATIC uint64_t h48map_value(h48map_t [static 1], uint64_t); 6STATIC uint64_t h48map_value(h48map_t [NON_NULL], uint64_t);
7STATIC kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); 7STATIC kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]);
8 8
9STATIC void 9STATIC void
10h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer) 10h48map_create(h48map_t map[NON_NULL], uint64_t capacity, uint64_t randomizer)
11{ 11{
12 map->capacity = capacity; 12 map->capacity = capacity;
13 map->randomizer = randomizer; 13 map->randomizer = randomizer;
@@ -17,20 +17,20 @@ h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer)
17} 17}
18 18
19STATIC void 19STATIC void
20h48map_clear(h48map_t map[static 1]) 20h48map_clear(h48map_t map[NON_NULL])
21{ 21{
22 memset(map->table, 0xFF, map->capacity * sizeof(uint64_t)); 22 memset(map->table, 0xFF, map->capacity * sizeof(uint64_t));
23 map->n = 0; 23 map->n = 0;
24} 24}
25 25
26STATIC void 26STATIC void
27h48map_destroy(h48map_t map[static 1]) 27h48map_destroy(h48map_t map[NON_NULL])
28{ 28{
29 free(map->table); 29 free(map->table);
30} 30}
31 31
32STATIC_INLINE uint64_t 32STATIC_INLINE uint64_t
33h48map_lookup(h48map_t map[static 1], uint64_t x) 33h48map_lookup(h48map_t map[NON_NULL], uint64_t x)
34{ 34{
35 uint64_t hash, i; 35 uint64_t hash, i;
36 36
@@ -44,7 +44,7 @@ h48map_lookup(h48map_t map[static 1], uint64_t x)
44} 44}
45 45
46STATIC_INLINE void 46STATIC_INLINE void
47h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val) 47h48map_insertmin(h48map_t map[NON_NULL], uint64_t key, uint64_t val)
48{ 48{
49 uint64_t i, oldval, min; 49 uint64_t i, oldval, min;
50 50
@@ -57,13 +57,13 @@ h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val)
57} 57}
58 58
59STATIC_INLINE uint64_t 59STATIC_INLINE uint64_t
60h48map_value(h48map_t map[static 1], uint64_t key) 60h48map_value(h48map_t map[NON_NULL], uint64_t key)
61{ 61{
62 return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT; 62 return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT;
63} 63}
64 64
65STATIC kvpair_t 65STATIC kvpair_t
66h48map_nextkvpair(h48map_t map[static 1], uint64_t p[static 1]) 66h48map_nextkvpair(h48map_t map[NON_NULL], uint64_t p[NON_NULL])
67{ 67{
68 kvpair_t kv; 68 kvpair_t kv;
69 uint64_t pair; 69 uint64_t pair;

Generated with cgit - Back to sebastiano.tronto.net