diff options
Diffstat (limited to 'zix')
-rw-r--r-- | zix/ampatree.c | 6 | ||||
-rw-r--r-- | zix/patree.c | 8 | ||||
-rw-r--r-- | zix/trie.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/zix/ampatree.c b/zix/ampatree.c index 58d1332..55b79c9 100644 --- a/zix/ampatree.c +++ b/zix/ampatree.c @@ -98,7 +98,7 @@ zix_ampatree_node_size(n_edges_t n_children) } ZIX_PRIVATE ZixAMPatreeNode* -realloc_node(ZixAMPatreeNode* n, int n_children) +realloc_node(ZixAMPatreeNode* n, n_edges_t n_children) { return (ZixAMPatreeNode*)realloc(n, zix_ampatree_node_size(n_children)); } @@ -171,7 +171,7 @@ patree_add_edge(ZixAMPatreeNode** n_ptr, child->str = str; child->n_children = 0; - n = (ZixAMPatreeNode*)realloc_node(n, n->n_children + 1); + n = (ZixAMPatreeNode*)realloc_node(n, n->n_children + 1u); ZixAMPatreeNode* m = (ZixAMPatreeNode*)malloc(zix_ampatree_node_size(n->n_children + 1)); m->label_first = n->label_first; m->label_last = n->label_last; @@ -292,7 +292,7 @@ zix_ampatree_find(const ZixAMPatree* t, const char* const str, const char** matc /* Prefix compare search string and label */ const uint8_t* const l = child->label_first; const size_t len = child->label_last - l + 1; - const int change_index = zix_trie_change_index(p, l, len); + const size_t change_index = zix_trie_change_index(p, l, len); p += change_index; diff --git a/zix/patree.c b/zix/patree.c index f984005..54a5637 100644 --- a/zix/patree.c +++ b/zix/patree.c @@ -48,8 +48,8 @@ struct _ZixPatree { }; /** Round `size` up to the next multiple of the word size. */ -ZIX_PRIVATE uint32_t -zix_patree_pad(uint32_t size) +ZIX_PRIVATE n_edges_t +zix_patree_pad(n_edges_t size) { return (size + sizeof(void*) - 1) & (~(sizeof(void*) - 1)); } @@ -112,7 +112,7 @@ zix_patree_node_size(n_edges_t n_children) } ZIX_PRIVATE ZixPatreeNode* -realloc_node(ZixPatreeNode* n, int n_children) +realloc_node(ZixPatreeNode* n, n_edges_t n_children) { return (ZixPatreeNode*)realloc(n, zix_patree_node_size(n_children)); } @@ -186,7 +186,7 @@ patree_add_edge(ZixPatreeNode** n_ptr, child->str = str; child->n_children = 0; - n = realloc_node(n, n->n_children + 1); + n = realloc_node(n, n->n_children + 1u); #ifdef ZIX_TRIE_LINEAR_SEARCH memmove(n->children + zix_patree_pad(n->n_children + 1), n->children + zix_patree_pad(n->n_children), @@ -47,8 +47,8 @@ struct _ZixTrie { }; /** Round `size` up to the next multiple of the word size. */ -ZIX_PRIVATE uint32_t -zix_trie_pad(uint32_t size) +ZIX_PRIVATE n_edges_t +zix_trie_pad(n_edges_t size) { return (size + sizeof(void*) - 1) & (~(sizeof(void*) - 1)); } |