Module Name: src Committed By: wiz Date: Sun Jan 17 22:55:21 UTC 2010
Modified Files: src/games/hack: alloc.c Log Message: Simplify alloc() to avoid ifdef(LINT) workaround. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/games/hack/alloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/hack/alloc.c diff -u src/games/hack/alloc.c:1.7 src/games/hack/alloc.c:1.8 --- src/games/hack/alloc.c:1.7 Wed Aug 12 07:28:40 2009 +++ src/games/hack/alloc.c Sun Jan 17 22:55:20 2010 @@ -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 <sys/cdefs.h> #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 <stdlib.h> #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 <stdio.h>) 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 @@ return ((long *) nptr); } #endif - -#endif /* LINT */