diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-09-06 13:51:22 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-09-06 13:51:22 +0200 |
commit | b97c1177a082a1c910b502fd4cc67b62403b4632 (patch) | |
tree | 00818528f996daa8a3af9eaf667c5af0b9153dbd /src/tc-map.c | |
parent | cb22888f08466e46b115bdef6c4ee39b9a2a983e (diff) | |
parent | a4d0a336a895b4ca70026d36988ba32707041271 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/tc-map.c')
-rw-r--r-- | src/tc-map.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tc-map.c b/src/tc-map.c index 4fe0408..8a22259 100644 --- a/src/tc-map.c +++ b/src/tc-map.c @@ -6,6 +6,7 @@ * modify it under the terms of the WTF Public License version 2 or * (at your option) any later version. */ +#include "config.h" #include <errno.h> #include <math.h> #include <stdarg.h> @@ -27,7 +28,7 @@ union HXpoly { struct HXmap *map; - struct HXhmap *hmap; + struct HXumap *hmap; struct HXrbtree *rbt; }; @@ -353,9 +354,9 @@ static void tmap_new_perfect_tree(struct HXmap *map, * Compute an "agglomeration" index that models the lack of distributedness * in hash maps. Range is 0-100%. */ -static double hmap_agg_index(const struct HXhmap *hmap, bool verbose) +static double hmap_agg_index(const struct HXumap *hmap, bool verbose) { - const struct HXhmap_node *hnode; + const struct HXumap_node *hnode; unsigned int i; int f = 0, j; @@ -365,7 +366,7 @@ static double hmap_agg_index(const struct HXhmap *hmap, bool verbose) printf("{"); /* - * HXhmap is written such that the number of buckets is always equal or + * HXumap is written such that the number of buckets is always equal or * greater than the element count. This is done because, in practice, * buckets will be populated with more than a few (two/three) entries * before elements/buckets >= grow_trigger_ratio. @@ -468,7 +469,7 @@ static void tmap_hmap_test_1(void) tmap_ipop(); } -static void __rbt_walk_tree(const struct HXrbtree_node *node, +static void __rbt_walk_tree(const struct HXrbnode *node, char *buf, size_t s) { bool has_children = node->sub[0] != NULL || node->sub[1] != NULL; @@ -494,7 +495,7 @@ static void __rbt_walk_tree(const struct HXrbtree_node *node, * @buf: buffer for texitree representation * @size: size for @buf */ -static void rbt_walk_tree(const struct HXrbtree_node *node, +static void rbt_walk_tree(const struct HXrbnode *node, char *buf, size_t size) { *buf = '\0'; @@ -517,7 +518,7 @@ static struct HXmap *rbt_new_perfect_tree(unsigned int height, return tree; } -static unsigned int rbt_tree_height(const struct HXrbtree_node *node) +static unsigned int rbt_tree_height(const struct HXrbnode *node) { unsigned int a = 1, b = 1; if (node->sub[0] != NULL) @@ -593,7 +594,7 @@ static void tmap_rbt_test_1(void) * * Verify that there are no red nodes with red children. */ -static bool rbt_no_2red_children(const struct HXrbtree_node *node) +static bool rbt_no_2red_children(const struct HXrbnode *node) { if (node->sub[RBT_LEFT] != NULL) { if (node->color == RBT_RED && @@ -618,7 +619,7 @@ static bool rbt_no_2red_children(const struct HXrbtree_node *node) * * Returns the black height, or -1 if the black height is not consistent. */ -static int rbt_black_height(const struct HXrbtree_node *node) +static int rbt_black_height(const struct HXrbnode *node) { int lh = 0, rh = 0; @@ -637,7 +638,7 @@ static int rbt_black_height(const struct HXrbtree_node *node) return rh + (node->color == RBT_BLACK); } -static bool rbt_verify_tree(const struct HXrbtree_node *root) +static bool rbt_verify_tree(const struct HXrbnode *root) { /* Root is black */ if (root->color != RBT_BLACK) { |