summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
Diffstat (limited to 'x2p')
-rw-r--r--x2p/a2p.h24
-rw-r--r--x2p/a2py.c5
-rw-r--r--x2p/handy.h4
-rw-r--r--x2p/util.c13
-rw-r--r--x2p/walk.c2
5 files changed, 27 insertions, 21 deletions
diff --git a/x2p/a2p.h b/x2p/a2p.h
index 54a918c0b5..27fed267a1 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -11,13 +11,6 @@
#define VOIDUSED 1
#include "../config.h"
-#ifndef HAS_BCOPY
-# define bcopy(s1,s2,l) memcpy(s2,s1,l)
-#endif
-#ifndef HAS_BZERO
-# define bzero(s,l) memset(s,0,l)
-#endif
-
/* Use all the "standard" definitions? */
#if defined(STANDARD_C) && defined(I_STDLIB)
# include <stdlib.h>
@@ -42,6 +35,13 @@
# include <strings.h>
#endif
+#ifndef HAS_BCOPY
+# define bcopy(s1,s2,l) memcpy(s2,s1,l)
+#endif
+#ifndef HAS_BZERO
+# define bzero(s,l) memset(s,0,l)
+#endif
+
#if !defined(HAS_STRCHR) && defined(HAS_INDEX) && !defined(strchr)
#define strchr index
#define strrchr rindex
@@ -273,10 +273,10 @@ EXT STR *Str;
/* Prototypes for things in a2p.c */
int aryrefarg _(( int arg ));
int bl _(( int arg, int maybe ));
-int dump _(( int branch ));
+void dump _(( int branch ));
int fixfargs _(( int name, int arg, int prevargs ));
int fixrargs _(( char *name, int arg, int prevargs ));
-int fixup _(( STR *str ));
+void fixup _(( STR *str ));
int numary _(( int arg ));
int oper0 _(( int type ));
int oper1 _(( int type, int arg1 ));
@@ -284,13 +284,13 @@ int oper2 _(( int type, int arg1, int arg2 ));
int oper3 _(( int type, int arg1, int arg2, int arg3 ));
int oper4 _(( int type, int arg1, int arg2, int arg3, int arg4 ));
int oper5 _(( int type, int arg1, int arg2, int arg3, int arg4, int arg5 ));
-int putlines _(( STR *str ));
-int putone _(( void ));
+void putlines _(( STR *str ));
+void putone _(( void ));
int rememberargs _(( int arg ));
char * scannum _(( char *s ));
char * scanpat _(( char *s ));
int string _(( char *ptr, int len ));
-int yyerror _(( char *s ));
+void yyerror _(( char *s ));
int yylex _(( void ));
EXT int line INIT(0);
diff --git a/x2p/a2py.c b/x2p/a2py.c
index f1bc18ebe5..f404c1a8fb 100644
--- a/x2p/a2py.c
+++ b/x2p/a2py.c
@@ -827,6 +827,7 @@ register char *s;
return s;
}
+void
yyerror(s)
char *s;
{
@@ -997,6 +998,7 @@ int arg5;
int depth = 0;
+void
dump(branch)
int branch;
{
@@ -1038,6 +1040,7 @@ int maybe;
return arg;
}
+void
fixup(str)
STR *str;
{
@@ -1063,6 +1066,7 @@ STR *str;
}
}
+void
putlines(str)
STR *str;
{
@@ -1139,6 +1143,7 @@ STR *str;
}
}
+void
putone()
{
register char *t;
diff --git a/x2p/handy.h b/x2p/handy.h
index 160d83927c..0049a1108b 100644
--- a/x2p/handy.h
+++ b/x2p/handy.h
@@ -114,8 +114,8 @@ typedef U16 line_t;
#ifndef lint
#ifndef LEAKTEST
#ifndef safemalloc
-char *safemalloc _((MEM_SIZE));
-char *saferealloc _((char *, MEM_SIZE));
+Malloc_t safemalloc _((MEM_SIZE));
+Malloc_t saferealloc _((char *, MEM_SIZE));
void safefree _((char *));
#endif
#ifndef MSDOS
diff --git a/x2p/util.c b/x2p/util.c
index 225812add1..a7fdaea35d 100644
--- a/x2p/util.c
+++ b/x2p/util.c
@@ -20,14 +20,14 @@ static char nomem[] = "Out of memory!\n";
/* paranoid version of malloc */
-char *
+Malloc_t
safemalloc(size)
MEM_SIZE size;
{
char *ptr;
- char *malloc();
+ Malloc_t malloc();
- ptr = malloc(size?size:1); /* malloc(0) is NASTY on our system */
+ ptr = (char *) malloc(size?size:1); /* malloc(0) is NASTY on our system */
#ifdef DEBUGGING
if (debug & 128)
fprintf(stderr,"0x%x: (%05d) malloc %d bytes\n",ptr,an++,size);
@@ -43,15 +43,16 @@ MEM_SIZE size;
/* paranoid version of realloc */
-char *
+Malloc_t
saferealloc(where,size)
char *where;
MEM_SIZE size;
{
char *ptr;
- char *realloc();
+ Malloc_t realloc();
- ptr = realloc(where,size?size:1); /* realloc(0) is NASTY on our system */
+ ptr = (char *)
+ realloc(where,size?size:1); /* realloc(0) is NASTY on our system */
#ifdef DEBUGGING
if (debug & 128) {
fprintf(stderr,"0x%x: (%05d) rfree\n",where,an++);
diff --git a/x2p/walk.c b/x2p/walk.c
index e4cca450ee..fb738756ba 100644
--- a/x2p/walk.c
+++ b/x2p/walk.c
@@ -1765,7 +1765,7 @@ int *numericptr;
prewalk(0,level,ops[node+2].ival,&numarg);
prewalk(0,level,ops[node+1].ival,&numarg);
prewalk(0,level,ops[node+3].ival,&numarg);
- if (numarg || strlen(ops[ops[node+1].ival+1].cval) > 1) {
+ if (numarg || strlen(ops[ops[node+1].ival+1].cval) > (Size_t)1) {
numericize(ops[node+2].ival);
if (!numarg)
numericize(ops[node+3].ival);