summaryrefslogtreecommitdiff
path: root/src/libdatastruct
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-31 12:21:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-31 12:21:48 +0000
commita28a432f7823cf2173d6f1e54c99438503d3174f (patch)
treec278f7343cd2cd40f3071a25c10c5da01484a0bc /src/libdatastruct
parent3c5f5aea891c85dbdfc4d287d7ebf2bb813d6405 (diff)
downloadskalibs-a28a432f7823cf2173d6f1e54c99438503d3174f.tar.xz
Make cbuffer_?peek take a const; make *_init not leak when misused
Diffstat (limited to 'src/libdatastruct')
-rw-r--r--src/libdatastruct/gensetdyn_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libdatastruct/gensetdyn_init.c b/src/libdatastruct/gensetdyn_init.c
index 744c63f..bdf4e09 100644
--- a/src/libdatastruct/gensetdyn_init.c
+++ b/src/libdatastruct/gensetdyn_init.c
@@ -1,13 +1,13 @@
/* ISC license. */
-#include <skalibs/stralloc.h>
+#include <stdint.h>
#include <skalibs/genalloc.h>
#include <skalibs/gensetdyn.h>
void gensetdyn_init (gensetdyn *g, uint32_t esize, uint32_t base, uint32_t fracnum, uint32_t fracden)
{
- g->storage = stralloc_zero ;
- g->freelist = genalloc_zero ;
+ g->storage.len = 0 ;
+ genalloc_setlen(uint32_t, &g->freelist, 0) ;
g->esize = esize ;
g->base = base ;
g->fracnum = fracnum ;