about summary refs log tree commit diff
path: root/src/libdatastruct/gensetdyn_ready.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/gensetdyn_ready.c
parent49d8fa1058aaf23c29e074b2314492ae40d2f557 (diff)
downloadskalibs-a5079576ae9007fb1ca7ebcc911b5fb035cd2d06.tar.gz
skalibs-a5079576ae9007fb1ca7ebcc911b5fb035cd2d06.tar.xz
skalibs-a5079576ae9007fb1ca7ebcc911b5fb035cd2d06.zip
Types change: switch libdatastruct to uint32_t
 Still needs to be reviewed.
Diffstat (limited to 'src/libdatastruct/gensetdyn_ready.c')
-rw-r--r--src/libdatastruct/gensetdyn_ready.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libdatastruct/gensetdyn_ready.c b/src/libdatastruct/gensetdyn_ready.c
index 8418e1a..0bdcd0b 100644
--- a/src/libdatastruct/gensetdyn_ready.c
+++ b/src/libdatastruct/gensetdyn_ready.c
@@ -1,25 +1,26 @@
 /* ISC license. */
 
+#include <stdint.h>
 #include <skalibs/stralloc.h>
 #include <skalibs/genalloc.h>
 #include <skalibs/gensetdyn.h>
 
-int gensetdyn_ready (gensetdyn *g, unsigned int n)
+int gensetdyn_ready (gensetdyn *g, uint32_t n)
 {
   int wasnull = !g->storage.s ;
-  unsigned int i = g->storage.len ;
+  uint32_t i = g->storage.len ;
   if (n < i) return 1 ;
   n += g->base + (n * g->fracnum) / g->fracden ;
   if (!stralloc_ready_tuned(&g->storage, n * g->esize, 0, 0, 1)) return 0 ;
-  if (!genalloc_ready(unsigned int, &g->freelist, n))
+  if (!genalloc_ready(uint32_t, &g->freelist, n))
   {
     if (wasnull) stralloc_free(&g->storage) ;
     return 0 ;
   }
   for (; i < n ; i++)
   {
-    unsigned int j = n - 1 - i + g->storage.len ;
-    genalloc_catb(unsigned int, &g->freelist, &j, 1) ;
+    uint32_t j = n - 1 - i + g->storage.len ;
+    genalloc_catb(uint32_t, &g->freelist, &j, 1) ;
   }
   g->storage.len = n ;
   return 1 ;