From: Mike D. Lowis Date: Tue, 9 Jun 2015 14:13:46 +0000 (-0400) Subject: Fixed a duplicate type definition for hash functions X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=87a94d558f13d01705da3d3567fefda4a005fb9d;p=projs%2Flibcds.git Fixed a duplicate type definition for hash functions --- diff --git a/source/map/map.c b/source/map/map.c index 9a8771d..b9d84cd 100644 --- a/source/map/map.c +++ b/source/map/map.c @@ -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); diff --git a/source/map/map.h b/source/map/map.h index e747903..09c69bb 100644 --- a/source/map/map.h +++ b/source/map/map.h @@ -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. diff --git a/source/set/set.c b/source/set/set.c index a68c0bb..f9df2c0 100644 --- a/source/set/set.c +++ b/source/set/set.c @@ -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); diff --git a/source/set/set.h b/source/set/set.h index 7a4cfa2..225f55b 100644 --- a/source/set/set.h +++ b/source/set/set.h @@ -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.