diff --git a/foobar.c b/foobar.c index ae99962..ecd2737 100644 --- a/foobar.c +++ b/foobar.c @@ -6,7 +6,7 @@ int main(void) { int *ints; set_init(&ints, allocator, .initial_capacity=20); map_print_mapping_state(ints, stdout); - for ( int i = 0; i < 20; i++ ) { + for ( int i = 0; i < 100; i++ ) { set_add(&ints, i); map_print_mapping_state(ints, stdout); } diff --git a/map.c b/map.c index 7be26cb..de0c58d 100644 --- a/map.c +++ b/map.c @@ -100,9 +100,9 @@ void *map_create_func( return header->bytes; } -static const void *internal_cig_key_ptr_from_pair_ptr(const void *this, const void *pair) { +static const uint8_t *internal_cig_key_ptr_from_pair_ptr(const void *this, const void *pair) { map_header_t *header = PTR_FROM_FIELD_PTR(map_header_t, bytes, this); - return (const void *) &((const char *)pair)[header->key_offset]; + return (const uint8_t *) &((const char *)pair)[header->key_offset]; } // TODO: just make these internal probably @@ -143,7 +143,7 @@ unsigned int map_place(void *this, index_pair_t idx_pair) { index_pair_t map_pair_hash(void *this, void *pair) { map_header_t *header = PTR_FROM_FIELD_PTR(map_header_t, bytes, this); - const void *key = internal_cig_key_ptr_from_pair_ptr(this, pair); + const uint8_t *key = internal_cig_key_ptr_from_pair_ptr(this, pair); // find the initial index based on hash uint32_t mapping_index;