Fix up some trivial gcc -Wall warnings

Lots more to go.
This commit is contained in:
Linus Torvalds 2005-09-30 23:37:34 -07:00
parent d5dc3160cf
commit d0ed902432
10 changed files with 22 additions and 28 deletions

2
ansi.c
View File

@ -253,7 +253,7 @@ int f, n; /* default flag, numeric argument [unused] */
} }
#endif #endif
#else #else
ansihello() static void ansihello(void)
{ {
} }
#endif #endif

View File

@ -243,8 +243,8 @@ int gotobop(int f, int n)
#if PKCODE #if PKCODE
((justflag == TRUE) || ((justflag == TRUE) ||
#endif #endif
lgetc(curwp->w_dotp, curwp->w_doto) != TAB && (lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
lgetc(curwp->w_dotp, curwp->w_doto) != ' ') lgetc(curwp->w_dotp, curwp->w_doto) != ' '))
#if PKCODE #if PKCODE
) )
#endif #endif
@ -292,8 +292,8 @@ int gotoeop(int f, int n)
#if PKCODE #if PKCODE
((justflag == TRUE) || ((justflag == TRUE) ||
#endif #endif
lgetc(curwp->w_dotp, curwp->w_doto) != TAB && (lgetc(curwp->w_dotp, curwp->w_doto) != TAB &&
lgetc(curwp->w_dotp, curwp->w_doto) != ' ') lgetc(curwp->w_dotp, curwp->w_doto) != ' '))
#if PKCODE #if PKCODE
) )
#endif #endif

2
edef.h
View File

@ -135,7 +135,7 @@ WINDOW *wheadp; /* Head of list of windows */
BUFFER *bheadp; /* Head of list of buffers */ BUFFER *bheadp; /* Head of list of buffers */
BUFFER *blistp; /* Buffer for C-X C-B */ BUFFER *blistp; /* Buffer for C-X C-B */
BUFFER *bfind(); /* Lookup a buffer by name */ BUFFER *bfind(char *bname, int cflag, int bflag); /* Lookup a buffer by name */
WINDOW *wpopup(); /* Pop up window creation */ WINDOW *wpopup(); /* Pop up window creation */
LINE *lalloc(); /* Allocate a line */ LINE *lalloc(); /* Allocate a line */
char sres[NBUFN]; /* current screen resolution */ char sres[NBUFN]; /* current screen resolution */

View File

@ -687,7 +687,7 @@ typedef struct WHBLOCK {
#define EOL 6 #define EOL 6
#define DITTO 7 #define DITTO 7
#define CLOSURE 256 /* An or-able value. */ #define CLOSURE 256 /* An or-able value. */
#define MASKCL CLOSURE - 1 #define MASKCL (CLOSURE - 1)
#define MC_ANY '.' /* 'Any' character (except newline). */ #define MC_ANY '.' /* 'Any' character (except newline). */
#define MC_CCL '[' /* Character class. */ #define MC_CCL '[' /* Character class. */

15
posix.c
View File

@ -15,22 +15,23 @@
#include <stdio.h> #include <stdio.h>
#include "estruct.h" #include "estruct.h"
#include "edef.h" #include "edef.h"
#include "efunc.h"
#include <signal.h> #include <signal.h>
#include <termios.h> #include <termios.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
int kbdflgs; /* saved keyboard fd flags */ static int kbdflgs; /* saved keyboard fd flags */
int kbdpoll; /* in O_NDELAY mode */ static int kbdpoll; /* in O_NDELAY mode */
int kbdqp; /* there is a char in kbdq */ static int kbdqp; /* there is a char in kbdq */
char kbdq; /* char we've already read */ static char kbdq; /* char we've already read */
struct termios otermios; /* original terminal characteristics */ static struct termios otermios; /* original terminal characteristics */
struct termios ntermios; /* charactoristics to use inside */ static struct termios ntermios; /* charactoristics to use inside */
#define TBUFSIZ 128 #define TBUFSIZ 128
char tobuf[TBUFSIZ]; /* terminal output buffer */ static char tobuf[TBUFSIZ]; /* terminal output buffer */
/* /*

View File

@ -442,21 +442,23 @@ static int amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff)
* notion that the meta-character '$' (and likewise * notion that the meta-character '$' (and likewise
* '^') match positions, not characters. * '^') match positions, not characters.
*/ */
if (mcptr->mc_type == BOL) if (mcptr->mc_type == BOL) {
if (curoff == llength(curline)) { if (curoff == llength(curline)) {
c = nextch(&curline, &curoff, c = nextch(&curline, &curoff,
direct ^ REVERSE); direct ^ REVERSE);
goto success; goto success;
} else } else
return FALSE; return FALSE;
}
if (mcptr->mc_type == EOL) if (mcptr->mc_type == EOL) {
if (curoff == 0) { if (curoff == 0) {
c = nextch(&curline, &curoff, c = nextch(&curline, &curoff,
direct ^ REVERSE); direct ^ REVERSE);
goto success; goto success;
} else } else
return FALSE; return FALSE;
}
/* Neither BOL nor EOL, so go through /* Neither BOL nor EOL, so go through
* the meta-character equal function. * the meta-character equal function.
@ -1278,6 +1280,7 @@ static int rmcstr(void)
} }
rmcptr->mc_type = MCNIL; rmcptr->mc_type = MCNIL;
return status;
} }
/* /*

1
tcap.c
View File

@ -266,7 +266,6 @@ static void tcapeeop(void)
*/ */
static void tcaprev(int state) static void tcaprev(int state)
{ {
static int revstate = FALSE;
if (state) { if (state) {
if (SO != NULL) if (SO != NULL)
putpad(SO); putpad(SO);

View File

@ -518,7 +518,7 @@ spal()
* *
* Nothing returned * Nothing returned
***/ ***/
hellovms() static void hellovms(void)
{ {
} }

2
vt52.c
View File

@ -178,7 +178,7 @@ int f, n; /* default flag, numeric argument [unused] */
#endif #endif
#else #else
vt52hello() static void vt52hello(void)
{ {
} }

9
word.c
View File

@ -653,15 +653,6 @@ int wordcount(int f, int n)
int status; /* status return code */ int status; /* status return code */
REGION region; /* region to look at */ REGION region; /* region to look at */
#if PKCODE
struct {
long pk_1;
long pk_2;
int pk_3;
int pk_4;
} pk_mlrec;
#endif
/* make sure we have a region to count */ /* make sure we have a region to count */
if ((status = getregion(&region)) != TRUE) if ((status = getregion(&region)) != TRUE)
return (status); return (status);