diff options
author | Miquel van Smoorenburg <miquels@debian.org> | 2016-11-11 07:07:17 -0800 |
---|---|---|
committer | Miquel van Smoorenburg <miquels@debian.org> | 2016-11-11 07:07:17 -0800 |
commit | 441d9c90b9d2e3cd0b1b54802af40c799d437c73 (patch) | |
tree | 7a3f61edc4f4e807cbe735fd847da3d235d42b25 | |
parent | 9f2e9d20f0bbf50a57071ed4e7ed8c364d654cfd (diff) |
warnings
Gbp-Pq: Name warnings.patch
-rw-r--r-- | cmd1.c | 4 | ||||
-rw-r--r-- | cmd2.c | 5 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | curses.c | 2 | ||||
-rw-r--r-- | cut.c | 4 | ||||
-rw-r--r-- | ex.c | 1 | ||||
-rw-r--r-- | input.c | 2 | ||||
-rw-r--r-- | main.c | 7 | ||||
-rw-r--r-- | misc.c | 1 | ||||
-rw-r--r-- | modify.c | 1 | ||||
-rw-r--r-- | move2.c | 1 | ||||
-rw-r--r-- | opts.c | 2 | ||||
-rw-r--r-- | regexp.c | 2 | ||||
-rw-r--r-- | regsub.c | 2 | ||||
-rw-r--r-- | system.c | 5 | ||||
-rw-r--r-- | tio.c | 5 | ||||
-rw-r--r-- | tmp.c | 5 | ||||
-rw-r--r-- | vcmd.c | 4 | ||||
-rw-r--r-- | vi.c | 1 | ||||
-rw-r--r-- | vi.h | 3 |
20 files changed, 52 insertions, 10 deletions
@@ -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 */ { @@ -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) @@ -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 @@ -35,6 +35,8 @@ #endif #include <signal.h> +#include <stdlib.h> +#include <string.h> extern char *getenv(); static void starttcap(); @@ -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 @@ -12,6 +12,7 @@ #include "config.h" #include <ctype.h> +#include <string.h> #include "vi.h" #ifndef isascii @@ -15,7 +15,7 @@ #include <ctype.h> #include "config.h" #include "vi.h" - +#include <string.h> #ifndef NO_DIGRAPH static struct _DIG @@ -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*/ } @@ -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 */ @@ -8,6 +8,7 @@ #include "config.h" #include "vi.h" +#include <string.h> #ifdef DEBUG # include <stdio.h> @@ -13,6 +13,7 @@ #include "config.h" #include "vi.h" #include "regexp.h" +#include <stdlib.h> extern long atol(); @@ -14,6 +14,8 @@ #include "config.h" #include "vi.h" +#include <stdio.h> +#include <string.h> #ifndef NULL #define NULL (char *)0 #endif @@ -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" @@ -5,6 +5,8 @@ */ #include <ctype.h> +#include <stdlib.h> +#include <string.h> #include "config.h" #include "vi.h" #include "regexp.h" @@ -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 */ @@ -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 @@ -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) @@ -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"); } @@ -10,6 +10,7 @@ #include "config.h" #include <ctype.h> +#include <string.h> #include "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(); |