mesa/st: enable carry/borrow lowering pass
[mesa.git] / src / mesa / main / hash_table.c
index 2bd1929aa9dd3b36462a1d53fda45fb14c3b440d..ad8f898529113d5ba9780e07fe6e6be3beeb60c3 100644 (file)
 #include <string.h>
 
 #include "main/hash_table.h"
+#include "main/macros.h"
 #include "ralloc.h"
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
-
 static const uint32_t deleted_key_value;
 
 /**
@@ -111,8 +110,8 @@ entry_is_present(const struct hash_table *ht, struct hash_entry *entry)
 
 struct hash_table *
 _mesa_hash_table_create(void *mem_ctx,
-                        bool key_equals_function(const void *a,
-                                                 const void *b))
+                        bool (*key_equals_function)(const void *a,
+                                                    const void *b))
 {
    struct hash_table *ht;
 
@@ -120,7 +119,6 @@ _mesa_hash_table_create(void *mem_ctx,
    if (ht == NULL)
       return NULL;
 
-   ht->mem_ctx = mem_ctx;
    ht->size_index = 0;
    ht->size = hash_sizes[ht->size_index].size;
    ht->rehash = hash_sizes[ht->size_index].rehash;