[patch] hack: remove #ifdef LINT BS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] hack: remove #ifdef LINT BS

Alexey Dobriyan-2
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);

Reply | Threaded
Open this post in threaded view
|

Re: [patch] hack: remove #ifdef LINT BS

Ted Unangst-2
On 3/14/06, Alexey Dobriyan <[hidden email]> wrote:
> -long *
> -alloc(unsigned int n)
> -{
> -       long dummy = ftell(stderr);
> -
> -       if(n) dummy = 0;        /* make sure arg is used */
> -       return(&dummy);
> -}

that's disgusting.