summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel van Smoorenburg <miquels@debian.org>2016-11-11 07:07:17 -0800
committerMiquel van Smoorenburg <miquels@debian.org>2016-11-11 07:07:17 -0800
commit441d9c90b9d2e3cd0b1b54802af40c799d437c73 (patch)
tree7a3f61edc4f4e807cbe735fd847da3d235d42b25
parent9f2e9d20f0bbf50a57071ed4e7ed8c364d654cfd (diff)
warnings
Gbp-Pq: Name warnings.patch
-rw-r--r--cmd1.c4
-rw-r--r--cmd2.c5
-rw-r--r--config.h5
-rw-r--r--curses.c2
-rw-r--r--cut.c4
-rw-r--r--ex.c1
-rw-r--r--input.c2
-rw-r--r--main.c7
-rw-r--r--misc.c1
-rw-r--r--modify.c1
-rw-r--r--move2.c1
-rw-r--r--opts.c2
-rw-r--r--regexp.c2
-rw-r--r--regsub.c2
-rw-r--r--system.c5
-rw-r--r--tio.c5
-rw-r--r--tmp.c5
-rw-r--r--vcmd.c4
-rw-r--r--vi.c1
-rw-r--r--vi.h3
20 files changed, 52 insertions, 10 deletions
diff --git a/cmd1.c b/cmd1.c
index 519308f..39d0277 100644
--- a/cmd1.c
+++ b/cmd1.c
@@ -14,6 +14,8 @@
#include "config.h"
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "vi.h"
#include "regexp.h"
@@ -278,7 +280,7 @@ void cmd_shell(frommark, tomark, cmd, bang, extra)
suspend_curses();
if (frommark == 0L)
{
- system(extra);
+ elvis_system(extra);
}
else /* pipe lines from the file through the command */
{
diff --git a/cmd2.c b/cmd2.c
index 9322327..0d84892 100644
--- a/cmd2.c
+++ b/cmd2.c
@@ -11,6 +11,9 @@
/* This file contains some of the commands - mostly ones that change text */
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
@@ -23,7 +26,7 @@
# include <sys/stat.h>
# endif
#endif
-
+#include <string.h>
/*ARGSUSED*/
void cmd_substitute(frommark, tomark, cmd, bang, extra)
diff --git a/config.h b/config.h
index 6096f0b..5648828 100644
--- a/config.h
+++ b/config.h
@@ -148,7 +148,6 @@
#if BSD || UNIX7 || OSK
# define strchr index
#endif
-extern char *strchr();
/* BSD uses bcopy() instead of memcpy() */
#if BSD
@@ -219,6 +218,10 @@ extern char *malloc();
# endif
#endif
+#ifndef ANY_UNIX
+# define elvis_system system
+#endif
+
#if MSDOS || TOS
/* do not change TMPNAME, CUTNAME and SCRATCH*: they MUST begin with '%s\\'! */
# ifndef TMPDIR
diff --git a/curses.c b/curses.c
index b7e328d..cd5ec92 100644
--- a/curses.c
+++ b/curses.c
@@ -35,6 +35,8 @@
#endif
#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
extern char *getenv();
static void starttcap();
diff --git a/cut.c b/cut.c
index 8507f8e..cb39413 100644
--- a/cut.c
+++ b/cut.c
@@ -20,6 +20,10 @@
#define rename(a,b) Frename(0,a,b)
#endif
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
# define NANNONS 9 /* number of annonymous buffers */
static struct cutbuf
diff --git a/ex.c b/ex.c
index 45d9ad4..fae003e 100644
--- a/ex.c
+++ b/ex.c
@@ -12,6 +12,7 @@
#include "config.h"
#include <ctype.h>
+#include <string.h>
#include "vi.h"
#ifndef isascii
diff --git a/input.c b/input.c
index 36524a2..5efb5c2 100644
--- a/input.c
+++ b/input.c
@@ -15,7 +15,7 @@
#include <ctype.h>
#include "config.h"
#include "vi.h"
-
+#include <string.h>
#ifndef NO_DIGRAPH
static struct _DIG
diff --git a/main.c b/main.c
index 9ef8937..781c8be 100644
--- a/main.c
+++ b/main.c
@@ -13,6 +13,9 @@
#include "config.h"
#include <signal.h>
#include <setjmp.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include "vi.h"
extern trapint(); /* defined below */
@@ -25,7 +28,7 @@ static init_digraphs();
/*---------------------------------------------------------------------*/
-void main(argc, argv)
+int main(argc, argv)
int argc;
char *argv[];
{
@@ -349,7 +352,7 @@ void main(argc, argv)
refresh();
endwin();
- exit(0);
+ return(0);
/*NOTREACHED*/
}
diff --git a/misc.c b/misc.c
index c9e0f68..4a06596 100644
--- a/misc.c
+++ b/misc.c
@@ -12,6 +12,7 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
/* find a particular line & return a pointer to a copy of its text */
diff --git a/modify.c b/modify.c
index a3f9806..c61012a 100644
--- a/modify.c
+++ b/modify.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
#ifdef DEBUG
# include <stdio.h>
diff --git a/move2.c b/move2.c
index c69dbb4..3965a7c 100644
--- a/move2.c
+++ b/move2.c
@@ -13,6 +13,7 @@
#include "config.h"
#include "vi.h"
#include "regexp.h"
+#include <stdlib.h>
extern long atol();
diff --git a/opts.c b/opts.c
index 8153fe6..9e2fc48 100644
--- a/opts.c
+++ b/opts.c
@@ -14,6 +14,8 @@
#include "config.h"
#include "vi.h"
+#include <stdio.h>
+#include <string.h>
#ifndef NULL
#define NULL (char *)0
#endif
diff --git a/regexp.c b/regexp.c
index eb9ccb9..6504176 100644
--- a/regexp.c
+++ b/regexp.c
@@ -31,6 +31,8 @@
#include <setjmp.h>
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
diff --git a/regsub.c b/regsub.c
index e0512fe..26f62b4 100644
--- a/regsub.c
+++ b/regsub.c
@@ -5,6 +5,8 @@
*/
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "vi.h"
#include "regexp.h"
diff --git a/system.c b/system.c
index aa92818..cacc123 100644
--- a/system.c
+++ b/system.c
@@ -25,6 +25,9 @@
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
extern char **environ;
#if ANY_UNIX
@@ -32,7 +35,7 @@ extern char **environ;
/* This is a new version of the system() function. The only difference
* between this one and the library one is: this one uses the o_shell option.
*/
-int system(cmd)
+int elvis_system(cmd)
char *cmd; /* a command to run */
{
int status; /* exit status of the command */
diff --git a/tio.c b/tio.c
index 076372e..c010da1 100644
--- a/tio.c
+++ b/tio.c
@@ -15,6 +15,9 @@
# include <setjmp.h>
#endif
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "vi.h"
@@ -354,7 +357,7 @@ static int dummy()
return 0;
}
# else
-static int dummy()
+static void dummy()
{
}
# endif
diff --git a/tmp.c b/tmp.c
index 2689c87..c60863c 100644
--- a/tmp.c
+++ b/tmp.c
@@ -13,6 +13,9 @@
#include "config.h"
#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include "vi.h"
#if TOS
# include <stat.h>
@@ -24,7 +27,7 @@
# endif
#endif
#include <malloc.h>
-
+#include <string.h>
#ifndef NO_MODELINE
static void do_modeline(l, stop)
diff --git a/vcmd.c b/vcmd.c
index 7e3aee5..11f2d46 100644
--- a/vcmd.c
+++ b/vcmd.c
@@ -13,6 +13,8 @@
#include "config.h"
#include "vi.h"
+#include <string.h>
+#include <stdio.h>
#if MSDOS
#include <process.h>
#include <string.h>
@@ -627,7 +629,7 @@ MARK v_keyword(keyword, m, cnt)
waswarn = *o_warn;
*o_warn = FALSE;
suspend_curses();
- if (system(cmdline))
+ if (elvis_system(cmdline))
{
addstr("<<< failed >>>\n");
}
diff --git a/vi.c b/vi.c
index 9c55bbb..8ac0880 100644
--- a/vi.c
+++ b/vi.c
@@ -10,6 +10,7 @@
#include "config.h"
#include <ctype.h>
+#include <string.h>
#include "vi.h"
diff --git a/vi.h b/vi.h
index 36c1397..417b793 100644
--- a/vi.h
+++ b/vi.h
@@ -409,6 +409,9 @@ typedef int CMD;
extern void ex();
extern void vi();
extern void doexcmd();
+#ifndef elvis_system
+extern int elvis_system();
+#endif
#ifndef NO_ABBR
extern void cmd_abbr();