diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-30 23:52:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-30 23:52:55 -0700 |
commit | 8eab871e557bcd0666f0a002330c9465463dd8f3 (patch) | |
tree | 152105c50ff981c4c5769375a9417e1dc0a345d3 | |
parent | d0ed902432e60671a9b5df62f14c1683ed23a7eb (diff) | |
download | uemacs-8eab871e557bcd0666f0a002330c9465463dd8f3.tar.gz |
More warning avoidance and code cleanup
-rw-r--r-- | ebind.h | 8 | ||||
-rw-r--r-- | efunc.h | 4 | ||||
-rw-r--r-- | lock.c | 8 | ||||
-rw-r--r-- | main.c | 23 | ||||
-rw-r--r-- | posix.c | 6 | ||||
-rw-r--r-- | spawn.c | 8 |
6 files changed, 30 insertions, 27 deletions
@@ -409,10 +409,10 @@ KEYTAB keytab[NBINDS] = { , /* special internal bindings */ - SPEC | META | 'W', wrapword, /* called on word wrap */ - SPEC | META | 'C', nullproc, /* every command input */ - SPEC | META | 'R', nullproc, /* on file read */ - SPEC | META | 'X', nullproc, /* on window change P.K. */ + { SPEC | META | 'W', wrapword }, /* called on word wrap */ + { SPEC | META | 'C', nullproc }, /* every command input */ + { SPEC | META | 'R', nullproc }, /* on file read */ + { SPEC | META | 'X', nullproc }, /* on window change P.K. */ {0, NULL} }; @@ -120,7 +120,7 @@ extern int istring(int f, int n); extern int ovstring(int f, int n); /* main.c */ -extern int edinit(char *bname); +extern void edinit(char *bname); extern int execute(int c, int f, int n); extern int quickexit(int f, int n); extern int quit(int f, int n); @@ -320,7 +320,7 @@ extern int cbuf40(int f, int n); /* spawn.c */ extern int spawncli(int f, int n); -extern void bktoshell(void); +extern int bktoshell(int f, int n); extern void rtfrmshell(void); extern int spawn(int f, int n); extern int execprg(int f, int n); @@ -14,9 +14,6 @@ #if BSD | SVR4 #include <sys/errno.h> -extern int sys_nerr; /* number of system error messages defined */ -extern int errno; /* current error */ - char *lname[NLOCKS]; /* names of all locked files */ int numlocks; /* # of current locks active */ @@ -157,10 +154,7 @@ void lckerror(char *errstr) strcpy(obuf, errstr); strcat(obuf, " - "); - if (errno < sys_nerr) - strcat(obuf, sys_errlist[errno]); - else - strcat(obuf, "(can not get system error message)"); + strcat(obuf, strerror(errno)); mlwrite(obuf); } #endif @@ -94,7 +94,7 @@ int emacs(int argc, char **argv) int main(int argc, char **argv) #endif { - register int c; /* command character */ + register int c = -1; /* command character */ register int f; /* default flag */ register int n; /* numeric repeat count */ register int mflag; /* negative flag on repeat */ @@ -115,7 +115,6 @@ int main(int argc, char **argv) int cryptflag; /* encrypting on the way in? */ char ekey[NPAT]; /* startup encryption key */ #endif - extern *pathname[]; /* startup file path/name array */ int newc; #if PKCODE & VMS @@ -373,7 +372,7 @@ int main(int argc, char **argv) n = 4; /* with argument of 4 */ mflag = 0; /* that can be discarded. */ mlwrite("Arg: 4"); - while ((c = getcmd()) >= '0' && c <= '9' || c == reptc + while (((c = getcmd()) >= '0' && c <= '9') || c == reptc || c == '-') { if (c == reptc) if ((n > 0) == ((n * 4) > 0)) @@ -425,7 +424,7 @@ int main(int argc, char **argv) * as an argument, because the main routine may have been told to read in a * file by default, and we want the buffer name to be right. */ -int edinit(char *bname) +void edinit(char *bname) { register BUFFER *bp; register WINDOW *wp; @@ -706,20 +705,28 @@ int resterr(void) return (FALSE); } +/* user function that does NOTHING */ int nullproc(int f, int n) -{ /* user function that does NOTHING */ +{ + return (TRUE); } +/* dummy function for binding to meta prefix */ int meta(int f, int n) -{ /* dummy function for binding to meta prefix */ +{ + return (TRUE); } +/* dummy function for binding to control-x prefix */ int cex(int f, int n) -{ /* dummy function for binding to control-x prefix */ +{ + return (TRUE); } +/* dummy function for binding to universal-argument */ int unarg(int f, int n) -{ /* dummy function for binding to universal-argument */ +{ + return (TRUE); } /***** Compiler specific Library functions ****/ @@ -13,6 +13,7 @@ #ifdef POSIX #include <stdio.h> +#include <unistd.h> #include "estruct.h" #include "edef.h" #include "efunc.h" @@ -23,9 +24,7 @@ #include <errno.h> static int kbdflgs; /* saved keyboard fd flags */ -static int kbdpoll; /* in O_NDELAY mode */ -static int kbdqp; /* there is a char in kbdq */ -static char kbdq; /* char we've already read */ +static int kbdpoll; /* in O_NDELAY mode */ static struct termios otermios; /* original terminal characteristics */ static struct termios ntermios; /* charactoristics to use inside */ @@ -101,6 +100,7 @@ void ttclose(void) int ttputc(int c) { fputc(c, stdout); + return (TRUE); } /* @@ -5,6 +5,7 @@ */ #include <stdio.h> +#include <unistd.h> #include "estruct.h" #include "edef.h" #include "efunc.h" @@ -104,16 +105,17 @@ int spawncli(int f, int n) #if BSD | __hpux | SVR4 -void bktoshell(void) +int bktoshell(int f, int n) { /* suspend MicroEMACS and wait to wake up */ - int pid; - vttidy(); /****************************** + int pid; + pid = getpid(); kill(pid,SIGTSTP); ******************************/ kill(0, SIGTSTP); + return (TRUE); } void rtfrmshell(void) |