summaryrefslogtreecommitdiff
path: root/src/libdatastruct/avlnode_iter.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-22 10:03:15 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-22 10:03:15 +0000
commita5079576ae9007fb1ca7ebcc911b5fb035cd2d06 (patch)
tree70f4014dd37d780dfb45182d26092cb1998d4eec /src/libdatastruct/avlnode_iter.c
parent49d8fa1058aaf23c29e074b2314492ae40d2f557 (diff)
downloadskalibs-a5079576ae9007fb1ca7ebcc911b5fb035cd2d06.tar.xz
Types change: switch libdatastruct to uint32_t
Still needs to be reviewed.
Diffstat (limited to 'src/libdatastruct/avlnode_iter.c')
-rw-r--r--src/libdatastruct/avlnode_iter.c11
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) ;