diff --git a/Include/Fledasty/Core/HashTable.h b/Include/Fledasty/Core/HashTable.h index e1d0b30..ab26d1e 100644 --- a/Include/Fledasty/Core/HashTable.h +++ b/Include/Fledasty/Core/HashTable.h @@ -40,10 +40,10 @@ typedef struct { size_t key_byte_size, value_byte_size; FledastyDynamicArray *Table; - size_t (*hash_function)(void *key); + size_t (*hash_function)(const void *key); } FledastyHashTable; -FledastyError fledasty_hash_table_initialize(FledastyHashTable *new_hash_table, size_t key_byte_size, size_t value_byte_size, size_t (*hash_function)(void *key)); +FledastyError fledasty_hash_table_initialize(FledastyHashTable *new_hash_table, const size_t key_byte_size, const size_t value_byte_size, size_t (*hash_function)(const void *key)); FledastyError fledasty_hash_table_destroy(FledastyHashTable *current_hash_table); FledastyError fledasty_hash_table_insert(FledastyHashTable *current_hash_table, void *key, void *value); diff --git a/Src/Core/HashTable.c b/Src/Core/HashTable.c index 8e92a31..aacf83a 100644 --- a/Src/Core/HashTable.c +++ b/Src/Core/HashTable.c @@ -28,7 +28,7 @@ static const int FLEDASTY_HASH_TABLE_SIZE_THRESHOLD = 75; -FledastyError fledasty_hash_table_initialize(FledastyHashTable *new_hash_table, size_t key_byte_size, size_t value_byte_size, size_t (*hash_function)(void *key)) { +FledastyError fledasty_hash_table_initialize(FledastyHashTable *new_hash_table, const size_t key_byte_size, const size_t value_byte_size, size_t (*hash_function)(const void *key)) { if (new_hash_table == NULL || hash_function == NULL) { return FLEDASTY_ERROR_INVALID_POINTER; } diff --git a/Tests/Main.c b/Tests/Main.c index fba8285..4ce0f77 100644 --- a/Tests/Main.c +++ b/Tests/Main.c @@ -29,7 +29,7 @@ #include #include -static inline size_t integer_hash_function(void *key) { return *(size_t*)key; } +static inline size_t integer_hash_function(const void *key) { return *(size_t*)key; } int main() { FledastyQueue test_queue;