]> git.mdlowis.com Git - projs/libcds.git/commitdiff
Fixed a duplicate type definition for hash functions
authorMike D. Lowis <mike.lowis@gentex.com>
Tue, 9 Jun 2015 14:13:46 +0000 (10:13 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Tue, 9 Jun 2015 14:13:46 +0000 (10:13 -0400)
source/map/map.c
source/map/map.h
source/set/set.c
source/set/set.h

index 9a8771da3313ac72bdb30fd44b6a258674c827a4..b9d84cd15dbfc5c0daadfd6c5dd849e0f448719b 100644 (file)
@@ -11,7 +11,7 @@ typedef struct {
 } map_pair_t;
 
 struct map_t {
-    hashfn_t hash_func;
+    map_hashfn_t hash_func;
     rbt_t* tree;
 };
 
@@ -53,7 +53,7 @@ static int map_compare_nodes(void* env, void* p_a, void* p_b)
     return cmp;
 }
 
-map_t* map_new(cmp_t* cmp, hashfn_t hash_fn)
+map_t* map_new(cmp_t* cmp, map_hashfn_t hash_fn)
 {
     map_t* map  = (map_t*)mem_allocate(sizeof(map_t), &map_free);
     cmp_t* comp = cmp_new(cmp, &map_compare_nodes);
index e7479032218712c62fc5fc1cf6bdee9cf4a8b47a..09c69bbc4802a4d8d7204a814b3ba72818969d32 100644 (file)
@@ -12,7 +12,7 @@ extern "C" {
 #include "rbt.h"
 
 /** Function pointer that returns the 32-bit hash of the given object. */
-typedef uint32_t (*hashfn_t)(void* obj);
+typedef uint32_t (*map_hashfn_t)(void* obj);
 
 /* map data structure */
 struct map_t;
@@ -28,7 +28,7 @@ typedef struct map_t map_t;
  *
  * @return The new map.
  */
-map_t* map_new(cmp_t* cmp, hashfn_t hash_fn);
+map_t* map_new(cmp_t* cmp, map_hashfn_t hash_fn);
 
 /**
  * @brief Determines whether the map contains the given key or not.
index a68c0bb0a24a3e067a2bd6c012351b56133fc414..f9df2c004e050d5b011c988f382a80dd6a0db99b 100644 (file)
@@ -10,7 +10,7 @@ typedef struct {
 } set_pair_t;
 
 struct set_t {
-    hashfn_t hash_func;
+    set_hashfn_t hash_func;
     rbt_t* tree;
 };
 
@@ -48,7 +48,7 @@ static int set_compare_nodes(void* env, void* p_a, void* p_b)
     return cmp;
 }
 
-set_t* set_new(cmp_t* cmp, hashfn_t hash_fn)
+set_t* set_new(cmp_t* cmp, set_hashfn_t hash_fn)
 {
     set_t* set  = (set_t*)mem_allocate(sizeof(set_t), &set_free);
     cmp_t* comp = cmp_new(cmp, &set_compare_nodes);
index 7a4cfa2a67e49a483177157f2b550161e73026cc..225f55bef8d73529c37f74fdcfa98952ecf88290 100644 (file)
@@ -12,7 +12,7 @@ extern "C" {
 #include "rbt.h"
 
 /** Function pointer that returns the 32-bit hash of the given object. */
-typedef uint32_t (*hashfn_t)(void* obj);
+typedef uint32_t (*set_hashfn_t)(void* obj);
 
 /* Set data structure */
 struct set_t;
@@ -31,7 +31,7 @@ typedef struct set_t set_t;
  *
  * @return the newly constructed set.
  */
-set_t* set_new(cmp_t* cmp, hashfn_t hash_fn);
+set_t* set_new(cmp_t* cmp, set_hashfn_t hash_fn);
 
 /**
  * @brief Determines if the value is a member of the set.