From bd9d61269b77d4cdaa3143905aa1621c6d7a4ff6 Mon Sep 17 00:00:00 2001 From: wiz Date: Sun, 17 Jan 2010 22:55:20 +0000 Subject: Simplify alloc() to avoid ifdef(LINT) workaround. --- hack/alloc.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'hack') diff --git a/hack/alloc.c b/hack/alloc.c index 9a972a13..ed2f5630 100644 --- a/hack/alloc.c +++ b/hack/alloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */ +/* $NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,41 +63,21 @@ #include #ifndef lint -__RCSID("$NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $"); +__RCSID("$NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $"); #endif /* not lint */ #include #include "hack.h" #include "extern.h" -#ifdef LINT - -/* - a ridiculous definition, suppressing - "possible pointer alignment problem" for (long *) malloc() - "enlarg defined but never used" - "ftell defined (in ) but never used" - from lint -*/ -long * -alloc(unsigned n) -{ - long dummy = ftell(stderr); - if (n) - dummy = 0; /* make sure arg is used */ - return (&dummy); -} - -#else - long * alloc(unsigned lth) { - char *ptr; + long *ptr; if (!(ptr = malloc(lth))) panic("Cannot get %d bytes", lth); - return ((long *) ptr); + return (ptr); } #if 0 /* unused */ @@ -111,5 +91,3 @@ enlarge(char *ptr, unsigned lth) return ((long *) nptr); } #endif - -#endif /* LINT */ -- cgit v1.2.3-56-ge451