From 84e7d0704483ce39bbdeacd5e676168db6fa664f Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 19 Oct 1997 16:56:41 +0000 Subject: WARNsify... --- hack/alloc.c | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'hack/alloc.c') diff --git a/hack/alloc.c b/hack/alloc.c index f64cc195..68713b21 100644 --- a/hack/alloc.c +++ b/hack/alloc.c @@ -1,6 +1,12 @@ +/* $NetBSD: alloc.c,v 1.4 1997/10/19 16:56:47 christos Exp $ */ +#include #ifndef lint -static char rcsid[] = "$NetBSD: alloc.c,v 1.3 1995/03/23 08:29:14 cgd Exp $"; -#endif /* not 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 @@ -11,40 +17,39 @@ static char rcsid[] = "$NetBSD: alloc.c,v 1.3 1995/03/23 08:29:14 cgd Exp $"; "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 */ -- cgit v1.2.3-56-ge451