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 0e9f926..34416fc 100644 --- a/src/solvers/h48/map.h +++ b/src/solvers/h48/map.h | |||
| @@ -15,15 +15,15 @@ typedef struct { | |||
| 15 | uint64_t val; | 15 | uint64_t val; |
| 16 | } kvpair_t; | 16 | } kvpair_t; |
| 17 | 17 | ||
| 18 | _static void h48map_create(h48map_t *, uint64_t, uint64_t); | 18 | STATIC void h48map_create(h48map_t *, uint64_t, uint64_t); |
| 19 | _static void h48map_clear(h48map_t *); | 19 | STATIC void h48map_clear(h48map_t *); |
| 20 | _static void h48map_destroy(h48map_t *); | 20 | STATIC void h48map_destroy(h48map_t *); |
| 21 | _static uint64_t h48map_lookup(h48map_t *, uint64_t); | 21 | STATIC uint64_t h48map_lookup(h48map_t *, uint64_t); |
| 22 | _static void h48map_insertmin(h48map_t *, uint64_t, uint64_t); | 22 | STATIC void h48map_insertmin(h48map_t *, uint64_t, uint64_t); |
| 23 | _static uint64_t h48map_value(h48map_t *, uint64_t); | 23 | STATIC uint64_t h48map_value(h48map_t *, uint64_t); |
| 24 | _static kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); | 24 | STATIC kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); |
| 25 | 25 | ||
| 26 | _static void | 26 | STATIC void |
| 27 | h48map_create(h48map_t *map, uint64_t capacity, uint64_t randomizer) | 27 | h48map_create(h48map_t *map, uint64_t capacity, uint64_t randomizer) |
| 28 | { | 28 | { |
| 29 | map->capacity = capacity; | 29 | map->capacity = capacity; |
| @@ -33,20 +33,20 @@ h48map_create(h48map_t *map, uint64_t capacity, uint64_t randomizer) | |||
| 33 | h48map_clear(map); | 33 | h48map_clear(map); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | _static void | 36 | STATIC void |
| 37 | h48map_clear(h48map_t *map) | 37 | h48map_clear(h48map_t *map) |
| 38 | { | 38 | { |
| 39 | memset(map->table, 0xFF, map->capacity * sizeof(uint64_t)); | 39 | memset(map->table, 0xFF, map->capacity * sizeof(uint64_t)); |
| 40 | map->n = 0; | 40 | map->n = 0; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | _static void | 43 | STATIC void |
| 44 | h48map_destroy(h48map_t *map) | 44 | h48map_destroy(h48map_t *map) |
| 45 | { | 45 | { |
| 46 | free(map->table); | 46 | free(map->table); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | _static_inline uint64_t | 49 | STATIC_INLINE uint64_t |
| 50 | h48map_lookup(h48map_t *map, uint64_t x) | 50 | h48map_lookup(h48map_t *map, uint64_t x) |
| 51 | { | 51 | { |
| 52 | uint64_t hash, i; | 52 | uint64_t hash, i; |
| @@ -60,7 +60,7 @@ h48map_lookup(h48map_t *map, uint64_t x) | |||
| 60 | return i; | 60 | return i; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | _static_inline void | 63 | STATIC_INLINE void |
| 64 | h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val) | 64 | h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val) |
| 65 | { | 65 | { |
| 66 | uint64_t i, oldval, min; | 66 | uint64_t i, oldval, min; |
| @@ -73,13 +73,13 @@ h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val) | |||
| 73 | map->table[i] = (key & MAP_KEYMASK) | (min << MAP_KEYSHIFT); | 73 | map->table[i] = (key & MAP_KEYMASK) | (min << MAP_KEYSHIFT); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | _static_inline uint64_t | 76 | STATIC_INLINE uint64_t |
| 77 | h48map_value(h48map_t *map, uint64_t key) | 77 | h48map_value(h48map_t *map, uint64_t key) |
| 78 | { | 78 | { |
| 79 | return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT; | 79 | return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | _static kvpair_t | 82 | STATIC kvpair_t |
| 83 | h48map_nextkvpair(h48map_t *map, uint64_t *p) | 83 | h48map_nextkvpair(h48map_t *map, uint64_t *p) |
| 84 | { | 84 | { |
| 85 | kvpair_t kv; | 85 | kvpair_t kv; |
