diff options
Diffstat (limited to 'src/solvers/h48/map.h')
| -rw-r--r-- | src/solvers/h48/map.h | 28 |
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 @@ | |||
| 1 | STATIC void h48map_create(h48map_t [static 1], uint64_t, uint64_t); | 1 | STATIC void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 2 | STATIC void h48map_clear(h48map_t [static 1]); | 2 | STATIC void h48map_clear(h48map_t [NON_NULL]); |
| 3 | STATIC void h48map_destroy(h48map_t [static 1]); | 3 | STATIC void h48map_destroy(h48map_t [NON_NULL]); |
| 4 | STATIC uint64_t h48map_lookup(h48map_t [static 1], uint64_t); | 4 | STATIC uint64_t h48map_lookup(h48map_t [NON_NULL], uint64_t); |
| 5 | STATIC void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); | 5 | STATIC void h48map_insertmin(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 6 | STATIC uint64_t h48map_value(h48map_t [static 1], uint64_t); | 6 | STATIC uint64_t h48map_value(h48map_t [NON_NULL], uint64_t); |
| 7 | STATIC kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); | 7 | STATIC kvpair_t h48map_nextkvpair(h48map_t [NON_NULL], uint64_t [NON_NULL]); |
| 8 | 8 | ||
| 9 | STATIC void | 9 | STATIC void |
| 10 | h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer) | 10 | h48map_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 | ||
| 19 | STATIC void | 19 | STATIC void |
| 20 | h48map_clear(h48map_t map[static 1]) | 20 | h48map_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 | ||
| 26 | STATIC void | 26 | STATIC void |
| 27 | h48map_destroy(h48map_t map[static 1]) | 27 | h48map_destroy(h48map_t map[NON_NULL]) |
| 28 | { | 28 | { |
| 29 | free(map->table); | 29 | free(map->table); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | STATIC_INLINE uint64_t | 32 | STATIC_INLINE uint64_t |
| 33 | h48map_lookup(h48map_t map[static 1], uint64_t x) | 33 | h48map_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 | ||
| 46 | STATIC_INLINE void | 46 | STATIC_INLINE void |
| 47 | h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val) | 47 | h48map_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 | ||
| 59 | STATIC_INLINE uint64_t | 59 | STATIC_INLINE uint64_t |
| 60 | h48map_value(h48map_t map[static 1], uint64_t key) | 60 | h48map_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 | ||
| 65 | STATIC kvpair_t | 65 | STATIC kvpair_t |
| 66 | h48map_nextkvpair(h48map_t map[static 1], uint64_t p[static 1]) | 66 | h48map_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; |
