Author: Andreas Beckmann <anbe@debian.org>
Description: fix building with -Werror=implicit-int

--- a/autosave.c
+++ b/autosave.c
@@ -38,6 +38,7 @@ static time_t check_time;
 
 VOID
 autosave_check(flag)
+int flag;
 {
     if (flag && autosave_interval!=0) {
 	autosave_flag = TRUE;
@@ -118,7 +119,9 @@ clean_autosave_file()
  * COMMAND: set-auto-save-interval
  */
 /*ARGSUSED*/
+int
 as_set_interval(f, n)
+int f, n;
 {
     if ((f & FFARG) == 0) {
     	if (getnum("auto-save-interval", &n) == FALSE)
--- a/basic.c
+++ b/basic.c
@@ -44,7 +44,9 @@ VOID	setgoal();
  * Go to beginning of line.
  */
 /*ARGSUSED*/
+int
 gotobol(f, n)
+int f, n;
 {
 	curwp->w_doto  = 0;
 	return (TRUE);
@@ -62,7 +64,9 @@ gotobol(f, n)
 #endif
  */
 /*ARGSUSED*/
+int
 backchar(f, n)
+int f;
 register int n;
 {
 	register LINE	*lp;
@@ -126,7 +130,9 @@ register int n;
  * Go to end of line.
  */
 /*ARGSUSED*/
+int
 gotoeol(f, n)
+int f, n;
 {
 	curwp->w_doto  = llength(curwp->w_dotp);
 	return (TRUE);
@@ -145,8 +151,10 @@ gotoeol(f, n)
 #endif
  */
 /*ARGSUSED*/
+int
 forwchar(f, n)
 register int n;
+int f;
 {
 #ifdef	KANJI	/* 90.01.29  by S.Yoshida */
 	register int	kanji2nd = 0;		/* Now on a KANJI 2nd byte. */
@@ -202,7 +210,9 @@ register int n;
  * buffer. Setting WFHARD is conservative,
  * but almost always the case.
  */
+int
 gotobob(f, n)
+int f, n;
 {
 	(VOID) setmark(f, n) ;
 	curwp->w_dotp  = lforw(curbp->b_linep);
@@ -216,7 +226,9 @@ gotobob(f, n)
  * Setting WFHARD is conservative, but
  * almost always the case.
  */
+int
 gotoeob(f, n)
+int f, n;
 {
 	(VOID) setmark(f, n) ;
 	curwp->w_dotp  = lback(curbp->b_linep);
@@ -232,7 +244,9 @@ gotoeob(f, n)
 static 	int	flag_nextline = NEXTLINE;
 
 /*ARGSUSED*/
+int
 nextline(f, n)
+int f, n;
 {
 	register int	s;
 	char	buf[NINPUT];
@@ -255,7 +269,9 @@ nextline(f, n)
 #ifdef	ADDFUNC
 int line_number_mode = FALSE;
 
+int
 linenumbermode(f, n)
+int f, n;
 {
     register int s;
     register WINDOW *wp;
@@ -286,7 +302,9 @@ linenumbermode(f, n)
  * the goal column is set.
  */
 /*ARGSUSED*/
+int
 forwline(f, n)
+int f, n;
 {
 	register LINE	*dlp;
 
@@ -371,7 +389,9 @@ forwline(f, n)
  * call "movedot" to perform the motion.
  */
 /*ARGSUSED*/
+int
 backline(f, n)
+int f, n;
 {
 	register LINE	*dlp;
 
@@ -415,6 +435,7 @@ setgoal() {
  * routine above) and returns the best offset to use
  * when a vertical motion is made into the line.
  */
+int
 getgoal(dlp) register LINE *dlp; {
 	register int	c;
 	register int	col;
@@ -478,8 +499,10 @@ getgoal(dlp) register LINE *dlp; {
  * update and get it back.
  */
 /*ARGSUSED*/
+int
 forwpage(f, n)
 register int n;
+int f;
 {
 	register LINE	*lp;
 
@@ -526,8 +549,10 @@ register int n;
  * the window is zapped.
  */
 /*ARGSUSED*/
+int
 backpage(f, n)
 register int n;
+int f;
 {
 	register LINE	*lp;
 
@@ -569,6 +594,7 @@ register int n;
  */
 
 #ifdef GOSMACS
+int
 forw1page(f, n)
 int f, n;
 {
@@ -579,6 +605,7 @@ int f, n;
 	forwpage(f|FFRAND, n);
 }
 
+int
 back1page(f, n)
 int f, n;
 {
@@ -594,7 +621,9 @@ int f, n;
  * Page the other window. Check to make sure it exists, then
  * nextwind, forwpage and restore window pointers.
  */
+int
 pagenext(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 
@@ -626,7 +655,9 @@ isetmark()
  * the echo line.  (ewprintf knows about macros)
  */
 /*ARGSUSED*/
+int
 setmark(f, n)
+int f, n;
 {
 	isetmark();
 	ewprintf("Mark set");
@@ -641,7 +672,9 @@ setmark(f, n)
  * error is "no mark".
  */
 /*ARGSUSED*/
+int
 swapmark(f, n)
+int f, n;
 {
 	register LINE	*odotp;
 	register int	odoto;
@@ -669,8 +702,10 @@ swapmark(f, n)
  * to use.
  */
 /*ARGSUSED*/
+int
 gotoline(f, n)
 register int n;
+int f;
 {
 	register LINE	*clp;
 	register int	s;
--- a/buffer.c
+++ b/buffer.c
@@ -51,7 +51,9 @@ static long buffersize pro((BUFFER*));
 
 #ifdef	MOVE_BUFFER		/* 95.08.29 by M.Suzuki	*/
 /* Move to the next buffer	*/
+int
 nextbuffer(f,n)
+int f, n;
 {
 	register BUFFER *bp;
 
@@ -78,7 +80,9 @@ nextbuffer(f,n)
 }
 
 /* Move to the previous buffer	*/
+int
 prevbuffer(f,n)
+int f, n;
 {
 	register BUFFER *bp,*bp1;
 
@@ -114,7 +118,9 @@ prevbuffer(f,n)
  * buffer.
  */
 /*ARGSUSED*/
+int
 usebuffer(f, n)
+int f, n;
 {
 	register BUFFER *bp;
 	register int	s;
@@ -141,7 +147,9 @@ usebuffer(f, n)
  * pop to buffer asked for by the user.
  */
 /*ARGSUSED*/
+int
 poptobuffer(f, n)
+int f, n;
 {
 	register BUFFER *bp;
 	register WINDOW *wp;
@@ -176,7 +184,9 @@ poptobuffer(f, n)
  * line and the buffer header. Bound to "C-X K".
  */
 /*ARGSUSED*/
+int
 killbuffer(f, n)
+int f, n;
 {
 	register BUFFER *bp;
 	register BUFFER *bp1;
@@ -263,7 +273,9 @@ killbuffer(f, n)
  * Save some buffers - just call anycb with the arg flag.
  */
 /*ARGSUSED*/
+int
 savebuffers(f, n)
+int f, n;
 {
 	if (anycb(f) == ABORT) return ABORT;
 	return TRUE;
@@ -277,7 +289,9 @@ savebuffers(f, n)
  * "C-X C-B".
  */
 /*ARGSUSED*/
+int
 listbuffers(f, n)
+int f, n;
 {
 	register BUFFER *bp;
 	register WINDOW *wp;
@@ -389,6 +403,7 @@ buffersize(bp)
  * on the end. Return TRUE if it worked and
  * FALSE if you ran out of room.
  */
+int
 addline(bp, text) register BUFFER *bp; char *text; {
 	register LINE	*lp;
 	register int	i;
@@ -419,7 +434,10 @@ addline(bp, text) register BUFFER *bp; c
  * have an associated file don't count. Return FALSE
  * if there are no changed buffers.
  */
-anycb(f) {
+int
+anycb(f)
+int f;
+{
 	register BUFFER *bp;
 	register int	s = FALSE, save = FALSE;
 	char		*prompt;
@@ -462,7 +480,9 @@ anycb(f) {
  * block for the buffer.
  */
 BUFFER	*
-bfind(bname, cflag) register char *bname; {
+bfind(bname, cflag) register char *bname;
+int cflag;
+{
 	register BUFFER *bp;
 	register LINE	*lp;
 	int i;
@@ -548,6 +568,7 @@ bfind(bname, cflag) register char *bname
  * that are required. Return TRUE if everything
  * looks good.
  */
+int
 bclear(bp) register BUFFER *bp; {
 	register LINE	*lp;
 	register int	s;
@@ -577,7 +598,10 @@ bclear(bp) register BUFFER *bp; {
  * Display the given buffer in the given window. Flags indicated
  * action on redisplay.
  */
-showbuffer(bp, wp, flags) register BUFFER *bp; register WINDOW *wp; {
+int
+showbuffer(bp, wp, flags) register BUFFER *bp; register WINDOW *wp;
+int flags;
+{
 	register BUFFER *obp;
 	WINDOW		*owp;
 
@@ -641,7 +665,9 @@ popbuf(bp) register BUFFER *bp; {
  * Insert another buffer at dot.  Very useful.
  */
 /*ARGSUSED*/
+int
 bufferinsert(f, n)
+int f, n;
 {
 	register BUFFER *bp;
 	register LINE	*clp;
@@ -712,7 +738,9 @@ bufferinsert(f, n)
  * Turn off the dirty bit on this buffer.
  */
 /*ARGSUSED*/
+int
 notmodified(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 
@@ -736,7 +764,9 @@ notmodified(f, n)
  * Toggle the read-only bit on this buffer.
  */
 /*ARGSUSED*/
+int
 togglereadonly(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 
@@ -767,6 +797,7 @@ warnreadonly()
  * help functions.
  */
 
+int
 popbuftop(bp)
 register BUFFER *bp;
 {
@@ -791,6 +822,7 @@ register BUFFER *bp;
 #endif
 
 #ifdef USING_GETNUM
+int
 getnum(prompt, num)
 char *prompt;
 int *num;
@@ -806,6 +838,7 @@ int *num;
 #endif  /* USING_GETNUM */
 
 #ifdef  VARIABLE_TAB
+int
 set_default_tabwidth(f, n)
 int f, n;
 {
@@ -820,6 +853,7 @@ int f, n;
     return (TRUE);
 }
 
+int
 set_tabwidth(f, n)
 int f, n;
 {
@@ -839,6 +873,7 @@ int f, n;
     return (TRUE);
 }
 
+int
 set_cmode_tabwidth(f, n)
 int f, n;
 {
@@ -881,6 +916,7 @@ int len;
 }
   
 /*ARGSUSED*/
+int
 b_thiswin(f, n)
 int f, n;
 {
@@ -906,6 +942,7 @@ int f, n;
   
 /*ARGSUSED*/
 static
+int
 b_delundel(ch)
 int ch;
 {
@@ -927,6 +964,7 @@ int ch;
 }
 
 /*ARGSUSED*/
+int
 b_del(f, n)
 int f, n;
 {
@@ -934,6 +972,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 b_undel(f, n)
 int f, n;
 {
@@ -941,6 +980,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 b_expunge(f, n)
 int f, n;
 {
--- a/cmode.c
+++ b/cmode.c
@@ -93,7 +93,9 @@ static int	do_cm_brace();	/* Nov 1991. b
 int	flag_use_c_mode	= TRUE;
 
 /*ARGSUSED*/
+int
 cm_use_c_mode(f, n)
+int f, n;
 {
     register int	s;
     char	buf[NINPUT];
@@ -115,7 +117,9 @@ cm_use_c_mode(f, n)
  * COMMAND: electric-c-brace
  */
 /*ARGSUSED*/
+int
 cm_brace(f, n)
+int f, n;
 {
     return do_cm_brace(f,n,0);
 }
@@ -125,13 +129,16 @@ cm_brace(f, n)
  *   Nov 1991. Added by bsh.
  */
 /*ARGSUSED*/
+int
 cm_brace_blink(f, n)
+int f, n;
 {
     return do_cm_brace(f,n,1);
 }
 
 static int
 do_cm_brace(f, n, blink)
+int f, n, blink;
 {    
 #ifdef	READONLY	/* 91.01.05  by S.Yoshida */
     if (curbp->b_flag & BFRONLY)	/* If this buffer is read-only, */
@@ -159,7 +166,9 @@ do_cm_brace(f, n, blink)
  * COMMAND: electric-c-semi
  */
 /*ARGSUSED*/
+int
 cm_semi(f, n)
+int f, n;
 {
 #ifdef	READONLY	/* 91.01.05  by S.Yoshida */
     if (curbp->b_flag & BFRONLY)	/* If this buffer is read-only, */
@@ -180,7 +189,9 @@ cm_semi(f, n)
  * COMMAND: electric-c-terminator
  */
 /*ARGSUSED*/
+int
 cm_term(f, n)
+int f, n;
 {
     int c,i;
 
@@ -217,7 +228,9 @@ cm_term(f, n)
  * COMMAND: c-indent-command
  */
 /*ARGSUSED*/
+int
 cm_indent(f, n)
+int f, n;
 {
     int i;
     char c;
@@ -257,7 +270,9 @@ cm_indent(f, n)
  * COMMAND: c-newline-and-indent
  */
 /*ARGSUSED*/
+int
 cm_lfindent(f, n)
+int f, n;
 {
     register int	i;
     register unsigned char c;
@@ -288,7 +303,7 @@ cm_lfindent(f, n)
 }
 
 
-static calc_indent()
+static int calc_indent()
 {
     register LINE	*lp;
     register int	bo;
@@ -604,7 +619,7 @@ static calc_indent()
 }
 
 
-static adjust_spc(nicol)
+static int adjust_spc(nicol)
 int nicol;
 {
     register int	i;
@@ -663,7 +678,7 @@ int nicol;
 }
 
 
-static check_bal(balc)
+static int check_bal(balc)
 unsigned char *balc;
 {
     static struct {
@@ -693,7 +708,7 @@ unsigned char *balc;
 }
 
 
-static count_column(lp, bo)
+static int count_column(lp, bo)
 LINE *lp;
 int bo;
 {
@@ -725,7 +740,9 @@ int bo;
  * COMMAND: set-c-indent-level
  */
 /*ARGSUSED*/
+int
 cm_set_indent(f, n)
+int f, n;
 {
     if ((f & FFARG) == 0) {
     	if (getnum("c-indent-level", &n) == FALSE)
@@ -739,7 +756,9 @@ cm_set_indent(f, n)
  * COMMAND: set-c-brace-imaginary-offset
  */
 /*ARGSUSED*/
+int
 cm_set_imagin(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-brace_imaginary-offset", &n) == FALSE)
@@ -754,7 +773,9 @@ cm_set_imagin(f, n)
  * COMMAND: set-c-brace-offset
  */
 /*ARGSUSED*/
+int
 cm_set_brace(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-brace-offset", &n) == FALSE)
@@ -769,7 +790,9 @@ cm_set_brace(f, n)
  * COMMAND: set-c-argdecl-indent
  */
 /*ARGSUSED*/
+int
 cm_set_arg(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-argdecl-indent", &n) == FALSE)
@@ -784,7 +807,9 @@ cm_set_arg(f, n)
  * COMMAND: set-c-label-offset
  */
 /*ARGSUSED*/
+int
 cm_set_label(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-label-offset", &n) == FALSE)
@@ -799,7 +824,9 @@ cm_set_label(f, n)
  * COMMAND: set-c-continued-statement-offset
  */
 /*ARGSUSED*/
+int
 cm_set_cstat(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-continued-statement-offset", &n) == FALSE)
@@ -814,7 +841,9 @@ cm_set_cstat(f, n)
  * COMMAND: set-c-continued-brace-offset
  */
 /*ARGSUSED*/
+int
 cm_set_cbrace(f, n)
+int f, n;
 {
 	if ((f & FFARG) == 0) {
 		if (getnum("c-continued-brace-offset", &n) == FALSE)
@@ -831,7 +860,9 @@ cm_set_cbrace(f, n)
  * Add routine to consider "t" and "nil" argument.
  */
 /*ARGSUSED*/
+int
 cm_set_newl(f, n)
+int f, n;
 {
 	register int	s;
 	char	buf[NINPUT];
@@ -857,7 +888,9 @@ cm_set_newl(f, n)
  * Add routine to consider "t" and "nil" argument.
  */
 /*ARGSUSED*/
+int
 cm_set_tab(f, n)
+int f, n;
 {
 	register int	s;
 	char	buf[NINPUT];
@@ -881,7 +914,9 @@ cm_set_tab(f, n)
  * COMMAND: list-c-mode-variables
  */
 /*ARGSUSED*/
+int
 cm_list_var(f, n)
+int f, n;
 {
 	register BUFFER	*bp;
 	register WINDOW	*wp;
@@ -928,7 +963,9 @@ cm_list_var(f, n)
  * re-indent region.
  */
 /*ARGSUSED*/
+int
 cm_indentregion(f, n)
+int f, n;
 {
 	register LINE	*startp,*endp;
 	register int	loffs;
--- a/configure
+++ b/configure
@@ -707,6 +707,7 @@ cat > conftest.$ac_ext << EOF
 #line 708 "configure"
 #include "confdefs.h"
 
+int
 main(){return(0);}
 EOF
 if { (eval echo configure:713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
--- a/dir.c
+++ b/dir.c
@@ -60,6 +60,8 @@ extern VOID makepath pro((char *dname, c
 
 int rchdir(char *dir);
 
+int rchdir(char *dir);
+
 char	*startdir = NULL;
 char	*wdir;
 
@@ -135,7 +137,9 @@ ensurecwd pro((VOID))
  * Change current working directory
  */
 /*ARGSUSED*/
+int
 changedir(f, n)
+int f, n;
 {
     register int s;
     int len;
@@ -184,7 +188,9 @@ changedir(f, n)
  * Change current working directory
  */
 /*ARGSUSED*/
+int
 changedir(f, n)
+int f, n;
 {
     register int s;
     char bufc[NFILEN];
@@ -212,7 +218,9 @@ changedir(f, n)
  * Show current directory
  */
 /*ARGSUSED*/
+int
 showcwdir(f, n)
+int f, n;
 {
 #ifdef	EXTD_DIR
     char dirname[NFILEN];
--- a/dired.c
+++ b/dired.c
@@ -63,6 +63,7 @@ char* dirname;
 #endif	/* CHGMISC	*/
 
 /*ARGSUSED*/
+int
 dired(f, n)
 int f, n;
 {
@@ -139,6 +140,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_otherwindow(f, n)
 int f, n;
 {
@@ -173,6 +175,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_del(f, n)
 int f, n;
 {
@@ -193,6 +196,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_undel(f, n)
 int f, n;
 {
@@ -213,6 +217,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_undelbak(f, n)
 int f, n;
 {
@@ -229,6 +234,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_flag(f, n)
 int f, n;
 {
@@ -257,6 +263,7 @@ int f, n;
  */
 
 static
+int
 d_fileopen(f, n, popup)
 int f, n, popup;
 {
@@ -299,6 +306,7 @@ int f, n, popup;
 }
 
 /*ARGSUSED*/
+int
 d_findfile(f, n)
 int f, n;
 {
@@ -322,6 +330,7 @@ int f, n;
 #endif
 
 /*ARGSUSED*/
+int
 d_ffotherwindow(f, n)
 int f, n;
 {
@@ -329,6 +338,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_expunge(f, n)
 int f, n;
 {
@@ -389,6 +399,7 @@ char *path;
 }
 
 /*ARGSUSED*/
+int
 d_copy(f, n)
 int f, n;
 {
@@ -430,6 +441,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 d_rename(f, n)
 int f, n;
 {
--- a/display.c
+++ b/display.c
@@ -197,7 +197,9 @@ static SCORE	*score = NULL;
 #endif
 
 VOID
-vtsetsize(col, row) {
+vtsetsize(col, row)
+int col, row;
+{
 	register VIDEO	*vp;
 	register int	i;
 
@@ -293,7 +295,9 @@ vttidy() {
 
  */
 static VOID
-vtmove(row, col) {
+vtmove(row, col)
+int row, col;
+{
 	vtrow = row;
 	vtcol = col;
 #ifdef	KANJI	/* 90.01.29  by S.Yoshida */
@@ -1165,7 +1169,9 @@ int currow, curcol;
  * line when updating CMODE color lines, because of the way that
  * reverse video works on most terminals.
  */
-static VOID uline(row, vvp, pvp) VIDEO *vvp; VIDEO *pvp; {
+static VOID uline(row, vvp, pvp) VIDEO *vvp; VIDEO *pvp;
+int row;
+{
 #ifdef	MEMMAP
 	ttflush();	/* 90.06.09  by A.Shirahashi */
 #ifdef	SS_SUPPORT  /* 92.11.21  by S.Sasaki */
@@ -1557,6 +1563,7 @@ moderatio(wp) register WINDOW *wp; {
 /*
  * output a string to the mode line, report how long it was.
  */
+int
 vtputs(s) register char *s; {
 	register int n = 0;
 
@@ -1626,7 +1633,9 @@ hash(vp) register VIDEO *vp; {
  * bit better; but it looks ugly.
  */
 static VOID
-setscores(offs, size) {
+setscores(offs, size)
+int offs, size;
+{
 	register SCORE	*sp;
 	SCORE		*sp1;
 	register int	tempcost;
@@ -1712,7 +1721,9 @@ setscores(offs, size) {
  * which is acceptable because this routine is much less compute
  * intensive then the code that builds the score matrix!
  */
-static VOID traceback(offs, size, i, j) {
+static VOID traceback(offs, size, i, j)
+int offs, size, i, j;
+{
 	register int	itrace;
 	register int	jtrace;
 	register int	k;
--- a/echo.c
+++ b/echo.c
@@ -129,6 +129,7 @@ eerase() {
  * for "no" and TRUE for "yes". No formatting
  * services are available. No newline required.
  */
+int
 eyorn(sp) char *sp; {
 	register int	s;
 
@@ -153,6 +154,7 @@ eyorn(sp) char *sp; {
  * Like eyorn, but for more important question. User must type either all of
  * "yes" or "no", and the trainling newline.
  */
+int
 eyesno(sp) char *sp; {
 	register int	s;
 	char		buf[64];
@@ -214,6 +216,7 @@ ereply(char *fp, char *buf, int nbuf, ..
     return i;
 }
 #else	/* SUPPORT_ANSI */
+int
 ereply(va_alist)
 va_dcl
 {
@@ -255,6 +258,7 @@ eread(char *fp, char *buf, int nbuf, int
     return i;
 }
 #else	/* SUPPORT_ANSI */
+int
 eread(va_alist)
 va_dcl
 {
@@ -1079,7 +1083,7 @@ mb_insertstr(s)
   return mb_point();
 }
 
-static _mb_cmpl_msg_len   = 0;
+static int _mb_cmpl_msg_len   = 0;
 
 static VOID
 mb_insertcmplmsg(s)
@@ -2552,7 +2556,7 @@ veread_complete (buf, cpos, c, flag)
 }
 #endif  /* MINIBUF_EDIT */
 #else	/* NOT NEW_COMPLETE */
-static veread(fp, buf, nbuf, flag, ap) char *fp; char *buf; va_list *ap; {
+static int veread(fp, buf, nbuf, flag, ap) char *fp; char *buf; va_list *ap; {
 	register int	cpos;
 	register int	i;
 	register int	c;
@@ -2909,6 +2913,7 @@ register int cpos;
  * autocompleted at this point. Sometimes the two
  * symbols are the same, but this is normal.
   */
+int
 getxtra(lp1, lp2, cpos, wflag) register LIST *lp1, *lp2; register int wflag; {
 	register int	i;
 
@@ -3146,6 +3151,7 @@ register char c;
 
 #ifndef	NEW_COMPLETE	/* 90.12.10    Sawayanagi Yosirou */
 #ifndef NO_FILECOMP	/* 90.04.04  by K.Maeda */
+int
 complete_filename(buf, cpos, c)
 char *buf;
 int cpos, c;
--- a/extend.c
+++ b/extend.c
@@ -49,6 +49,7 @@ static	char	*parsetoken pro((char*));
 
 /* insert a string, mainly for use from macros (created by selfinsert) */
 /*ARGSUSED*/
+int
 insert(f, n)
 int f, n;
 {
@@ -386,6 +387,7 @@ int unbind;
  * KEYMAP *curmap rather than KEYMAP **mapp.
 */
 #ifdef	BINDKEY
+int
 bindkey(mapp, fname, keys, kcount)
 KEYMAP **mapp;
 char *fname;
@@ -419,7 +421,9 @@ int kcount;
  * This function modifies the fundamental keyboard map.
  */
 /*ARGSUSED*/
+int
 bindtokey(f, n)
+int f, n;
 {
     return dobind(map_table[0].p_map, "Global set key: ", FALSE);
 }
@@ -428,7 +432,9 @@ bindtokey(f, n)
  * This function modifies the current mode's keyboard map.
  */
 /*ARGSUSED*/
+int
 localbind(f, n)
+int f, n;
 {
     return dobind(curbp->b_modes[curbp->b_nmodes]->p_map, "Local set key: ",
 	FALSE);
@@ -438,7 +444,9 @@ localbind(f, n)
  * This function redefines a key in any keymap.
  */
 /*ARGSUSED*/
+int
 define_key(f, n)
+int f, n;
 {
     static char buf[48] = "Define key map: ";
     MAPS *mp;
@@ -453,12 +461,14 @@ define_key(f, n)
     return dobind(mp->p_map, buf, FALSE);
 }
 
+int
 unbindtokey(f, n)
 int f, n;
 {
     return dobind(map_table[0].p_map, "Global unset key: ", TRUE);
 }
 
+int
 localunbind(f, n)
 int f, n;
 {
@@ -473,7 +483,9 @@ int f, n;
  * and run the command if it is found.
  * Print an error if there is anything wrong.
  */
+int
 extend(f, n)
+int f, n;
 {
 	PF	funct;
 	int	s;
@@ -518,7 +530,9 @@ extend(f, n)
  * evalexpr - get one line from the user, and run it.
  */
 /*ARGSUSED*/
+int
 evalexpr(f, n)
+int f, n;
 {
 	int	s;
 	char	exbuf[128];
@@ -532,7 +546,9 @@ evalexpr(f, n)
  *	for testing startup files.
  */
 /*ARGSUSED*/
+int
 evalbuffer(f, n)
+int f, n;
 {
 	register LINE	*lp;
 	register BUFFER *bp = curbp;
@@ -552,7 +568,9 @@ evalbuffer(f, n)
  *	go get your own startup file if need be.
  */
 /*ARGSUSED*/
+int
 evalfile(f, n)
+int f, n;
 {
 	register int	s;
 	char		fname[NFILEN];
@@ -573,6 +591,7 @@ evalfile(f, n)
 /*
  * load - go load the file name we got passed.
  */
+int
 load(fname) char *fname; {
 	int	s = TRUE;
 	int	nbytes;
@@ -617,6 +636,7 @@ load(fname) char *fname; {
  * if FKEYS is defined, duplicate functionallity of dobind so function
  * key values don't have to fit in type char.
  */
+int
 excline(line)
 register char *line;
 {
--- a/file.c
+++ b/file.c
@@ -48,7 +48,9 @@ static	char *itos();
  * insertfile routine with the file name.
  */
 /*ARGSUSED*/
+int
 fileinsert(f, n)
+int f, n;
 {
 	register int	s;
 	char		fname[NFILEN];
@@ -79,6 +81,7 @@ fileinsert(f, n)
  * poptofile.
  */
 static
+int
 fileopen(f, n, readonly, popup, prompt)
 int f, n, readonly, popup;
 char *prompt;
@@ -198,7 +201,9 @@ char *prompt;
  * text, and switch to the new buffer.
  */
 /*ARGSUSED*/
+int
 filevisit(f, n)
+int f, n;
 {
   return fileopen(f, n, FALSE, FALSE, "Find file: ");
 }
@@ -209,7 +214,9 @@ filevisit(f, n)
  * popbuf instead of showbuffer.
  */
 /*ARGSUSED*/
+int
 poptofile(f, n)
+int f, n;
 {
   return fileopen(f, n, FALSE, TRUE, "Find file in other window: ");
 }
@@ -225,7 +232,9 @@ poptofile(f, n)
  * This function is based on filevisit().
  */
 /*ARGSUSED*/
+int
 filereadonly(f, n)
+int f, n;
 {
   return fileopen(f, n, TRUE, FALSE, "Find file read-only: ");
 }
@@ -308,6 +317,7 @@ unsigned num;
  * for unsaved changes. This is called by the "read" command, the
  * "visit" command, and the mainline (for "uemacs file").
  */
+int
 readin(fname) char *fname; {
 	register int		status;
 	register WINDOW		*wp;
@@ -367,6 +377,7 @@ readin(fname) char *fname; {
  * read in, but not on a new file (you don't need to make a backup
  * copy of nothing).
  */
+int
 insertfile(fname, newname) char fname[], newname[]; {
 	register LINE	*lp1 = (LINE *)NULL;
 	register LINE	*lp2;
@@ -681,7 +692,9 @@ int len;
  * with ITS EMACS.
  */
 /*ARGSUSED*/
+int
 filewrite(f, n)
+int f, n;
 {
 	register int	s;
 	char		fname[NFILEN];
@@ -775,7 +788,9 @@ static int	makebackup = MAKEBACKUP;
 #endif
 
 /*ARGSUSED*/
+int
 filesave(f, n)
+int f, n;
 {
 	return buffsave(curbp);
 }
@@ -789,6 +804,7 @@ filesave(f, n)
  * Allow user to select whether or not to make backup files
  * by looking at the value of makebackup.
  */
+int
 buffsave(bp) BUFFER *bp; {
 	register int	s;
 #ifndef NO_BACKUP	/* 90.02.14  by S.Yoshida */
@@ -860,7 +876,9 @@ buffsave(bp) BUFFER *bp; {
  * is #defined.
  */
 /*ARGSUSED*/
+int
 makebkfile(f, n)
+int f, n;
 {
 	if(f & FFARG) makebackup = n > 0;
 	else makebackup = !makebackup;
@@ -876,6 +894,7 @@ makebkfile(f, n)
  * in the "fileio.c" package. Most of the grief
  * is checking of some sort.
  */
+int
 writeout(bp, fn) register BUFFER *bp; char *fn; {
 	register int	s;
 
--- a/help.c
+++ b/help.c
@@ -27,7 +27,9 @@ static	VOID	bindfound();
  * currently bound to the key.
  */
 /*ARGSUSED*/
+int
 desckey(f, n)
+int f, n;
 {
     register KEYMAP *curmap;
     register PF funct;
@@ -106,7 +108,9 @@ static BUFFER	*bp;
 static char buf[80];	/* used by showall and findbind */
 
 /*ARGSUSED*/
+int
 wallchart(f, n)
+int f, n;
 {
 	int m;
 	static char locbind[80] = "Local keybindings for mode ";
@@ -189,6 +193,7 @@ KEYMAP	*map;
 
 int help_help pro((int, int));
 
+int
 help_help(f, n)
 int f, n;
 {
@@ -222,6 +227,7 @@ static char buf2[128];
 static char *buf2p;
 
 /*ARGSUSED*/
+int
 apropos_command(f, n)
 int f, n;
 {
--- a/jump.c
+++ b/jump.c
@@ -82,6 +82,7 @@ static	char *grab_filename();
 /*
  *
  */
+int
 set_regexp( pat )
     char *pat;
 {
@@ -107,8 +108,10 @@ set_regexp( pat )
     return TRUE;
 }
 
+int
 parse_error_message( clp, col, namebuf, ip, parse_end )
     LINE *clp;
+    int col;
     char *namebuf;
     int *ip, *parse_end;
 {
@@ -157,7 +160,9 @@ parse_error_message( clp, col, namebuf,
  * jump-to-error
  * Parse current line as a error message, then vist correspoding source code.
  */
+int
 jumptoerror(f,n)
+int f, n;
 {
     int  lineno;
     char buf[BUFLEN+1];
@@ -261,7 +266,9 @@ grab_filename( buf )
  * "compile" command.
  */
 /*ARGSUSED*/
+int
 compile(f, n)
+int f, n;
 {
     register BUFFER	*bp, *obp;
     register WINDOW	*wp, *owp;
@@ -307,7 +314,9 @@ compile(f, n)
  * goto next error using *compilation* buffer.
  */
 /*ARGSUSED*/
+int
 nexterror(f, n)
+int f, n;
 {
     register BUFFER	*bp, *obp;
     register WINDOW	*wp, *owp;
--- a/kanji.c
+++ b/kanji.c
@@ -242,7 +242,9 @@ int bufstoe_c pro((char *p, int len));
  * changed rotaly. (NIL -> NOCONV -> SJIS -> JIS -> EUC -> UTF-8)
  */
 /*ARGSUSED*/
+int
 k_rot_fio(f, n)
+int f, n;
 {
 	if (global_kfio == NIL) {
 		global_kfio = NOCONV;
@@ -266,7 +268,9 @@ k_rot_fio(f, n)
  * file I/O KANJI code.
  */
 /*ARGSUSED*/
+int
 k_set_fio(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -290,7 +294,9 @@ k_set_fio(f, n)
  * is changed rotaly. (NIL -> NOCONV -> SJIS -> JIS -> EUC -> UTF-8)
  */
 /*ARGSUSED*/
+int
 k_rot_buffio(f, n)
+int f, n;
 {
 	if (curbp->b_kfio == NIL) {
 		curbp->b_kfio = NOCONV;
@@ -315,7 +321,9 @@ k_rot_buffio(f, n)
  * local file I/O KANJI code.
  */
 /*ARGSUSED*/
+int
 k_set_buffio(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -340,7 +348,9 @@ k_set_buffio(f, n)
  * expected file input KANJI code.
  */
 /*ARGSUSED*/
+int
 k_set_expect(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -364,7 +374,9 @@ k_set_expect(f, n)
  * is changed rotaly. (NOCONV -> SJIS -> JIS -> EUC -> UTF8)
  */
 /*ARGSUSED*/
+int
 k_rot_input(f, n)
+int f, n;
 {
 	if (global_kinput == NOCONV) {
 		global_kinput = SJIS;
@@ -387,7 +399,9 @@ k_rot_input(f, n)
  * keyboard input KANJI code.
  */
 /*ARGSUSED*/
+int
 k_set_input(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -413,7 +427,9 @@ k_set_input(f, n)
  * changed rotaly. (NOCONV -> SJIS -> JIS -> EUC -> UTF8)
  */
 /*ARGSUSED*/
+int
 k_rot_display(f, n)
+int f, n;
 {
 	if (global_kdisplay == NOCONV) {
 		global_kdisplay = SJIS;
@@ -436,7 +452,9 @@ k_rot_display(f, n)
  * display KANJI code.
  */
 /*ARGSUSED*/
+int
 k_set_display(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -461,7 +479,9 @@ k_set_display(f, n)
  * buffer.
  */
 /*ARGSUSED*/
+int
 k_list_code(f, n)
+int f, n;
 {
 	register BUFFER	*bp;
 	register WINDOW	*wp;
@@ -536,7 +556,9 @@ k_list_code(f, n)
  * mini buffer.
  */
 /*ARGSUSED*/
+int
 k_show_code(f, n)
+int f, n;
 {
 	char	buf[80];
 	char	*bp;
@@ -575,7 +597,9 @@ k_show_code(f, n)
  * KANJI select char for a file.
  */
 /*ARGSUSED*/
+int
 k_set_tokfio(f, n)
+int f, n;
 {
 	int	s;
 
@@ -598,7 +622,9 @@ k_set_tokfio(f, n)
  * ASCII select char for a file.
  */
 /*ARGSUSED*/
+int
 k_set_toafio(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -622,7 +648,9 @@ k_set_toafio(f, n)
  * KANA select char for a file.
  */
 /*ARGSUSED*/
+int
 k_set_tokanafio(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -645,7 +673,9 @@ k_set_tokanafio(f, n)
  * KANA select char for a display.
  */
 /*ARGSUSED*/
+int
 k_set_tokanadisplay(f, n)
+int f, n;
 {
 	int	s;
 
@@ -669,7 +699,9 @@ k_set_tokanadisplay(f, n)
  * KANJI select char for a display.
  */
 /*ARGSUSED*/
+int
 k_set_tokdisplay(f, n)
+int f, n;
 {
 	int	s;
 
@@ -692,7 +724,9 @@ k_set_tokdisplay(f, n)
  * ASCII select char for a display.
  */
 /*ARGSUSED*/
+int
 k_set_toadisplay(f, n)
+int f, n;
 {
 	int	s;
 
@@ -827,6 +861,7 @@ BUFFER	*bp;
 /*
  * Show file I/O, input, display KANJI code into mode line.
  */
+int
 kdispbufcode(bp)
 register BUFFER	*bp;
 {
@@ -861,6 +896,7 @@ kgetkeyflush()
 #endif
 }
 
+int
 kgetkey()
 {
 	static	int kselected = SELROMA;
@@ -1073,6 +1109,7 @@ static int	kanadselected = FALSE;
 /*
  * Output one byte to the display with KANJI code conversion.
  */
+int
 kttputc(c)
 register int	c;	/* 90.07.25  Add "register". by S.Yoshida */
 {
@@ -1452,6 +1489,7 @@ register BUFFER	*bp;
  * When file KANJI code is not decided, we check and determine it
  * to see a text line.
  */
+int
 kcodeconv(buf, len, bp)
 register char	*buf;
 register int	len;
@@ -1486,6 +1524,7 @@ register BUFFER	*bp;
  * to see a text line.
  */
 #ifdef  SS_SUPPORT /* 92.11.21  by S.Sasaki */
+int
 kcodecount(buf, len)
 register char	*buf;
 register int	len;
@@ -1588,6 +1627,7 @@ int	len;
  * KANJI/ASCII selecting escape sequence is striped. So converted
  * EUC text must be shorter than sorce JIS code text.
  */
+int
 bufjtoe(j, len)
 char	*j;				/* JIS code text.	*/
 int	len;
@@ -1679,6 +1719,7 @@ int	len;
  * Convert KANJI code from Shift-JIS to EUC of the text in a buffer.
  */
 #ifdef  HANKANA  /* 92.11.21  by S.Sasaki */
+int
 bufstoe(p, len)
 char	*p;
 int	len;
@@ -1948,6 +1989,7 @@ int	len;
 /*
  * Is current position char KANJI ?
  */
+int
 iskanji()
 {
 	return(ISKANJI(lgetc(curwp->w_dotp, curwp->w_doto)));
@@ -1957,6 +1999,7 @@ iskanji()
 /*
  * Is current position char Hojo KANJI ?
  */
+int
 ishojo()
 {
 	return(ISHOJO(lgetc(curwp->w_dotp, curwp->w_doto)));
@@ -1968,6 +2011,7 @@ ishojo()
  * This routine return TRUE when c1 is ASCII char,
  * but it doesn't happen now.
  */
+int
 iskword(c1, c2)
 register int	c1;
 register int	c2;
@@ -1978,6 +2022,7 @@ register int	c2;
 /*
  * Get char category of current position char.
  */
+int
 getcategory()
 {
 	return(charcategory(lgetc(curwp->w_dotp, curwp->w_doto),
@@ -2005,6 +2050,7 @@ int	dir;
  * start position char's one (now in a word), or it is HIRAGANA
  * added to the end of that word.
  */
+int
 incategory()
 {
 	register int	cat;
@@ -2029,6 +2075,7 @@ incategory()
 /*
  * Return char category of one char.
  */
+int
 charcategory(c1, c2)
 register int	c1;
 register int	c2;
--- a/kbd.c
+++ b/kbd.c
@@ -67,7 +67,9 @@ int use_metakey = TRUE;
 /*
  * Toggle the value of use_metakey
  */
+int
 do_meta(f, n)
+int f, n;
 {
 	if(f & FFARG)	use_metakey = n > 0;
 	else		use_metakey = !use_metakey;
@@ -87,7 +89,9 @@ static int bs_map = BSMAP;
 /*
  * Toggle backspace mapping
  */
+int
 bsmap(f, n)
+int f, n;
 {
 	if(f & FFARG)	bs_map = n > 0;
 	else		bs_map = ! bs_map;
@@ -197,6 +201,7 @@ register int	c;
     return funct;
 }
 
+int
 doin()
 {
     KEYMAP	*curmap;
@@ -253,6 +258,7 @@ doin()
 #endif
 }
 
+int
 rescan(f, n)
 int f, n;
 {
@@ -316,6 +322,7 @@ int f, n;
 
 int universal_argument pro((int, int));
 
+int
 universal_argument(f, n)
 int f, n;
 {
@@ -352,6 +359,7 @@ int f, n;
 }
 
 /*ARGSUSED*/
+int
 digit_argument(f, n)
 int f, n;
 {
@@ -387,6 +395,7 @@ int f, n;
     return (*funct)(FFOTHARG, nn);
 }
 
+int
 negative_argument(f, n)
 int f, n;
 {
@@ -432,6 +441,7 @@ int	no_k2nd = 0;			/* We have no KANJI 2
 int	inkfill = FALSE;		/* Now we are in a fillword().	*/
 #endif	/* KANJI */
 
+int
 selfinsert(f, n)
 int f, n;
 {
@@ -667,7 +677,9 @@ int f, n;
  * this could be implemented as a keymap with everthing defined
  * as self-insert.
  */
+int
 quote(f, n)
+int f, n;
 {
     register int c;
 
--- a/keymap.c
+++ b/keymap.c
@@ -1746,9 +1746,10 @@ int	nfunct = NFUNCT;		/* used by help.c
 #define ROUND2(x) (x<128?(x<64?32:64):(x<256?128:256))
 
 #ifdef	NEW_COMPLETE	/* 90.12.10    Sawayanagi Yosirou */
+int
 name_fent(fname, flag)
 #else	/* NOT NEW_COMPLETE */
-static	name_fent(fname, flag)
+static int name_fent(fname, flag)
 #endif	/* NEW_COMPLETE */
 register char *fname;
 int	flag;
--- a/kinsoku.c
+++ b/kinsoku.c
@@ -75,7 +75,9 @@ static int	neolkc = 20;		/* Number of EO
  * in the *Kinsoku Chars* buffer.
  */
 /*ARGSUSED*/
+int
 kc_list_char(f, n)
+int f, n;
 {
 	register unsigned short	*p;	/* KINSOKU char list pointer.	*/
 	register unsigned short	*eop;	/* End of KINSOKU char list.	*/
@@ -173,7 +175,9 @@ kc_list_char(f, n)
  * (kinsoku-bol-chars = bolkchar[]).
  */
 /*ARGSUSED*/
+int
 kc_add_bol(f, n)
+int f, n;
 {
 	register int	s;
 	register short	c;
@@ -207,7 +211,9 @@ kc_add_bol(f, n)
  * (kinsoku-bol-chars = bolkchar[]).
  */
 /*ARGSUSED*/
+int
 kc_del_bol(f, n)
+int f, n;
 {
 	register int	s;
 	register short	c;
@@ -241,7 +247,9 @@ kc_del_bol(f, n)
  * (kinsoku-eol-chars = eolkchar[]).
  */
 /*ARGSUSED*/
+int
 kc_add_eol(f, n)
+int f, n;
 {
 	register int	s;
 	register short	c;
@@ -275,7 +283,9 @@ kc_add_eol(f, n)
  * (kinsoku-eol-chars = eolkchar[]).
  */
 /*ARGSUSED*/
+int
 kc_del_eol(f, n)
+int f, n;
 {
 	register int	s;
 	register short	c;
@@ -371,6 +381,7 @@ int		nkc;			/* Current number of KINSOKU
  * Is this BOL (begin of line) KINSOKU char ?
  * c1 must be KANJI 1st byte or 0 (when c2 is ASCII).
  */
+int
 isbolkchar(c1, c2)
 int	c1;
 int	c2;
@@ -394,6 +405,7 @@ int	c2;
  * Is this EOL (end of line) KINSOKU char ?
  * c1 must be KANJI 1st byte or 0 (when c2 is ASCII).
  */
+int
 iseolkchar(c1, c2)
 int	c1;
 int	c2;
--- a/line.c
+++ b/line.c
@@ -218,8 +218,10 @@ lchange(flag) register int flag; {
  * the place where you did the insert. Return TRUE
  * if all is well, and FALSE on errors.
  */
+int
 linsert(n, c)
 int n;
+int c;
 {
 	register char	*cp1;
 	register char	*cp2;
@@ -349,6 +351,7 @@ int n;
  * at the current location of dot in the current
  * window.  The funny ass-backwards way is no longer used.
  */
+int
 lnewline()
 {
 	register LINE	*lp1;
@@ -453,7 +456,10 @@ lnewline()
  * the KANJI 2nd byte is also deleted.
 #endif
  */
-ldelete(n, kflag) RSIZE n; {
+int
+ldelete(n, kflag) RSIZE n;
+int kflag;
+{
 	register char	*cp1;
 	register char	*cp2;
 	register LINE	*dotp;
@@ -636,6 +642,7 @@ ldelete(n, kflag) RSIZE n; {
  * about in memory. Return FALSE on error and TRUE if all
  * looks ok.
  */
+int
 ldelnewline() {
 	register LINE	*lp1;
 	register LINE	*lp2;
@@ -708,6 +715,7 @@ ldelnewline() {
  * There is a casehack disable flag (normally it likes to match
  * case of replacement to what was there).
  */
+int
 lreplace(plen, st, f)
 register RSIZE	plen;			/* length to remove		*/
 char		*st;			/* replacement string		*/
@@ -841,7 +849,10 @@ kdelete() {
  * well, and FALSE on errors. Print a message on
  * errors. Dir says whether to put it at back or front.
  */
-kinsert(c, dir) {
+int
+kinsert(c, dir)
+int c, dir;
+{
 
 	if (kused == ksize && dir == KFORW && kgrow(FALSE) == FALSE)
 		return FALSE;
@@ -857,7 +868,10 @@ kinsert(c, dir) {
  * kgrow - just get more kill buffer for the callee. back is true if
  * we are trying to get space at the beginning of the kill buffer.
  */
-kgrow(back) {
+int
+kgrow(back)
+int back;
+{
 	register int	nstart;
 	register char	*nbufp;
 
@@ -889,7 +903,10 @@ kgrow(back) {
  * off the end, it returns "-1". This lets the caller
  * just scan along until it gets a "-1" back.
  */
-kremove(n) {
+int
+kremove(n)
+int n;
+{
 	if (n < 0 || n + kstart >= kused)
 		return -1;
 	return CHARMASK(kbufp[n + kstart]);
--- a/macro.c
+++ b/macro.c
@@ -18,6 +18,7 @@
 #include "macro.h"
 
 /*ARGSUSED*/
+int
 definemacro(f, n)
 int	f, n;
 {
@@ -46,6 +47,7 @@ int	f, n;
 int finishmacro pro((int, int));
 
 /*ARGSUSED*/
+int
 finishmacro(f, n)
 int	f, n;
 {
@@ -55,6 +57,7 @@ int	f, n;
 }
 
 /*ARGSUSED*/
+int
 executemacro(f, n)
 int	f, n;
 {
--- a/main.c
+++ b/main.c
@@ -58,6 +58,7 @@ static VOID	edinit();
 VOID
 Main(int argc, char**argv)
 #else	/* WIN32 */
+int
 main(argc, argv)
 int  argc;
 char **argv;
@@ -305,7 +306,9 @@ edinit() {
  * to "C-X C-C".
  */
 /*ARGSUSED*/
+int
 quit(f, n)
+int f, n;
 {
 	register int	s;
 	VOID		vttidy();
@@ -331,7 +334,9 @@ quit(f, n)
  * nothing.
  */
 /*ARGSUSED*/
+int
 ctrlg(f, n)
+int f, n;
 {
 	return ABORT;
 }
--- a/match.c
+++ b/match.c
@@ -62,7 +62,9 @@ static struct balance {
  * if any.  Bound to "blink-matching-paren-command".
  */
 
+int
 showmatch(f, n)
+int f, n;
 {
 	register int  i, s;
 	LINE *clp;
@@ -84,7 +86,9 @@ showmatch(f, n)
  * goto-matching-fence a la kemacs.
  *  Nov 1991. Added by bsh.
  */
+int
 gotomatch(f,n)
+int f, n;
 {
 	LINE *clp;
 	int cbo;
@@ -106,6 +110,7 @@ gotomatch(f,n)
 
 
 /* bsh: Mainly for cm_brace_blink */
+int
 blinkmatch( clp, cbo )
 LINE *clp;
 int cbo;
@@ -120,6 +125,7 @@ int cbo;
 }
 
 static
+int
 getmatch( clp, cbo, mlp, mbo, dir )
 register LINE *clp;
 register int cbo;
--- a/modes.c
+++ b/modes.c
@@ -68,12 +68,16 @@ char *mode;
     return TRUE;
 }
 
+int
 indentmode(f, n)
+int f, n;
 {
     return changemode(f, n, "indent");
 }
 
+int
 fillmode(f, n)
+int f, n;
 {
 #ifdef	KANJI	/* 90.01.29  by S.Yoshida */
     if(changemode(f, n, "fill") == FALSE) return FALSE;
@@ -90,12 +94,16 @@ fillmode(f, n)
 /*
  * Fake the GNU "blink-matching-paren" variable.
  */
+int
 blinkparen(f, n)
+int f, n;
 {
     return changemode(f, n, "blink");
 }
 
+int
 notabmode(f, n)
+int f, n;
 {
     if(changemode(f, n, "notab") == FALSE) return FALSE;
     if(f & FFARG) {
@@ -106,7 +114,9 @@ notabmode(f, n)
 }
 
 #ifdef C_MODE	/* 90.07.24  by K.Takano */
+int
 cmode(f, n)
+int f, n;
 {
 #ifdef VARIABLE_TAB
     extern int cmode_tab;
@@ -119,6 +129,7 @@ cmode(f, n)
 }
 #endif
 
+int
 overwrite(f, n)
 int f, n;
 {
@@ -130,6 +141,7 @@ int f, n;
     return TRUE;
 }
 
+int
 set_default_mode(f, n)
 int f, n;
 {
--- a/paragraph.c
+++ b/paragraph.c
@@ -61,7 +61,9 @@ static char fillprefix[PREFIXLENGTH] = {
 #endif
  */
 /*ARGSUSED*/
+int
 gotobop(f, n)
+int f, n;
 {
 	if (n < 0)	/* the other way...*/
 		return gotoeop(f, -n);
@@ -107,7 +109,9 @@ gotobop(f, n)
 #endif
  */
 /*ARGSUSED*/
+int
 gotoeop(f, n)
+int f, n;
 {
 	if (n < 0)	/* the other way...*/
 		return gotobop(f, -n);
@@ -157,7 +161,9 @@ gotoeop(f, n)
 #endif
  */
 /*ARGSUSED*/
+int
 fillpara(f, n)
+int f, n;
 {
 	register int	c;		/* current char durring scan	*/
 	register int	wordlen;	/* length of current word	*/
@@ -513,7 +519,9 @@ fillpara(f, n)
 
 /* delete n paragraphs starting with the current one */
 /*ARGSUSED*/
+int
 killpara(f, n)
+int f, n;
 {
 	register int status;	/* returned status of functions */
 
@@ -562,7 +570,9 @@ killpara(f, n)
 #endif
  */
 /*ARGSUSED*/
+int
 fillword(f, n)
+int f, n;
 {
 	register char	c;
 	register int	col, i, nce;
@@ -759,7 +769,10 @@ fillword(f, n)
 }
 
 /* Set fill column to n. */
-setfillcol(f, n) {
+int
+setfillcol(f, n)
+int f, n;
+{
 	extern int	getcolpos() ;
 
 #ifdef	BUGFIX	/* 90.02.14  by S.Yoshida */
@@ -775,7 +788,10 @@ setfillcol(f, n) {
 /*
  * Set fill-prefix strings.
  */
-setfillprefix(f, n) {
+int
+setfillprefix(f, n)
+int f, n;
+{
 	register char	c;
 	register int	col, i;
 #ifdef  VARIABLE_TAB
--- a/random.c
+++ b/random.c
@@ -55,7 +55,9 @@
  * This is normally bound to "C-X =".
  */
 /*ARGSUSED*/
+int
 showcpos(f, n)
+int f, n;
 {
 	register LINE	*clp;
 	register long	nchar;
@@ -123,6 +125,7 @@ showcpos(f, n)
 	return TRUE;
 }
 
+int
 getcolpos() {
 	register int	col, i, c;
 #ifdef	SS_SUPPORT /* 92.11.21  by S.Sasaki */
@@ -186,7 +189,9 @@ getcolpos() {
  * "WFEDIT" is good enough.
  */
 /*ARGSUSED*/
+int
 twiddle(f, n)
+int f, n;
 {
 	register LINE	*dotp;
 	register int	doto;
@@ -280,7 +285,9 @@ twiddle(f, n)
  * this is bound to "C-O".
  */
 /*ARGSUSED*/
+int
 openline(f, n)
+int f, n;
 {
 	register int	i;
 	register int	s;
@@ -316,7 +323,9 @@ openline(f, n)
  * more efficient.
  */
 /*ARGSUSED*/
+int
 newline(f, n)
+int f, n;
 {
 #ifndef	BUGFIX	/* 90.02.14  by S.Yoshida */
 	register LINE	*lp;
@@ -358,7 +367,9 @@ newline(f, n)
  * is bound to "C-X C-O". Any argument is ignored.
  */
 /*ARGSUSED*/
+int
 deblank(f, n)
+int f, n;
 {
 	register LINE	*lp1;
 	register LINE	*lp2;
@@ -388,7 +399,10 @@ deblank(f, n)
 /*
  * Delete any whitespace around dot, then insert a space.
  */
-justone(f, n) {
+int
+justone(f, n)
+int f, n;
+{
 #ifdef	READONLY	/* 91.01.05  by S.Yoshida */
 	if (curbp->b_flag & BFRONLY) {	/* If this buffer is read-only, */
 		warnreadonly();		/* do only displaying warning.	*/
@@ -402,7 +416,9 @@ justone(f, n) {
  * Delete any whitespace around dot.
  */
 /*ARGSUSED*/
+int
 delwhite(f, n)
+int f, n;
 {
 	register int	col, c, s;
 
@@ -442,7 +458,9 @@ delwhite(f, n)
  * to "C-J".
  */
 /*ARGSUSED*/
+int
 indent(f, n)
+int f, n;
 {
 	register int	nicol;
 	register int	c;
@@ -493,7 +511,9 @@ indent(f, n)
  * Normally bound to "C-D".
  */
 /*ARGSUSED*/
+int
 forwdel(f, n)
+int f, n;
 {
 #ifdef	READONLY	/* 91.01.05  by S.Yoshida */
 	if (curbp->b_flag & BFRONLY) {	/* If this buffer is read-only, */
@@ -520,7 +540,9 @@ forwdel(f, n)
  * if presented with an argument.
  */
 /*ARGSUSED*/
+int
 backdel(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -559,7 +581,10 @@ backdel(f, n)
  * then it kills back abs(arg) lines.
  */
 /*ARGSUSED*/
-killline(f, n) {
+int
+killline(f, n)
+int f, n;
+{
 	register RSIZE	chunk;
 	register LINE	*nextp;
 	register int	i, c;
@@ -619,7 +644,10 @@ killline(f, n) {
 /*	Kill oneline by S.Sasaki May-05-1992	*/
 /*						*/
 
-killoneline(f, n) {
+int
+killoneline(f, n)
+int f, n;
+{
 	register RSIZE	chunk;
 	register LINE	*nextp;
 	register int	i;
@@ -683,7 +711,9 @@ killoneline(f, n) {
  * text landed off screen).
  */
 /*ARGSUSED*/
+int
 yank(f, n)
+int f, n;
 {
 	register int	c;
 	register int	i;
@@ -786,6 +816,7 @@ yank(f, n)
 }
 
 /*ARGSUSED*/
+int
 space_to_tabstop(f, n)
 int f, n;
 {
@@ -819,7 +850,9 @@ int f, n;
  * of forwsearch() (M-x search-forward). Global buffer `pat' is used
  * for interface.
  */
+int
 zaptochar(f,n)
+int f, n;
 {
 	int c;
 	RSIZE	nbytes;
@@ -929,7 +962,9 @@ notfound:
  * Count lines in the current page. (Now, page is same as buffer)
  */
 /*ARGSUSED*/
+int
 pagelines(f, n)
+int f, n;
 {
 	register LINE	*lp;
 	register int	prelines;
@@ -969,7 +1004,9 @@ pagelines(f, n)
  * Count lines in the current region.
  */
 /*ARGSUSED*/
+int
 regionlines(f, n)
+int f, n;
 {
 	register LINE	*lp;
 	register int	totallines;
--- a/re_search.c
+++ b/re_search.c
@@ -141,7 +141,10 @@ static unsigned char upcase[0400] =
  * If not found, it just prints a message.
  */
 /*ARGSUSED*/
-re_forwsearch(f, n) {
+int
+re_forwsearch(f, n)
+int f, n;
+{
 	register int	s;
 
 	if ((s=re_readpattern("RE Search")) != TRUE)
@@ -162,7 +165,10 @@ re_forwsearch(f, n) {
  * was matched].
  */
 /*ARGSUSED*/
-re_backsearch(f, n) {
+int
+re_backsearch(f, n)
+int f, n;
+{
 	register int	s;
 
 	if ((s=re_readpattern("RE Search backward")) != TRUE)
@@ -187,7 +193,10 @@ re_backsearch(f, n) {
 /*  This code has problems-- some incompatibility(?) with
     extend.c causes match to fail when it should not.
  */
-re_searchagain(f, n) {
+int
+re_searchagain(f, n)
+int f, n;
+{
 
   if (re_srch_lastdir == SRCH_NOPR) {
     ewprintf("No last search");
@@ -231,7 +240,10 @@ static struct re_registers regs;
  *	Replace strings selectively.  Does a search and replace operation.
  */
 /*ARGSUSED*/
-re_queryrepl(f, n) {
+int
+re_queryrepl(f, n)
+int f, n;
+{
 	register int	s;
 	register int	rcnt = 0;	/* Replacements made so far	*/
 	register int	plen;		/* length of found string	*/
@@ -337,6 +349,7 @@ stopsearch:
 /* Maximum length of replacement string */
 #define REPLEN 256
 
+int
 re_doreplace(plen, st, f)
      register RSIZE  plen;		     /* length to remove	     */
      char	     *st;		     /* replacement string	     */
@@ -427,6 +440,7 @@ re_doreplace(plen, st, f)
  * is notified of the change, and TRUE is returned. If the
  * string isn't found, FALSE is returned.
  */
+int
 re_forwsrch() {
 
   register LINE *clp;
@@ -481,6 +495,7 @@ re_forwsrch() {
  * is notified of the change, and TRUE is returned. If the
  * string isn't found, FALSE is returned.
  */
+int
 re_backsrch() {
 
   register LINE *clp;
@@ -535,6 +550,7 @@ char m[1];
  * Display the old pattern, in the style of Jeff Lomicka. There is
  * some do-it-yourself control expansion.
  */
+int
 re_readpattern(prompt) char *prompt; {
 	register int s;
 	char tpat[NPAT];
@@ -572,7 +588,10 @@ re_readpattern(prompt) char *prompt; {
 /* Cause case to not matter in searches.  This is the default.	If
  * called with argument cause case to matter.
  */
-setcasefold(f, n) {
+int
+setcasefold(f, n)
+int f, n;
+{
 
   if (f & FFARG) {
     casefoldsearch = FALSE;
@@ -596,7 +615,10 @@ setcasefold(f, n) {
 
 /* Delete all lines after dot that contain a string matching regex
  */
-delmatchlines(f, n) {
+int
+delmatchlines(f, n)
+int f, n;
+{
   int s;
 
   if ((s=re_readpattern("Flush lines (containing match for regexp)")) != TRUE)
@@ -611,7 +633,10 @@ delmatchlines(f, n) {
 
 /* Delete all lines after dot that don't contain a string matching regex
  */
-delnonmatchlines(f, n) {
+int
+delnonmatchlines(f, n)
+int f, n;
+{
   int s;
 
 
@@ -626,6 +651,7 @@ delnonmatchlines(f, n) {
 
 
 /* This function does the work of deleting matching lines */
+int
 killmatches(cond)
    int cond;
 {
@@ -671,7 +697,10 @@ killmatches(cond)
 }
 
 #ifndef	BUGFIX	/* 91.01.09  by S.Yoshida */
-petersfunc(f, n) {
+int
+petersfunc(f, n)
+int f, n;
+{
 
   int s;
   LINE	*clp;
@@ -687,7 +716,10 @@ petersfunc(f, n) {
 
 /* Count lines matching regex
  */
-cntmatchlines(f, n) {
+int
+cntmatchlines(f, n)
+int f, n;
+{
   int s;
 
   if ((s=re_readpattern("Count lines (matching regexp)")) != TRUE)
@@ -702,7 +734,10 @@ cntmatchlines(f, n) {
 
 /* Count lines that fail to match regex
  */
-cntnonmatchlines(f, n) {
+int
+cntnonmatchlines(f, n)
+int f, n;
+{
   int s;
 
 
@@ -717,6 +752,7 @@ cntnonmatchlines(f, n) {
 
 
 /* This function does the work of counting matching lines */
+int
 countmatches(cond)
    int cond;
 {
--- a/regex_j.c
+++ b/regex_j.c
@@ -259,6 +259,7 @@ static int obscure_syntax = 0;
 
 int
 re_set_syntax (syntax)
+int syntax;
 {
   int ret;
 
--- a/region.c
+++ b/region.c
@@ -31,7 +31,9 @@ int getregion pro((REGION*));
 static int setsize pro((REGION*,RSIZE));
 
 #ifdef	CHGMISC		/* 97.11.10 by M.Suzuki	*/
+int
 copywordregion(f, n)
+int f, n;
 {
 	setmark(f, n);
 	forwword(f,n);
@@ -45,7 +47,9 @@ copywordregion(f, n)
  * Move "." to the start, and kill the characters.
  */
 /*ARGSUSED*/
+int
 killregion(f, n)
+int f, n;
 {
 	register int	s;
 	REGION		region;
@@ -79,7 +83,9 @@ extern int receive_clipboard(void);
  * by a yank.
  */
 /*ARGSUSED*/
+int
 copyregion(f, n)
+int f, n;
 {
 	register LINE	*linep;
 	register int	loffs;
@@ -119,7 +125,9 @@ copyregion(f, n)
  * by a yank for whole buffer.
  */
 /*ARGSUSED*/
+int
 copybuffer(f, n)
+int f, n;
 {
   register LINE	*linep, *elinep;
   register int	loffs;
@@ -169,7 +177,9 @@ copybuffer(f, n)
  * redisplay is done in all buffers.
  */
 /*ARGSUSED*/
+int
 lowerregion(f, n)
+int f, n;
 {
 	register LINE	*linep;
 	register int	loffs;
@@ -214,7 +224,9 @@ lowerregion(f, n)
  * redisplay is done in all buffers.
  */
 /*ARGSUSED*/
+int
 upperregion(f, n)
+int f, n;
 {
 	register LINE	*linep;
 	register int	loffs;
@@ -265,6 +277,7 @@ upperregion(f, n)
  * get an ABORT status, because I might add a "if regions is big,
  * ask before clobberring" flag.
  */
+int
 getregion(rp) register REGION *rp; {
 	register LINE	*flp;
 	register LINE	*blp;
@@ -350,7 +363,9 @@ static char prefix_string[PREFIXLENGTH]
  */
 
 /*ARGSUSED*/
+int
 prefixregion(f, n)
+int f, n;
 {
 	register int	s;
 	register LINE	*first, *last;
@@ -409,7 +424,9 @@ prefixregion(f, n)
  */
 
 /*ARGSUSED*/
+int
 setprefix(f, n)
+int f, n;
 {
 	char		buf[PREFIXLENGTH];
 	register int	s;
--- a/search.c
+++ b/search.c
@@ -96,7 +96,9 @@ int	casefoldsearch = TRUE;
  * If not found, it just prints a message.
  */
 /*ARGSUSED*/
+int
 forwsearch(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -118,7 +120,9 @@ forwsearch(f, n)
  * was matched].
  */
 /*ARGSUSED*/
+int
 backsearch(f, n)
+int f, n;
 {
 	register int	s;
 
@@ -139,7 +143,9 @@ backsearch(f, n)
  * to go.
  */
 /*ARGSUSED*/
+int
 searchagain(f, n)
+int f, n;
 {
 	if (srch_lastdir == SRCH_FORW) {
 		if (forwsrch() == FALSE) {
@@ -164,7 +170,9 @@ searchagain(f, n)
  * isearch ignores any explicit arguments.
  */
 /*ARGSUSED*/
+int
 forwisearch(f, n)
+int f, n;
 {
 	return isearch(SRCH_FORW);
 }
@@ -174,7 +182,9 @@ forwisearch(f, n)
  * isearch ignores any explicit arguments.
  */
 /*ARGSUSED*/
+int
 backisearch(f, n)
+int f, n;
 {
 	return isearch(SRCH_BACK);
 }
@@ -192,7 +202,10 @@ backisearch(f, n)
  *	Metakeys  set mark, exit search
  *	else	accumulate into search string
  */
-isearch(dir) {
+int
+isearch(dir)
+int dir;
+{
 	register int	c;
 	register LINE	*clp;
 	register int	cbo;
@@ -564,7 +577,9 @@ is_find(dir) register int dir; {
  * made the checking vanish.
  */
 static VOID
-is_prompt(dir, flag, success) {
+is_prompt(dir, flag, success)
+int dir, flag, success;
+{
 	if (dir == SRCH_FORW) {
 		if (success != FALSE)
 			is_dspl("I-search", flag);
@@ -584,7 +599,9 @@ is_prompt(dir, flag, success) {
  * whether pat should be printed.
  */
 static VOID
-is_dspl(prompt, flag) char *prompt; {
+is_dspl(prompt, flag) char *prompt;
+int flag;
+{
 
 	if (flag != FALSE)
 		ewprintf("%s: ", prompt);
@@ -595,6 +612,7 @@ is_dspl(prompt, flag) char *prompt; {
 #ifdef	IS_ENHANCE
 static int
 is_fail(code)
+int code;
 {
 	return code == SRCH_ACCM || code <= SRCH_CHUNK_BASE &&
 		SRCH_CHUNK_FAIL(code);
@@ -603,6 +621,7 @@ is_fail(code)
 
 static int
 is_addword(pptr,dir)
+int pptr, dir;
 {
 	int oo = curwp->w_doto;
 	LINE *op = curwp->w_dotp;
@@ -698,7 +717,9 @@ is_addword(pptr,dir)
  *	Replace strings selectively.  Does a search and replace operation.
  */
 /*ARGSUSED*/
+int
 queryrepl(f, n)
+int f, n;
 {
 	register int	s;
 	register int	rcnt = 0;	/* Replacements made so far	*/
@@ -801,6 +822,7 @@ stopsearch:
  * is notified of the change, and TRUE is returned. If the
  * string isn't found, FALSE is returned.
  */
+int
 forwsrch() {
 	register LINE	*clp;
 	register int	cbo;
@@ -866,6 +888,7 @@ forwsrch() {
  * is notified of the change, and TRUE is returned. If the
  * string isn't found, FALSE is returned.
  */
+int
 backsrch() {
 	register LINE	*clp;
 	register int	cbo;
@@ -962,6 +985,7 @@ register int bc, pc;
  * Display the old pattern, in the style of Jeff Lomicka. There is
  * some do-it-yourself control expansion.
  */
+int
 readpattern(prompt) char *prompt; {
 	register int	s;
 	char		tpat[NPAT];
--- a/shell.c
+++ b/shell.c
@@ -21,7 +21,9 @@
 
 #ifndef NO_SHELL
 /*ARGSUSED*/
+int
 shellcmnd(f, n)
+int f, n;
 {
 	char	buf[CMDLINELENGTH];
 	char	*result;
--- a/skg.c
+++ b/skg.c
@@ -326,7 +326,9 @@ get_scanf(k1, k2, f, key, kanji)
     return TRUE;
 }
 
+int
 skginput(f, n)
+int f, n;
 {
     char istr[KEY_BUFFER_SIZE];
     char dstr[KEY_BUFFER_SIZE];
@@ -391,6 +393,7 @@ skginput(f, n)
 static int
 convert_to_hiragana(dstr, keystr, size)
     char *dstr, *keystr;
+    int size;
 {
     register char *ptr = keystr;
     clear_string(dstr);
@@ -1048,7 +1051,9 @@ compare_keystring(istr, tmpstr, tmprstr,
     }
 }
 
+int
 skg_set_romanname(f, n)
+int f, n;
 {
     char file[NFILEN];
     int s;
@@ -1079,7 +1084,9 @@ skg_set_romanname(f, n)
 }
 
 
+int
 skg_set_dicname(f, n)
+int f, n;
 {
     char file[NFILEN];
     int s;
--- a/sys/default/tty.c
+++ b/sys/default/tty.c
@@ -107,6 +107,7 @@ int	SG;	/* number of glitches, 0 for inv
  */
 static char tcbuf[1024];
 
+int
 ttinit() {
 	char *tv_stype;
 	char *t, *p, *tgetstr();
@@ -206,6 +207,7 @@ ttinit() {
  * query the display for the increment, and put it
  * back to what it was.
  */
+int
 tttidy() {
 	if (TE && *TE) putpad(TE, 1);	/* set the term back to normal mode */
 	putpad(tgoto(CM, 0, ttrow), 1);	/* not nrow */
@@ -222,7 +224,10 @@ tttidy() {
  * have left the cursor in the right
  * location last time!
  */
-ttmove(row, col) {
+int
+ttmove(row, col)
+int row, col;
+{
 	if (ttrow!=row || ttcol!=col) {
 	putpad(tgoto(CM, col, row), 1);
 	ttrow = row;
@@ -233,6 +238,7 @@ ttmove(row, col) {
 /*
  * Erase to end of line.
  */
+int
 tteeol() {
 	if(CE) putpad(CE, 1);
 	else {
@@ -245,6 +251,7 @@ tteeol() {
 /*
  * Erase to end of page.
  */
+int
 tteeop() {
 	if(CD) putpad(CD, nrow - ttrow);
 	else
@@ -267,6 +274,7 @@ tteeop() {
 /*
  * Make a noise.
  */
+int
 ttbeep() {
 	ttputc(BEL);
 	ttflush();
@@ -280,7 +288,10 @@ ttbeep() {
  * If no scrolling region, use a set
  * of insert and delete line sequences
  */
-ttinsl(row, bot, nchunk) {
+int
+ttinsl(row, bot, nchunk)
+int row, bot, nchunk;
+{
 	register int	i, nl;
 
 	if (row == bot) {		/* Case of one line insert is	*/
@@ -319,7 +330,9 @@ ttinsl(row, bot, nchunk) {
  * lines.  The presence of the echo area makes a
  * boundry condition go away.
  */
+int
 ttdell(row, bot, nchunk)
+int row, bot, nchunk;
 {
 	register int	i, nl;
 
@@ -385,6 +398,7 @@ ttwindow(int top, int bot)
  * This behavior seems to work right on systems
  * where you can set your terminal size.
  */
+int
 ttnowindow()
 {
 	if (CS) {
@@ -405,6 +419,7 @@ ttnowindow()
  * line by line basis, so don't bother sending
  * out the color shift.
  */
+int
 ttcolor(color) register int color; {
 	if (color != tthue) {
 	if (color == CTEXT) {		/* Normal video.	*/
@@ -425,6 +440,7 @@ ttcolor(color) register int color; {
  * with a screen NROW by NCOL. Look in "window.c" to
  * see how the caller deals with a change.
  */
+int
 ttresize() {
 	setttysize();			/* found in "ttyio.c",	*/
 					/* ask OS for tty size	*/
@@ -436,7 +452,7 @@ ttresize() {
 }
 
 #ifdef NO_RESIZE
-static setttysize() {
+static int setttysize() {
 	nrow = tgetnum("li");
 	ncol = tgetnum("co");
 }
--- a/sys/unix/fileio.c
+++ b/sys/unix/fileio.c
@@ -59,9 +59,12 @@ char	*adjustname();
 
 VOID kputc(int c, FILE *fp, int kfio);
 
+VOID kputc(int c, FILE *fp, int kfio);
+
 /*
  * Open a file for reading.
  */
+int
 ffropen(fn) char *fn; {
     if ((ffp=fopen(fn, "r")) == NULL)
 	return (FIOFNF);
@@ -73,6 +76,7 @@ ffropen(fn) char *fn; {
  * Return TRUE if all is well, and
  * FALSE on error (cannot create).
  */
+int
 ffwopen(fn) char *fn; {
     if ((ffp=fopen(fn, "w")) == NULL) {
 	ewprintf("Cannot open file for writing");
@@ -85,6 +89,7 @@ ffwopen(fn) char *fn; {
  * Close a file.
  * Should look at the status.
  */
+int
 ffclose() {
     (VOID) fclose(ffp);
     return (FIOSUC);
@@ -97,6 +102,7 @@ ffclose() {
  * Check only at the newline and
  * end of buffer.
  */
+int
 ffputbuf(bp)
 BUFFER *bp;
 {
@@ -148,6 +154,7 @@ BUFFER *bp;
  * line.  When FIOEOF is returned, there is a valid line
  * of data without the normally implied \n.
  */
+int
 ffgetline(buf, nbuf, nbytes)
 register char	*buf;
 register int	nbuf;
@@ -179,6 +186,7 @@ register int	*nbytes;
  * right thing here; I don't care that much as
  * I don't enable backups myself.
  */
+int
 fbackupfile(fn) char *fn; {
     register char	*nname;
     
@@ -202,6 +210,7 @@ fbackupfile(fn) char *fn; {
 /*
  * Get file mode of a file fn.
  */
+int
 fgetfilemode(fn)
 char	*fn;
 {
@@ -214,6 +223,7 @@ char	*fn;
 /*
  * Set file mode of a file fn to the specified mode.
  */
+int
 fsetfilemode(fn, mode)
 char	*fn;
 int	mode;
@@ -234,6 +244,7 @@ int	mode;
 /*
  * Check whether file is read-only of a file fn.
  */
+int
 fchkreadonly(fn)
 char	*fn;
 {
@@ -521,6 +532,7 @@ notfound:
 #ifndef CP_CMD
 #define CP_CMD	"/bin/cp"
 #endif
+int
 copy(frname, toname)
 char *frname, *toname;
 {
@@ -615,9 +627,11 @@ char *dirname;
     return bp;
 }
 
+int
 d_makename(lp, fn, buflen)
 register LINE *lp;
 register char *fn;
+int buflen;
 {
   char* cp;
   int l,l1,len;
@@ -687,6 +701,7 @@ register char *fn;
 #ifndef RMDIR_CMD
 #define RMDIR_CMD "/bin/rmdir"
 #endif
+int
 unlinkdir(f)	/* System V Release 2 don't have rmdir(2)? */
 char *f;
 {
@@ -707,6 +722,7 @@ char *f;
 #ifndef MV_CMD
 #define MV_CMD "/bin/mv"
 #endif
+int
 rename(f1, f2)	/* System V Release 2/3 don't have rename(2)? */
 char *f1, *f2;
 {
@@ -734,6 +750,7 @@ char *f1, *f2;
 /*
  * Check whether file "dn" is directory.
  */
+int
 ffisdir(dn)
 char *dn;
 {
@@ -769,6 +786,7 @@ char *dn;
 
 #define	MALLOC_STEP	256
 
+int
 fffiles(name, buf)
 char *name, **buf;
 {
@@ -926,6 +944,7 @@ VOID
 autosave_name(buff, name, buflen)
 char* buff;
 char* name;
+int buflen;
 {
     strcpy(buff, name);
     if (strlen(name)) {
--- a/sys/unix/spawn.c
+++ b/sys/unix/spawn.c
@@ -41,6 +41,13 @@
 #ifdef	HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef	HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+int ttraw(void);
+int ttcooked(void);
+int refresh(int f, int n);
 
 int ttraw(void);
 int ttcooked(void);
@@ -76,7 +83,10 @@ extern	char	*getenv();
  *	    work with the ksh.
  */
 /*ARGSUSED*/
-spawncli(f, n) {
+int
+spawncli(f, n)
+int f, n;
+{
     register pid_t	pid, wpid;
 #ifdef	SIGTSTP
 #ifdef	HAVE_SIGPROCMASK
--- a/sys/unix/ttyio.c
+++ b/sys/unix/ttyio.c
@@ -77,6 +77,12 @@ int refresh(int f, int n);
 void setttysize(void);
 VOID canna_width(void);
 
+int ttraw(void);
+int ttcooked(void);
+int refresh(int f, int n);
+void setttysize(void);
+VOID canna_width(void);
+
 #ifdef	ADDFUNC	/* 90.02.14  by S.Yoshida */
 #include	<signal.h>		/* 90.02.13: For SIGWINCH.	*/
 #include	<sys/ioctl.h>		/* 00.04.03: amura		*/
@@ -137,6 +143,7 @@ char kbdq;			/* char we've already read
  * stolen to send signals. Use CBREAK mode, and set all
  * characters but start and stop to 0xFF.
  */
+int
 ttopen() {
     register char *tv_stype;
     char *getenv(), *tgetstr(), tcbuf[2048], err_str[72];
@@ -291,6 +298,7 @@ ttraw() {
  *    Under UN*X this just calls ttcooked(), but the ttclose() hook is in
  * because vttidy() in display.c expects it for portability reasons.
  */
+int
 ttclose() {
     if (ttcooked() == FALSE)
 	panic("");		/* ttcooked() already printf'd */
@@ -346,6 +354,7 @@ ttcooked() {
  * Characters are buffered up, to make things
  * a little bit more efficient.
  */
+int
 ttputc(c)
 int c;
 {
@@ -357,6 +366,7 @@ int c;
 /*
  * Flush output.
  */
+int
 ttflush() {
     char *p = obuf;
     int outlen;
@@ -379,6 +389,7 @@ static	int	keybuf[4];		/* Ungetc charact
  * All 8 bits are returned, so that you can use
  * a multi-national terminal.
  */
+int
 ttgetc() {
 #ifdef	HAVE_SELECT
     char buf[1];
@@ -413,6 +424,7 @@ ttgetc() {
 /*
  * Save pre-readed char to read again.
  */
+int
 ttungetc(c)
 int	c;
 {
@@ -460,6 +472,7 @@ ttwinch()
  * typeahead returns TRUE if there are characters available to be read
  * in.
  */
+int
 typeahead() {
 #ifdef	KANJI	/* 90.02.05  by S.Yoshida */
     if (nkey > 0) {
@@ -499,6 +512,7 @@ typeahead() {
 /*
  * panic - just exit, as quickly as we can.
  */
+int
 panic(s) char *s; {
 	(void) fputs("panic: ", stderr);
 	(void) fputs(s, stderr);
@@ -551,6 +565,7 @@ static VOID alrm()
 /*
  * Return TRUE if we wait without doing anything, else return FALSE.
  */
+int
 ttwait()
 {
     VOID alrm();
--- a/undo.c
+++ b/undo.c
@@ -206,6 +206,7 @@ RSIZE size;
 
 int
 do_undo(f, n)
+int f, n;
 {
     register char *p;
     register int  i;
--- a/version.c
+++ b/version.c
@@ -90,6 +90,7 @@ char version[] = PROGNAME " " VERSION "
  * is copy the version string onto the echo line.
  */
 /*ARGSUSED*/
+int
 showversion(f, n)
 int f, n;
 {
@@ -250,6 +251,7 @@ static	char *asl_msg = "\tASL\t\t(Enable
  * Display the Ng version, compile time options.
  */
 /*ARGSUSED*/
+int
 showngversion(f, n)
 int f, n;
 {
@@ -458,6 +460,7 @@ int f, n;
 /*
  * Print the Ng version to the stdout.
  */
+int
 printversion()
 {
 #ifdef	WIN32
@@ -478,6 +481,7 @@ printversion()
 /*
  * Print the Ng compile time options.
  */
+int
 printoptions()
 {
 #ifndef	WIN32
--- a/window.c
+++ b/window.c
@@ -27,7 +27,9 @@
  * and works like in Gosling.
  */
 /*ARGSUSED*/
+int
 reposition(f, n)
+int f, n;
 {
 #ifndef GOSREC
 	curwp->w_force = (f & FFARG) ? (n>=0 ? n+1 : n) : 0;
@@ -91,7 +93,9 @@ refresh(int f, int n)
  * the screen.
  */
 /*ARGSUSED*/
+int
 nextwind(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 
@@ -112,7 +116,9 @@ nextwind(f, n)
  * if there is 1 window.
  */
 /*ARGSUSED*/
+int
 prevwind(f, n)
+int f, n;
 {
 	register WINDOW *wp1;
 	register WINDOW *wp2;
@@ -141,7 +147,9 @@ prevwind(f, n)
  * become undisplayed.
  */
 /*ARGSUSED*/
+int
 onlywind(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 	register LINE	*lp;
@@ -189,7 +197,9 @@ onlywind(f, n)
  * for the new window.
  */
 /*ARGSUSED*/
+int
 splitwind(f, n)
+int f, n;
 {
 	register WINDOW *wp;
 	register LINE	*lp;
@@ -285,7 +295,9 @@ splitwind(f, n)
  * because dot would move.
  */
 /*ARGSUSED*/
+int
 enlargewind(f, n)
+int f, n;
 {
 	register WINDOW *adjwp;
 	register LINE	*lp;
@@ -343,7 +355,9 @@ enlargewind(f, n)
  * the window descriptions. Ask the redisplay to
  * do all the hard work.
  */
+int
 shrinkwind(f, n)
+int f, n;
 {
 	register WINDOW *adjwp;
 	register LINE	*lp;
@@ -405,7 +419,9 @@ shrinkwind(f, n)
  * updating, then throw away the window.
  */
 /*ARGSUSED*/
+int
 delwind(f, n)
+int f, n;
 {
 	register WINDOW *wp, *nwp;
 
--- a/word.c
+++ b/word.c
@@ -40,7 +40,9 @@
  * routines.
  */
 /*ARGSUSED*/
+int
 backword(f, n)
+int f, n;
 {
 	if (n < 0) return forwword(f | FFRAND, -n);
 	if (backchar(FFRAND, 1) == FALSE)
@@ -69,7 +71,9 @@ backword(f, n)
  * motion is done by "forwchar".
  */
 /*ARGSUSED*/
+int
 forwword(f, n)
+int f, n;
 {
 	if (n < 0)
 		return backword(f | FFRAND, -n);
@@ -97,7 +101,9 @@ forwword(f, n)
  * convert any characters to upper case.
  */
 /*ARGSUSED*/
+int
 upperword(f, n)
+int f, n;
 {
 	register int	c;
 
@@ -142,7 +148,9 @@ upperword(f, n)
  * convert characters to lower case.
  */
 /*ARGSUSED*/
+int
 lowerword(f, n)
+int f, n;
 {
 	register int	c;
 
@@ -189,7 +197,9 @@ lowerword(f, n)
  * if you try and move past the end of the buffer.
  */
 /*ARGSUSED*/
+int
 capword(f, n)
+int f, n;
 {
 	register int	c;
 	VOID		lchange();
@@ -247,7 +257,9 @@ capword(f, n)
  * Kill forward by "n" words.
  */
 /*ARGSUSED*/
+int
 delfword(f, n)
+int f, n;
 {
 	register RSIZE	size;
 	register LINE	*dotp;
@@ -319,7 +331,9 @@ out:
  * to "M-Backspace".
  */
 /*ARGSUSED*/
+int
 delbword(f, n)
+int f, n;
 {
 	register RSIZE	size;
 	VOID		kdelete();
@@ -383,6 +397,7 @@ out:
  * part of a word. The word character list is hard
  * coded. Should be setable.
  */
+int
 inword() {
 /* can't use lgetc in ISWORD due to bug in OSK cpp */
 #ifdef	KANJI	/* 90.01.29  by S.Yoshida */
