diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-09-06 13:41:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-09-06 13:41:52 +0200 |
commit | d45dd31e35190cf08b1e716e7c3bd1468ddd5d88 (patch) | |
tree | 362ed3bf52fa67d15e35fba042aafe4e2a938065 /src/tc-map.c | |
parent | bd82d030011cd8b9655e5ded6b6df9343b42a6bd (diff) |
New upstream version 3.23upstream/3.23
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) { |