diff options
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 ; } |