summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 16:05:46 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 16:05:46 +0200
commit08ce54211ce4b8d6092321ca1b28773a680ddc45 (patch)
tree9cf7eb2702a408743d59e207e24f8fb1e5ada31d /src/alloc.c
parent795ffc5e62e8ba383575dbcd9943a580d4bd3358 (diff)
Added missing function prototype signatures.
Corrected socket_broadcast name to socket_broadcast4 in socket_if.h. Added const to fmt_str.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 4 insertions, 3 deletions
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);