mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-19 19:59:43 +00:00
Eliminate warnings from function prototype mismatches. Include
stdlib.h and strings.h where needed to get system/compiler definitions of malloc, bcopy, and bzero instead of relying on 20-year-old wrong definitions in the code. The snobol interpreter itself is chock full of pointer to int type punning and is likely to fail in hard-to-debug ways on non-VAX-like architectures.
This commit is contained in:
parent
3ae32465cd
commit
2ce916c337
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=178154
18
lang/snobol/files/patch-dynamic.c
Normal file
18
lang/snobol/files/patch-dynamic.c
Normal file
@ -0,0 +1,18 @@
|
||||
--- lib/generic/dynamic.c.orig Tue Nov 28 00:09:54 2006
|
||||
+++ lib/generic/dynamic.c Tue Nov 28 00:10:30 2006
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
/* allocate dynamic region */
|
||||
|
||||
-char *malloc();
|
||||
+#include <stdlib.h>
|
||||
|
||||
char *
|
||||
dynamic( size )
|
||||
int size;
|
||||
{
|
||||
- return malloc(size);
|
||||
+ return (char *) malloc(size);
|
||||
}
|
||||
|
||||
void
|
18
lang/snobol/files/patch-init.c
Normal file
18
lang/snobol/files/patch-init.c
Normal file
@ -0,0 +1,18 @@
|
||||
--- lib/init.c.orig Tue Nov 28 00:05:18 2006
|
||||
+++ lib/init.c Tue Nov 28 00:06:02 2006
|
||||
@@ -1,6 +1,7 @@
|
||||
/* $Id: init.c,v 1.31 1997/07/07 03:40:34 phil Exp $ */
|
||||
|
||||
#include <stdio.h> /* for usage! */
|
||||
+#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "h.h"
|
||||
@@ -17,7 +18,6 @@
|
||||
#endif
|
||||
|
||||
extern char *dynamic();
|
||||
-extern char *malloc();
|
||||
|
||||
#define NDYNAMIC 25000 /* default dynamic region size */
|
||||
|
29
lang/snobol/files/patch-macros.h
Normal file
29
lang/snobol/files/patch-macros.h
Normal file
@ -0,0 +1,29 @@
|
||||
--- include/macros.h.orig Fri Jul 25 14:52:56 1997
|
||||
+++ include/macros.h Tue Nov 28 00:26:54 2006
|
||||
@@ -4,6 +4,8 @@
|
||||
* macros for data access and implementation of SIL ops
|
||||
*/
|
||||
|
||||
+#include <strings.h>
|
||||
+
|
||||
/* descriptor at address x */
|
||||
#define D(x) (*(struct descr *)(x))
|
||||
|
||||
@@ -32,7 +34,7 @@
|
||||
#endif /* DCMP_BYTES not defined */
|
||||
|
||||
/* clear B+1 descriptor block */
|
||||
-#define ZERBLK(A,B) bzero(A, (B)+DESCR)
|
||||
+#define ZERBLK(A,B) bzero((void *)A, (B)+DESCR)
|
||||
|
||||
/*
|
||||
* copy descriptor block
|
||||
@@ -40,7 +42,7 @@
|
||||
* NOTE: may overlap!!
|
||||
* (bcopy deals with this but some memcpy's do not)!!!
|
||||
*/
|
||||
-#define MOVBLK(A,B,C) bcopy( (B)+DESCR, (A)+DESCR, (C) )
|
||||
+#define MOVBLK(A,B,C) bcopy( ((char *)B)+DESCR, ((char *)A)+DESCR, (C) )
|
||||
|
||||
/****************
|
||||
* string specifiers (qualifiers)
|
19
lang/snobol/files/patch-ordvst.c
Normal file
19
lang/snobol/files/patch-ordvst.c
Normal file
@ -0,0 +1,19 @@
|
||||
--- lib/ordvst.c.orig Tue Nov 28 00:06:26 2006
|
||||
+++ lib/ordvst.c Tue Nov 28 00:06:50 2006
|
||||
@@ -14,14 +14,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
#include "h.h"
|
||||
#include "snotypes.h"
|
||||
#include "macros.h"
|
||||
#include "equ.h"
|
||||
#include "res.h"
|
||||
#include "data.h"
|
||||
-
|
||||
-char *malloc();
|
||||
|
||||
#ifdef ORDVST_DEBUG
|
||||
/* PLB: dump a descriptor */
|
18
lang/snobol/files/patch-retstring.c
Normal file
18
lang/snobol/files/patch-retstring.c
Normal file
@ -0,0 +1,18 @@
|
||||
--- lib/snolib/retstring.c.orig Sun Jul 6 20:48:22 1997
|
||||
+++ lib/snolib/retstring.c Tue Nov 28 00:12:09 2006
|
||||
@@ -1,5 +1,7 @@
|
||||
/* $Id: retstring.c,v 1.3 1997/07/07 03:48:18 phil Exp $ */
|
||||
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
#include "h.h"
|
||||
#include "equ.h" /* BCDFLD, etc */
|
||||
#include "snotypes.h" /* DESCR, etc */
|
||||
@@ -14,7 +16,6 @@
|
||||
static struct spec sp[1];
|
||||
static char *retbuf;
|
||||
static int retbuflen;
|
||||
- extern char *malloc();
|
||||
|
||||
if (len > retbuflen) {
|
||||
if (retbuf)
|
Loading…
Reference in New Issue
Block a user