diff options
Diffstat (limited to 'src/libdatastruct/avlnode_iter.c')
-rw-r--r-- | src/libdatastruct/avlnode_iter.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libdatastruct/avlnode_iter.c b/src/libdatastruct/avlnode_iter.c index e1b17de..47813f2 100644 --- a/src/libdatastruct/avlnode_iter.c +++ b/src/libdatastruct/avlnode_iter.c @@ -1,21 +1,22 @@ /* ISC license. */ +#include <stdint.h> #include <skalibs/avlnode.h> struct avlnode_iter_s { avlnode const *s ; - unsigned int max ; - unsigned int cut ; + uint32_t max ; + uint32_t cut ; avliterfunc_t_ref f ; void *p ; } ; -static unsigned int avlnode_iter_rec (struct avlnode_iter_s const *blah, unsigned int r, unsigned int h) +static uint32_t avlnode_iter_rec (struct avlnode_iter_s const *blah, uint32_t r, unsigned int h) { if (r >= blah->max) return blah->max ; { - unsigned int res = avlnode_iter_rec(blah, blah->s[r].child[0], h+1) ; + uint32_t res = avlnode_iter_rec(blah, blah->s[r].child[0], h+1) ; if (res != blah->max) return res ; } if (r == blah->cut) return blah->max ; @@ -23,7 +24,7 @@ static unsigned int avlnode_iter_rec (struct avlnode_iter_s const *blah, unsigne return avlnode_iter_rec(blah, blah->s[r].child[1], h+1) ; } -unsigned int avlnode_iter_nocancel (avlnode *s, unsigned int max, unsigned int cut, unsigned int r, avliterfunc_t_ref f, void *p) +uint32_t avlnode_iter_nocancel (avlnode *s, uint32_t max, uint32_t cut, uint32_t r, avliterfunc_t_ref f, void *p) { struct avlnode_iter_s blah = { .s = s, .max = max, .cut = cut, .f = f, .p = p } ; return avlnode_iter_rec(&blah, r, 0) ; |