diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-15 17:40:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-15 17:40:40 +0000 |
commit | a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (patch) | |
tree | f49a8382b9999b5aa00c0885eedd5c5c3a233e55 /src/libstddjb/alloc.c | |
parent | 00c9cb1b22cc17c4db573e0e613a5f116ff0092e (diff) | |
download | skalibs-a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3.tar.xz |
add arc4random_addrandom sysdep; next batch of types changes.
The library isn't supposed to be functional yet: there are
still a lot of type mismatches.
Diffstat (limited to 'src/libstddjb/alloc.c')
-rw-r--r-- | src/libstddjb/alloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstddjb/alloc.c b/src/libstddjb/alloc.c index 31e3e05..bf291f0 100644 --- a/src/libstddjb/alloc.c +++ b/src/libstddjb/alloc.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <skalibs/sysdeps.h> @@ -13,7 +14,7 @@ # define PLM(...) (bprintf(buffer_2, "%s: debug_alloc: ", PROG), bprintf(buffer_2, __VA_ARGS__), buffer_putflush(buffer_2, "\n", 1)) #endif -aligned_char *alloc (unsigned int n) +aligned_char *alloc (size_t n) { register aligned_char *p = n ? (aligned_char *)malloc(n) : (aligned_char *)alloc_0 ; #ifdef DEBUG_ALLOC @@ -37,7 +38,7 @@ void alloc_free (void *p) errno = e ; } -int alloc_realloc (aligned_char **x, unsigned int n) +int alloc_realloc (aligned_char **x, size_t n) { aligned_char *y = n ? (aligned_char *)realloc(*x, n) : (free(*x), alloc_0) ; #ifdef DEBUG_ALLOC |