diff options
author | Corbin Simpson <[email protected]> | 2009-10-16 08:27:56 -0700 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-10-16 08:43:02 -0700 |
commit | 3924d8611513eea74446d655b554596ab66381ff (patch) | |
tree | 710b6bb1ddfc7ccfd9af64e3e8b1cd04f1d07a21 /src/gallium | |
parent | 166957abebea6aa203eba7e6348e89d53cf0e13e (diff) |
util: Change function names to begin with u_.
Avoids link-time clashes with Mesa's internal hash table.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_hash_table.c | 41 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_hash_table.h | 33 |
2 files changed, 38 insertions, 36 deletions
diff --git a/src/gallium/auxiliary/util/u_hash_table.c b/src/gallium/auxiliary/util/u_hash_table.c index 8c2a8f454cc..de711f9c1d3 100644 --- a/src/gallium/auxiliary/util/u_hash_table.c +++ b/src/gallium/auxiliary/util/u_hash_table.c @@ -47,7 +47,7 @@ #include "util/u_hash_table.h" -struct hash_table +struct u_hash_table { struct cso_hash *cso; @@ -75,13 +75,13 @@ hash_table_item(struct cso_hash_iter iter) } -struct hash_table * -hash_table_create(unsigned (*hash)(void *key), - int (*compare)(void *key1, void *key2)) +struct u_hash_table * +u_hash_table_create(unsigned (*hash)(void *key), + int (*compare)(void *key1, void *key2)) { - struct hash_table *ht; + struct u_hash_table *ht; - ht = MALLOC_STRUCT(hash_table); + ht = MALLOC_STRUCT(u_hash_table); if(!ht) return NULL; @@ -99,7 +99,7 @@ hash_table_create(unsigned (*hash)(void *key), static INLINE struct cso_hash_iter -hash_table_find_iter(struct hash_table *ht, +hash_table_find_iter(struct u_hash_table *ht, void *key, unsigned key_hash) { @@ -119,7 +119,7 @@ hash_table_find_iter(struct hash_table *ht, static INLINE struct hash_table_item * -hash_table_find_item(struct hash_table *ht, +hash_table_find_item(struct u_hash_table *ht, void *key, unsigned key_hash) { @@ -139,9 +139,9 @@ hash_table_find_item(struct hash_table *ht, enum pipe_error -hash_table_set(struct hash_table *ht, - void *key, - void *value) +u_hash_table_set(struct u_hash_table *ht, + void *key, + void *value) { unsigned key_hash; struct hash_table_item *item; @@ -178,8 +178,8 @@ hash_table_set(struct hash_table *ht, void * -hash_table_get(struct hash_table *ht, - void *key) +u_hash_table_get(struct u_hash_table *ht, + void *key) { unsigned key_hash; struct hash_table_item *item; @@ -199,8 +199,8 @@ hash_table_get(struct hash_table *ht, void -hash_table_remove(struct hash_table *ht, - void *key) +u_hash_table_remove(struct u_hash_table *ht, + void *key) { unsigned key_hash; struct cso_hash_iter iter; @@ -225,7 +225,7 @@ hash_table_remove(struct hash_table *ht, void -hash_table_clear(struct hash_table *ht) +u_hash_table_clear(struct u_hash_table *ht) { struct cso_hash_iter iter; struct hash_table_item *item; @@ -244,9 +244,10 @@ hash_table_clear(struct hash_table *ht) enum pipe_error -hash_table_foreach(struct hash_table *ht, - enum pipe_error (*callback)(void *key, void *value, void *data), - void *data) +u_hash_table_foreach(struct u_hash_table *ht, + enum pipe_error (*callback) + (void *key, void *value, void *data), + void *data) { struct cso_hash_iter iter; struct hash_table_item *item; @@ -270,7 +271,7 @@ hash_table_foreach(struct hash_table *ht, void -hash_table_destroy(struct hash_table *ht) +u_hash_table_destroy(struct u_hash_table *ht) { struct cso_hash_iter iter; struct hash_table_item *item; diff --git a/src/gallium/auxiliary/util/u_hash_table.h b/src/gallium/auxiliary/util/u_hash_table.h index feee881582e..feb47365f03 100644 --- a/src/gallium/auxiliary/util/u_hash_table.h +++ b/src/gallium/auxiliary/util/u_hash_table.h @@ -46,7 +46,7 @@ extern "C" { /** * Generic purpose hash table. */ -struct hash_table; +struct u_hash_table; /** @@ -55,37 +55,38 @@ struct hash_table; * @param hash hash function * @param compare should return 0 for two equal keys. */ -struct hash_table * -hash_table_create(unsigned (*hash)(void *key), - int (*compare)(void *key1, void *key2)); +struct u_hash_table * +u_hash_table_create(unsigned (*hash)(void *key), + int (*compare)(void *key1, void *key2)); enum pipe_error -hash_table_set(struct hash_table *ht, - void *key, - void *value); +u_hash_table_set(struct u_hash_table *ht, + void *key, + void *value); void * -hash_table_get(struct hash_table *ht, - void *key); +u_hash_table_get(struct u_hash_table *ht, + void *key); void -hash_table_remove(struct hash_table *ht, - void *key); +u_hash_table_remove(struct u_hash_table *ht, + void *key); void -hash_table_clear(struct hash_table *ht); +u_hash_table_clear(struct u_hash_table *ht); enum pipe_error -hash_table_foreach(struct hash_table *ht, - enum pipe_error (*callback)(void *key, void *value, void *data), - void *data); +u_hash_table_foreach(struct u_hash_table *ht, + enum pipe_error (*callback) + (void *key, void *value, void *data), + void *data); void -hash_table_destroy(struct hash_table *ht); +u_hash_table_destroy(struct u_hash_table *ht); #ifdef __cplusplus |