X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/77e3814f0c0e3dea4d0032e25666f77e6f83bfff..a8bfdad49d7620b77f20ab86a8e20ac0229e392e:/hack/alloc.c diff --git a/hack/alloc.c b/hack/alloc.c index d94bf8b9..68713b21 100644 --- a/hack/alloc.c +++ b/hack/alloc.c @@ -1,4 +1,13 @@ -/* alloc.c - version 1.0.2 */ +/* $NetBSD: alloc.c,v 1.4 1997/10/19 16:56:47 christos Exp $ */ +#include +#ifndef lint +__RCSID("$NetBSD: alloc.c,v 1.4 1997/10/19 16:56:47 christos Exp $"); +#endif /* not lint */ + +#include +#include "hack.h" +#include "extern.h" + #ifdef LINT /* @@ -8,40 +17,39 @@ "ftell defined (in ) but never used" from lint */ -#include long * -alloc(n) unsigned n; { -long dummy = ftell(stderr); - if(n) dummy = 0; /* make sure arg is used */ - return(&dummy); +alloc(n) + unsigned n; +{ + long dummy = ftell(stderr); + if (n) + dummy = 0; /* make sure arg is used */ + return (&dummy); } #else -extern char *malloc(); -extern char *realloc(); - long * alloc(lth) -register unsigned lth; + unsigned lth; { - register char *ptr; + char *ptr; - if(!(ptr = malloc(lth))) + if (!(ptr = malloc(lth))) panic("Cannot get %d bytes", lth); - return((long *) ptr); + return ((long *) ptr); } long * -enlarge(ptr,lth) -register char *ptr; -register unsigned lth; +enlarge(ptr, lth) + char *ptr; + unsigned lth; { - register char *nptr; + char *nptr; - if(!(nptr = realloc(ptr,lth))) + if (!(nptr = realloc(ptr, lth))) panic("Cannot reallocate %d bytes", lth); - return((long *) nptr); + return ((long *) nptr); } -#endif LINT +#endif /* LINT */