Skip to content

Commit

Permalink
Make sources mostly sparse-clean
Browse files Browse the repository at this point in the history
Mainly an issue of taking care of a few remaining K&R function
declarations.
  • Loading branch information
Linus Torvalds committed Oct 1, 2005
1 parent 24338ae commit ef92bc8
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 37 deletions.
3 changes: 1 addition & 2 deletions bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#if CRYPT

static int mod95();
static int mod95(int);

/*
* reset encryption key of current buffer
Expand Down
1 change: 0 additions & 1 deletion display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 1 addition & 14 deletions edef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion estruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
8 changes: 3 additions & 5 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(": ");
Expand All @@ -34,7 +33,7 @@ int namedcmd(int f, int n)
}

/* and then execute the command */
return ((*kfunc) (f, n));
return kfunc(f, n);
}

/*
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ TERM term = {

static void tcapopen(void)
{
char *getenv();
char *t, *p;
char tcbuf[1024];
char *tv_stype;
Expand Down

0 comments on commit ef92bc8

Please sign in to comment.