diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libdatastruct/avlnode_delete.c | 10 | ||||
-rw-r--r-- | src/libdatastruct/avlnode_insertnode.c | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/libdatastruct/avlnode_delete.c b/src/libdatastruct/avlnode_delete.c index e75e0cc..8c68d39 100644 --- a/src/libdatastruct/avlnode_delete.c +++ b/src/libdatastruct/avlnode_delete.c @@ -1,15 +1,17 @@ /* ISC license. */ +#include <stdint.h> + #include <skalibs/avlnode.h> #include "avlnode-internal.h" uint32_t avlnode_delete (avlnode *s, uint32_t max, uint32_t *root, void const *k, dtok_func_ref dtok, cmp_func_ref f, void *p) { - uint32_t stack[AVLNODE_MAXDEPTH] ; - int spin[AVLNODE_MAXDEPTH] ; - unsigned int sp = 0 ; uint32_t r = *root ; uint32_t itodel ; + uint32_t stack[AVLNODE_MAXDEPTH] ; + uint8_t spin[AVLNODE_MAXDEPTH] ; + uint8_t sp = 0 ; for (; r < max ; sp++) { @@ -24,7 +26,7 @@ uint32_t avlnode_delete (avlnode *s, uint32_t max, uint32_t *root, void const *k if ((s[r].child[0] < max) || (s[r].child[1] < max)) { - int subspin = s[r].child[1] < max ; + uint8_t subspin = s[r].child[1] < max ; stack[sp] = r ; spin[sp++] = subspin ; r = s[r].child[subspin] ; diff --git a/src/libdatastruct/avlnode_insertnode.c b/src/libdatastruct/avlnode_insertnode.c index cfeb6d4..294b109 100644 --- a/src/libdatastruct/avlnode_insertnode.c +++ b/src/libdatastruct/avlnode_insertnode.c @@ -1,13 +1,15 @@ /* ISC license. */ +#include <stdint.h> + #include <skalibs/avlnode.h> #include "avlnode-internal.h" uint32_t avlnode_insertnode (avlnode *s, uint32_t max, uint32_t r, uint32_t i, dtok_func_ref dtok, cmp_func_ref f, void *p) { uint32_t stack[AVLNODE_MAXDEPTH] ; - int spin[AVLNODE_MAXDEPTH] ; - unsigned int sp = 0 ; + uint8_t spin[AVLNODE_MAXDEPTH] ; + uint8_t sp = 0 ; { void const *k = (*dtok)(s[i].data, p) ; |