[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] hack: remove #ifdef LINT BS
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: [patch] hack: remove #ifdef LINT BS
- From: Alexey Dobriyan <adobriyan_(_at_)_gmail_(_dot_)_com>
- Date: Tue, 14 Mar 2006 20:24:47 +0300
Ick.
Index: games/hack/alloc.c
===================================================================
RCS file: /cvs/src/games/hack/alloc.c,v
retrieving revision 1.5
diff -u -p -r1.5 alloc.c
--- games/hack/alloc.c 2003/05/19 06:30:56 1.5
+++ games/hack/alloc.c 2006/03/14 16:38:51
@@ -65,38 +65,15 @@
static const char rcsid[] = "$OpenBSD: alloc.c,v 1.5 2003/05/19 06:30:56 pjanzen Exp $";
#endif /* not lint */
-#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
-*/
-#include <stdio.h>
-long *
-alloc(unsigned int n)
-{
- long dummy = ftell(stderr);
-
- if(n) dummy = 0; /* make sure arg is used */
- return(&dummy);
-}
-
-#else
-
#include <stdlib.h>
#include "hack.h"
-long *
+void *
alloc(unsigned int lth)
{
- char *ptr;
+ void *ptr;
if(!(ptr = malloc(lth)))
panic("Cannot get %d bytes", lth);
- return((long *) ptr);
+ return(ptr);
}
-
-#endif /* LINT */
Index: games/hack/hack.h
===================================================================
RCS file: /cvs/src/games/hack/hack.h,v
retrieving revision 1.8
diff -u -p -r1.8 hack.h
--- games/hack/hack.h 2003/05/19 06:30:56 1.8
+++ games/hack/hack.h 2006/03/14 16:38:52
@@ -214,7 +214,7 @@ extern char lock[PL_NSIZ+4];
/* alloc.c */
-long *alloc(unsigned int);
+void *alloc(unsigned int);
/* hack.apply.c */
int doapply(void);
Visit your host, monkey.org