util: Move hash_table_call_foreach to util hash table
authorThomas Helland <thomashelland90@gmail.com>
Tue, 16 Aug 2016 20:10:17 +0000 (22:10 +0200)
committerTimothy Arceri <timothy.arceri@collabora.com>
Mon, 12 Sep 2016 00:48:35 +0000 (10:48 +1000)
It is included through the util/hash_table include in
the program hash_table, so this should be safe.
This will be needed when we start converting each use of
the program_hash_table, as some places need this function.

Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/program/hash_table.h
src/util/hash_table.h

index 687a9963c6e948fc8c252ab7c0b44a80c0811bd3..421d0e9dc5c7b0f54fd33215657f93ec2713bba4 100644 (file)
@@ -214,20 +214,6 @@ hash_table_pointer_compare(const void *key1, const void *key2)
    return _mesa_key_pointer_equal(key1, key2);
 }
 
-
-static inline void
-hash_table_call_foreach(struct hash_table *ht,
-                       void (*callback)(const void *key,
-                                        void *data,
-                                        void *closure),
-                       void *closure)
-{
-   struct hash_entry *entry;
-
-   hash_table_foreach(ht, entry)
-      callback(entry->key, entry->data, closure);
-}
-
 struct string_to_uint_map *
 string_to_uint_map_ctor();
 
index c69abfa3e64db3286c323872bb4f03bd5542c5fc..b35ee871bb3ade5932fd7dfd31dffae523e576d2 100644 (file)
@@ -139,6 +139,19 @@ _mesa_fnv32_1a_accumulate_block(uint32_t hash, const void *data, size_t size)
         entry != NULL;                                  \
         entry = _mesa_hash_table_next_entry(ht, entry))
 
+static inline void
+hash_table_call_foreach(struct hash_table *ht,
+                        void (*callback)(const void *key,
+                                         void *data,
+                                         void *closure),
+                        void *closure)
+{
+   struct hash_entry *entry;
+
+   hash_table_foreach(ht, entry)
+      callback(entry->key, entry->data, closure);
+}
+
 #ifdef __cplusplus
 } /* extern C */
 #endif