mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
[mesa.git] / src / mesa / main / set.c
index 736841fc9c0f52e63f08101d3cab34b19dda54e0..989e5dece864b9163b258c88e6fd6d933fd86e74 100644 (file)
 
 #include <stdlib.h>
 
+#include "macros.h"
 #include "set.h"
 #include "ralloc.h"
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
-
 /*
  * From Knuth -- a good choice for hash/rehash values is p, p-2 where
  * p and p-2 are both prime.  These tables are sized to have an extra 10%
@@ -104,8 +103,8 @@ entry_is_present(struct set_entry *entry)
 
 struct set *
 _mesa_set_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 set *ht;
 
@@ -113,7 +112,6 @@ _mesa_set_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;