diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-22 10:03:15 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-22 10:03:15 +0000 |
commit | a5079576ae9007fb1ca7ebcc911b5fb035cd2d06 (patch) | |
tree | 70f4014dd37d780dfb45182d26092cb1998d4eec /src/libdatastruct/gensetdyn_new.c | |
parent | 49d8fa1058aaf23c29e074b2314492ae40d2f557 (diff) | |
download | skalibs-a5079576ae9007fb1ca7ebcc911b5fb035cd2d06.tar.xz |
Types change: switch libdatastruct to uint32_t
Still needs to be reviewed.
Diffstat (limited to 'src/libdatastruct/gensetdyn_new.c')
-rw-r--r-- | src/libdatastruct/gensetdyn_new.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libdatastruct/gensetdyn_new.c b/src/libdatastruct/gensetdyn_new.c index 5e199b3..bf744d5 100644 --- a/src/libdatastruct/gensetdyn_new.c +++ b/src/libdatastruct/gensetdyn_new.c @@ -1,14 +1,16 @@ /* ISC license. */ +#include <sys/types.h> +#include <stdint.h> #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> -int gensetdyn_new (gensetdyn *g, unsigned int *i) +int gensetdyn_new (gensetdyn *g, uint32_t *i) { - register unsigned int n ; - if (!genalloc_len(unsigned int, &g->freelist) && !gensetdyn_readyplus(g, 1)) return 0 ; - n = genalloc_len(unsigned int, &g->freelist) ; - *i = genalloc_s(unsigned int, &g->freelist)[n-1] ; - genalloc_setlen(unsigned int, &g->freelist, n-1) ; + size_t n ; + if (!genalloc_len(uint32_t, &g->freelist) && !gensetdyn_readyplus(g, 1)) return 0 ; + n = genalloc_len(uint32_t, &g->freelist) ; + *i = genalloc_s(uint32_t, &g->freelist)[n-1] ; + genalloc_setlen(uint32_t, &g->freelist, n-1) ; return 1 ; } |