[Mesa-dev] [PATCH 8/8] program: Unify the style of function pointer calls in structs

Boyan Ding boyan.j.ding at gmail.com
Tue Nov 24 21:35:59 PST 2015


Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>
---
 src/mesa/program/prog_hash_table.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/program/prog_hash_table.c b/src/mesa/program/prog_hash_table.c
index 5592b6f..25ca6b3 100644
--- a/src/mesa/program/prog_hash_table.c
+++ b/src/mesa/program/prog_hash_table.c
@@ -111,14 +111,14 @@ hash_table_clear(struct hash_table *ht)
 static struct hash_node *
 get_node(struct hash_table *ht, const void *key)
 {
-    const unsigned hash_value = (*ht->hash)(key);
+    const unsigned hash_value = ht->hash(key);
     const unsigned bucket = hash_value % ht->num_buckets;
     struct node *node;
 
     foreach(node, & ht->buckets[bucket]) {
        struct hash_node *hn = (struct hash_node *) node;
 
-       if ((*ht->compare)(hn->key, key) == 0) {
+       if (ht->compare(hn->key, key) == 0) {
 	  return hn;
        }
     }
@@ -137,7 +137,7 @@ hash_table_find(struct hash_table *ht, const void *key)
 void
 hash_table_insert(struct hash_table *ht, void *data, const void *key)
 {
-    const unsigned hash_value = (*ht->hash)(key);
+    const unsigned hash_value = ht->hash(key);
     const unsigned bucket = hash_value % ht->num_buckets;
     struct hash_node *node;
 
@@ -156,7 +156,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key)
 bool
 hash_table_replace(struct hash_table *ht, void *data, const void *key)
 {
-    const unsigned hash_value = (*ht->hash)(key);
+    const unsigned hash_value = ht->hash(key);
     const unsigned bucket = hash_value % ht->num_buckets;
     struct node *node;
     struct hash_node *hn;
@@ -164,7 +164,7 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key)
     foreach(node, & ht->buckets[bucket]) {
        hn = (struct hash_node *) node;
 
-       if ((*ht->compare)(hn->key, key) == 0) {
+       if (ht->compare(hn->key, key) == 0) {
 	  hn->data = data;
 	  return true;
        }
-- 
2.6.2



More information about the mesa-dev mailing list