Make sources mostly sparse-clean

Mainly an issue of taking care of a few remaining K&R function
declarations.
This commit is contained in:
Linus Torvalds 2005-10-01 01:09:22 -07:00
parent 24338ae855
commit ef92bc8cd9
12 changed files with 9 additions and 37 deletions

3
bind.c
View File

@ -89,7 +89,7 @@ int deskey(int f, int n)
int bindtokey(int f, int n)
{
register unsigned int c; /* command key to bind */
register int (*kfunc) (); /* ptr to the requested function to bind to */
register fn_t kfunc; /* ptr to the requested function to bind to */
register KEYTAB *ktp; /* pointer into the command table */
register int found; /* matched command flag */
char outseq[80]; /* output buffer for keystroke sequence */
@ -706,7 +706,6 @@ unsigned int stock(char *keyname)
char *transbind(char *skey)
{
char *bindname;
unsigned int stock();
bindname = getfname(getbind(stock(skey)));
if (bindname == NULL)

View File

@ -12,7 +12,7 @@
#if CRYPT
static int mod95();
static int mod95(int);
/*
* reset encryption key of current buffer

View File

@ -1512,7 +1512,6 @@ void getscreensize(int *widthp, int *heightp)
void sizesignal(int signr)
{
int w, h;
extern int errno;
int old_errno = errno;
getscreensize(&w, &h);

15
edef.h
View File

@ -17,16 +17,6 @@ typedef int (*fn_t)(int, int);
struct VIDEO;
char *getval();
char *gtenv();
char *gtfun();
char *gtusr();
char *itoa();
char *ltos();
char *mklower();
char *mkupper();
char *token();
/* initialized global external declarations */
extern int fillcol; /* Fill column */
@ -121,7 +111,7 @@ extern BUFFER *blistp; /* Buffer for C-X C-B */
extern BUFFER *bfind(char *bname, int cflag, int bflag); /* Lookup a buffer by name */
extern window_t *wpopup(); /* Pop up window creation */
extern LINE *lalloc(); /* Allocate a line */
extern LINE *lalloc(int); /* Allocate a line */
extern char sres[NBUFN]; /* current screen resolution */
extern char pat[]; /* Search pattern */
extern char tap[]; /* Reversed pattern array. */
@ -149,7 +139,4 @@ extern char outline[]; /* global string to hold debug line text */
#endif
/* terminal table defined only in TERM.C */
#ifndef termdef
extern TERM term; /* Terminal information. */
#endif

View File

@ -601,7 +601,7 @@ typedef struct {
typedef struct {
short k_code; /* Key code */
int (*k_fp) (); /* Routine to handle it */
int (*k_fp)(int, int); /* Routine to handle it */
} KEYTAB;
/* structure for the name binding table */

2
eval.c
View File

@ -34,8 +34,6 @@ char *gtfun(char *fname)
char arg2[NSTRING]; /* value of second argument */
char arg3[NSTRING]; /* value of third argument */
static char result[2 * NSTRING]; /* string result */
char *flook(); /* look file up on path */
char *xlat(); /* translate a char string */
/* look the function up in the function table */
fname[3] = 0; /* only first 3 chars significant */

8
exec.c
View File

@ -20,8 +20,7 @@
*/
int namedcmd(int f, int n)
{
register int (*kfunc) (); /* ptr to the requexted function to bind to */
int (*getname()) ();
register fn_t kfunc; /* ptr to the requexted function to bind to */
/* prompt the user to type a named command */
mlwrite(": ");
@ -34,7 +33,7 @@ int namedcmd(int f, int n)
}
/* and then execute the command */
return ((*kfunc) (f, n));
return kfunc(f, n);
}
/*
@ -74,12 +73,11 @@ int docmd(char *cline)
{
register int f; /* default argument flag */
register int n; /* numeric repeat value */
int (*fnc) (); /* function to execute */
fn_t fnc; /* function to execute */
int status; /* return status of function */
int oldcle; /* old contents of clexec flag */
char *oldestr; /* original exec string */
char tkn[NSTRING]; /* next token off of command line */
int (*fncmatch()) ();
/* if we are scanning and not executing..go back here */
if (execlevel)

View File

@ -105,11 +105,7 @@ window_t *wheadp; /* Head of list of windows */
BUFFER *bheadp; /* Head of list of buffers */
BUFFER *blistp; /* Buffer for C-X C-B */
BUFFER *bfind(char *bname, int cflag, int bflag); /* Lookup a buffer by name */
window_t *wpopup(); /* Pop up window creation */
LINE *lalloc(); /* Allocate a line */
char sres[NBUFN]; /* current screen resolution */
char pat[NPAT]; /* Search pattern */
char tap[NPAT]; /* Reversed pattern array. */
char rpat[NPAT]; /* replacement pattern */

View File

@ -112,7 +112,6 @@ fn_t getname(void)
register NBIND *cffp; /* current ptr to entry in name binding table */
register NBIND *lffp; /* last ptr to entry in name binding table */
char buf[NSTRING]; /* buffer to hold tentative command name */
int (*fncmatch()) ();
/* starting at the beginning of the string buffer */
cpos = 0;

3
lock.c
View File

@ -27,7 +27,6 @@ int lockchk(char *fname)
{
register int i; /* loop indexes */
register int status; /* return status */
char *undolock();
/* check to see if that file is already locked here */
if (numlocks > 0)
@ -97,7 +96,6 @@ int lock(char *fname)
register char *locker; /* lock error message */
register int status; /* return status */
char msg[NSTRING]; /* message string */
char *dolock();
/* attempt to lock the file */
locker = dolock(fname);
@ -131,7 +129,6 @@ int lock(char *fname)
int unlock(char *fname)
{
register char *locker; /* undolock return string */
char *undolock();
/* unclock and return */
locker = undolock(fname);

4
main.c
View File

@ -82,9 +82,9 @@ extern unsigned _stklen = 32766;
#if UNIX
#include <signal.h>
static void emergencyexit();
static void emergencyexit(int);
#ifdef SIGWINCH
extern void sizesignal();
extern void sizesignal(int);
#endif
#endif

1
tcap.c
View File

@ -109,7 +109,6 @@ TERM term = {
static void tcapopen(void)
{
char *getenv();
char *t, *p;
char tcbuf[1024];
char *tv_stype;