diff options
author | wes <wes@FreeBSD.org> | 2006-11-28 16:36:15 +0800 |
---|---|---|
committer | wes <wes@FreeBSD.org> | 2006-11-28 16:36:15 +0800 |
commit | 68d3522af03e2ac142ab854bd9a4f2a33b9890ab (patch) | |
tree | 4c1da956641722770e82336a24305662c3249aa8 /lang | |
parent | f1beb6bf01509f5db95882aff6cc56fcfda096f5 (diff) | |
download | freebsd-ports-gnome-68d3522af03e2ac142ab854bd9a4f2a33b9890ab.tar.gz freebsd-ports-gnome-68d3522af03e2ac142ab854bd9a4f2a33b9890ab.tar.zst freebsd-ports-gnome-68d3522af03e2ac142ab854bd9a4f2a33b9890ab.zip |
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.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/snobol/files/patch-dynamic.c | 18 | ||||
-rw-r--r-- | lang/snobol/files/patch-init.c | 18 | ||||
-rw-r--r-- | lang/snobol/files/patch-macros.h | 29 | ||||
-rw-r--r-- | lang/snobol/files/patch-ordvst.c | 19 | ||||
-rw-r--r-- | lang/snobol/files/patch-retstring.c | 18 |
5 files changed, 102 insertions, 0 deletions
diff --git a/lang/snobol/files/patch-dynamic.c b/lang/snobol/files/patch-dynamic.c new file mode 100644 index 000000000000..1330c50acb26 --- /dev/null +++ b/lang/snobol/files/patch-dynamic.c @@ -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 diff --git a/lang/snobol/files/patch-init.c b/lang/snobol/files/patch-init.c new file mode 100644 index 000000000000..d62a111a2dab --- /dev/null +++ b/lang/snobol/files/patch-init.c @@ -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 */ + diff --git a/lang/snobol/files/patch-macros.h b/lang/snobol/files/patch-macros.h new file mode 100644 index 000000000000..adca387b84d1 --- /dev/null +++ b/lang/snobol/files/patch-macros.h @@ -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) diff --git a/lang/snobol/files/patch-ordvst.c b/lang/snobol/files/patch-ordvst.c new file mode 100644 index 000000000000..0d6adf700894 --- /dev/null +++ b/lang/snobol/files/patch-ordvst.c @@ -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 */ diff --git a/lang/snobol/files/patch-retstring.c b/lang/snobol/files/patch-retstring.c new file mode 100644 index 000000000000..f0c79869f264 --- /dev/null +++ b/lang/snobol/files/patch-retstring.c @@ -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) |