[PATCH libdrm 3/9] amdgpu/util_hash_table: hide private symbols from global namespace

Emil Velikov emil.l.velikov at gmail.com
Fri Aug 7 09:44:57 PDT 2015


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 amdgpu/util_hash_table.c | 18 ++++++++++--------
 amdgpu/util_hash_table.h | 24 ++++++++++++++++--------
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/amdgpu/util_hash_table.c b/amdgpu/util_hash_table.c
index cb7213c..ce6f1d5 100644
--- a/amdgpu/util_hash_table.c
+++ b/amdgpu/util_hash_table.c
@@ -69,8 +69,9 @@ util_hash_table_item(struct util_hash_iter iter)
 	return (struct util_hash_table_item *)util_hash_iter_data(iter);
 }
 
-struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
-				int (*compare)(void *key1, void *key2))
+drm_private struct util_hash_table *
+util_hash_table_create(unsigned (*hash)(void *key),
+		       int (*compare)(void *key1, void *key2))
 {
 	struct util_hash_table *ht;
 
@@ -126,7 +127,8 @@ util_hash_table_find_item(struct util_hash_table *ht,
 	return NULL;
 }
 
-void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
+drm_private void
+util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
 {
 	unsigned key_hash;
 	struct util_hash_table_item *item;
@@ -159,7 +161,7 @@ void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
 	}
 }
 
-void *util_hash_table_get(struct util_hash_table *ht, void *key)
+drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key)
 {
 	unsigned key_hash;
 	struct util_hash_table_item *item;
@@ -177,7 +179,7 @@ void *util_hash_table_get(struct util_hash_table *ht, void *key)
 	return item->value;
 }
 
-void util_hash_table_remove(struct util_hash_table *ht, void *key)
+drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key)
 {
 	unsigned key_hash;
 	struct util_hash_iter iter;
@@ -200,7 +202,7 @@ void util_hash_table_remove(struct util_hash_table *ht, void *key)
 	util_hash_erase(ht->head, iter);
 }
 
-void util_hash_table_clear(struct util_hash_table *ht)
+drm_private void util_hash_table_clear(struct util_hash_table *ht)
 {
 	struct util_hash_iter iter;
 	struct util_hash_table_item *item;
@@ -217,7 +219,7 @@ void util_hash_table_clear(struct util_hash_table *ht)
 	}
 }
 
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
 			void (*callback)(void *key, void *value, void *data),
 			void *data)
 {
@@ -236,7 +238,7 @@ void util_hash_table_foreach(struct util_hash_table *ht,
 	}
 }
 
-void util_hash_table_destroy(struct util_hash_table *ht)
+drm_private void util_hash_table_destroy(struct util_hash_table *ht)
 {
 	struct util_hash_iter iter;
 	struct util_hash_table_item *item;
diff --git a/amdgpu/util_hash_table.h b/amdgpu/util_hash_table.h
index 04fe704..e000128 100644
--- a/amdgpu/util_hash_table.h
+++ b/amdgpu/util_hash_table.h
@@ -34,6 +34,12 @@
 #ifndef U_HASH_TABLE_H_
 #define U_HASH_TABLE_H_
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "libdrm_macros.h"
+
 /**
  * Generic purpose hash table.
  */
@@ -45,21 +51,23 @@ struct util_hash_table;
  * @param hash hash function
  * @param compare should return 0 for two equal keys.
  */
-struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
-				int (*compare)(void *key1, void *key2));
+drm_private struct util_hash_table *
+util_hash_table_create(unsigned (*hash)(void *key),
+		       int (*compare)(void *key1, void *key2));
 
-void util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
+drm_private void
+util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
 
-void *util_hash_table_get(struct util_hash_table *ht, void *key);
+drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key);
 
-void util_hash_table_remove(struct util_hash_table *ht, void *key);
+drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key);
 
-void util_hash_table_clear(struct util_hash_table *ht);
+drm_private void util_hash_table_clear(struct util_hash_table *ht);
 
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
 			void (*callback)(void *key, void *value, void *data),
 			void *data);
 
-void util_hash_table_destroy(struct util_hash_table *ht);
+drm_private void util_hash_table_destroy(struct util_hash_table *ht);
 
 #endif /* U_HASH_TABLE_H_ */
-- 
2.5.0



More information about the dri-devel mailing list