From 08ce54211ce4b8d6092321ca1b28773a680ddc45 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 16:05:46 +0200 Subject: Added missing function prototype signatures. Corrected socket_broadcast name to socket_broadcast4 in socket_if.h. Added const to fmt_str. --- src/alloc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/alloc.c') diff --git a/src/alloc.c b/src/alloc.c index cee09ac..7e4ccb4 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -17,7 +17,7 @@ static aligned realspace[SPACE / ALIGNMENT]; #define space ((char *)realspace) static unsigned int avail = SPACE; /* multiple of ALIGNMENT; 0<=avail<=SPACE */ -/*@null@*/ /*@out@*/ char *alloc(unsigned int n) +void *alloc(unsigned int n) { char *x; @@ -38,15 +38,16 @@ static unsigned int avail = SPACE; /* multiple of ALIGNMENT; 0<=avail<=SPACE */ return x; } -void alloc_free(char *x) +void alloc_free(void *x) { if (x >= space) if (x < space + SPACE) return; /* XXX: assuming that pointers are flat */ free(x); } -int alloc_re(char **x, unsigned int m, unsigned int n) +int alloc_re(void *a, unsigned int m, unsigned int n) { + char **x = a; char *y; y = alloc(n); -- cgit v1.2.3