summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2002-07-01 14:33:45 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2002-07-01 14:33:45 +0000
commit71da5f1d37bd5729124da3b8463f6a40f4bcf32a (patch)
tree5600e9a19938d9748a59389c7d3344fdbf94f478 /usr.bin/mg
parent63f71dfa7943dfa479d153789b8501d6cd17a098 (diff)
KNF + ansi; from zyrnix (only the easy part of his diffs)
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/cinfo.c39
-rw-r--r--usr.bin/mg/def.h22
-rw-r--r--usr.bin/mg/dir.c8
-rw-r--r--usr.bin/mg/echo.c6
-rw-r--r--usr.bin/mg/extend.c5
-rw-r--r--usr.bin/mg/file.c31
-rw-r--r--usr.bin/mg/grep.c14
-rw-r--r--usr.bin/mg/help.c6
-rw-r--r--usr.bin/mg/kbd.c39
-rw-r--r--usr.bin/mg/line.c7
-rw-r--r--usr.bin/mg/macro.c11
-rw-r--r--usr.bin/mg/main.c10
-rw-r--r--usr.bin/mg/modes.c24
13 files changed, 92 insertions, 130 deletions
diff --git a/usr.bin/mg/cinfo.c b/usr.bin/mg/cinfo.c
index 8ae29418c8f..580a38184af 100644
--- a/usr.bin/mg/cinfo.c
+++ b/usr.bin/mg/cinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cinfo.c,v 1.9 2002/05/06 19:22:38 deraadt Exp $ */
+/* $OpenBSD: cinfo.c,v 1.10 2002/07/01 14:33:44 vincent Exp $ */
/*
* Character class tables.
@@ -18,67 +18,67 @@
* standard "ctype" macros cannot ask.
*/
const char cinfo[256] = {
- _MG_C, _MG_C, _MG_C, _MG_C, /* 0x0X */
+ _MG_C, _MG_C, _MG_C, _MG_C, /* 0x0X */
_MG_C, _MG_C, _MG_C, _MG_C,
_MG_C, _MG_C, _MG_C, _MG_C,
_MG_C, _MG_C, _MG_C, _MG_C,
- _MG_C, _MG_C, _MG_C, _MG_C, /* 0x1X */
+ _MG_C, _MG_C, _MG_C, _MG_C, /* 0x1X */
_MG_C, _MG_C, _MG_C, _MG_C,
_MG_C, _MG_C, _MG_C, _MG_C,
_MG_C, _MG_C, _MG_C, _MG_C,
- 0, _MG_P, 0, 0, /* 0x2X */
+ 0, _MG_P, 0, 0, /* 0x2X */
_MG_W, _MG_W, 0, _MG_W,
0, 0, 0, 0,
0, 0, _MG_P, 0,
- _MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W, /* 0x3X */
+ _MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W, /* 0x3X */
_MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W, _MG_D | _MG_W,
_MG_D | _MG_W, _MG_D | _MG_W, 0, 0,
0, 0, 0, _MG_P,
- 0, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0x4X */
+ 0, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0x4X */
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
- _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0x5X */
+ _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0x5X */
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, 0,
0, 0, 0, 0,
- 0, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0x6X */
+ 0, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0x6X */
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
- _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0x7X */
+ _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0x7X */
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, 0,
0, 0, 0, _MG_C,
- 0, 0, 0, 0, /* 0x8X */
+ 0, 0, 0, 0, /* 0x8X */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
- 0, 0, 0, 0, /* 0x9X */
+ 0, 0, 0, 0, /* 0x9X */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
- 0, 0, 0, 0, /* 0xAX */
+ 0, 0, 0, 0, /* 0xAX */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
- 0, 0, 0, 0, /* 0xBX */
+ 0, 0, 0, 0, /* 0xBX */
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
- _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0xCX */
+ _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0xCX */
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
- 0, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0xDX */
+ 0, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, /* 0xDX */
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W, _MG_U | _MG_W,
_MG_U | _MG_W, _MG_U | _MG_W, 0, _MG_W,
- _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0xEX */
+ _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0xEX */
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
- 0, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0xFX */
+ 0, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, /* 0xFX */
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W, _MG_L | _MG_W,
_MG_L | _MG_W, _MG_L | _MG_W, 0, 0
@@ -87,7 +87,7 @@ const char cinfo[256] = {
/*
* Find the name of a keystroke. Needs to be changed to handle 8-bit printing
* characters and function keys better. Returns a pointer to the terminating
- * '\0'.
+ * '\0'. Returns NULL on failure.
*/
char *
keyname(char *cp, size_t len, int k)
@@ -132,8 +132,7 @@ keyname(char *cp, size_t len, int k)
*cp++ = (k & 7) + '0';
*cp = '\0';
return cp;
- }
- if (k < ' ') {
+ } else if (k < ' ') {
*cp++ = 'C';
*cp++ = '-';
k = CCHR(k);
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h
index 349487c440f..ae77751c48b 100644
--- a/usr.bin/mg/def.h
+++ b/usr.bin/mg/def.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: def.h,v 1.42 2002/06/21 00:54:55 vincent Exp $ */
+/* $OpenBSD: def.h,v 1.43 2002/07/01 14:33:44 vincent Exp $ */
#include <sys/queue.h>
@@ -200,11 +200,11 @@ typedef struct MGWIN {
* Because commands set bits in the "w_flag", update will see
* all change flags, and do the most general one.
*/
-#define WFFORCE 0x01 /* Force reframe. */
-#define WFMOVE 0x02 /* Movement from line to line. */
-#define WFEDIT 0x04 /* Editing within a line. */
-#define WFHARD 0x08 /* Better to a full display. */
-#define WFMODE 0x10 /* Update mode line. */
+#define WFFORCE 0x01 /* Force reframe. */
+#define WFMOVE 0x02 /* Movement from line to line. */
+#define WFEDIT 0x04 /* Editing within a line. */
+#define WFHARD 0x08 /* Better to a full display. */
+#define WFMODE 0x10 /* Update mode line. */
struct undo_rec;
@@ -252,13 +252,13 @@ typedef struct BUFFER {
#define b_bufp b_list.l_p.x_bp
#define b_bname b_list.l_name
-#define BFCHG 0x01 /* Changed. */
-#define BFBAK 0x02 /* Need to make a backup. */
+#define BFCHG 0x01 /* Changed. */
+#define BFBAK 0x02 /* Need to make a backup. */
#ifdef NOTAB
-#define BFNOTAB 0x04 /* no tab mode */
+#define BFNOTAB 0x04 /* no tab mode */
#endif
-#define BFOVERWRITE 0x08 /* overwrite mode */
-#define BFREADONLY 0x10 /* read only mode */
+#define BFOVERWRITE 0x08 /* overwrite mode */
+#define BFREADONLY 0x10 /* read only mode */
/*
diff --git a/usr.bin/mg/dir.c b/usr.bin/mg/dir.c
index 85778d3ad42..d9b9721a914 100644
--- a/usr.bin/mg/dir.c
+++ b/usr.bin/mg/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.8 2002/03/11 13:02:56 vincent Exp $ */
+/* $OpenBSD: dir.c,v 1.9 2002/07/01 14:33:44 vincent Exp $ */
/*
* Name: MG 2a
@@ -19,7 +19,7 @@ static char cwd[NFILEN];
void
dirinit(void)
{
- if (!(wdir = getcwd(cwd, sizeof(cwd))))
+ if ((wdir = getcwd(cwd, sizeof(cwd))) == NULL)
panic("Can't get current directory!");
}
@@ -36,12 +36,12 @@ changedir(int f, int n)
if ((s = ereply("Change default directory: ", bufc, NPAT)) != TRUE)
return (s);
if (bufc[0] == '\0')
- (void) strlcpy(bufc, wdir, sizeof bufc);
+ (void)strlcpy(bufc, wdir, sizeof bufc);
if (chdir(bufc) == -1) {
ewprintf("Can't change dir to %s", bufc);
return (FALSE);
} else {
- if (!(wdir = getcwd(cwd, sizeof(cwd))))
+ if ((wdir = getcwd(cwd, sizeof(cwd))) == NULL)
panic("Can't get current directory!");
ewprintf("Current directory is now %s", wdir);
return (TRUE);
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index 793b3603f20..a8b00847e28 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.21 2002/03/11 13:02:56 vincent Exp $ */
+/* $OpenBSD: echo.c,v 1.22 2002/07/01 14:33:44 vincent Exp $ */
/*
* Echo line reading and writing.
@@ -194,7 +194,7 @@ veread(const char *fp, char *buf, int nbuf, int flag, va_list ap)
switch (c) {
case CCHR('J'):
c = CCHR('M');
- /* and continue */
+ /* FALLTHROUGH */
case CCHR('M'): /* return, done */
if ((flag & EFFUNC) != 0) {
if ((i = complt(flag, c, buf, cpos)) == 0)
@@ -288,7 +288,7 @@ veread(const char *fp, char *buf, int nbuf, int flag, va_list ap)
case CCHR('\\'):
case CCHR('Q'): /* quote next */
c = getkey(FALSE);
- /* and continue */
+ /* FALLTHROUGH */
default: /* all the rest */
if (cpos < nbuf - 1) {
buf[cpos++] = (char)c;
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c
index b7841d0faa5..43626488f20 100644
--- a/usr.bin/mg/extend.c
+++ b/usr.bin/mg/extend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extend.c,v 1.26 2002/06/21 05:37:20 vincent Exp $ */
+/* $OpenBSD: extend.c,v 1.27 2002/07/01 14:33:44 vincent Exp $ */
/*
* Extended (M-X) commands, rebinding, and startup file processing.
@@ -507,8 +507,7 @@ unbindtokey(int f, int n)
}
int
-localunbind(f, n)
- int f, n;
+localunbind(int f, int n)
{
return dobind(curbp->b_modes[curbp->b_nmodes]->p_map,
"Local unset key: ", TRUE);
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index 72c786731ab..c4cfaefea5e 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.19 2002/06/19 22:02:08 vincent Exp $ */
+/* $OpenBSD: file.c,v 1.20 2002/07/01 14:33:44 vincent Exp $ */
/*
* File commands.
@@ -103,7 +103,7 @@ findbuffer(char *fname)
{
BUFFER *bp;
char bname[NBUFN];
- unsigned int count, remain, i;
+ unsigned int count, remain, i;
for (bp = bheadp; bp != NULL; bp = bp->b_bufp) {
if (strcmp(bp->b_fname, fname) == 0)
@@ -128,7 +128,7 @@ readin(char *fname)
{
MGWIN *wp;
int status, i;
- PF *ael;
+ PF *ael;
/* might be old */
if (bclear(curbp) != TRUE)
@@ -184,9 +184,7 @@ static char *line = NULL;
static int linesize = 0;
int
-insertfile(fname, newname, needinfo)
- char *fname, *newname;
- int needinfo;
+insertfile(char *fname, char *newname, int needinfo)
{
BUFFER *bp;
LINE *lp1, *lp2;
@@ -220,7 +218,7 @@ insertfile(fname, newname, needinfo)
opos = curwp->w_doto;
/* open a new line, at point, and start inserting after it */
- lnewline();
+ (void)lnewline();
olp = lback(curwp->w_dotp);
if (olp == curbp->b_linep) {
/* if at end of buffer, create a line to insert before */
@@ -352,8 +350,7 @@ out: lp2 = NULL;
*/
/* ARGSUSED */
int
-filewrite(f, n)
- int f, n;
+filewrite(int f, int n)
{
int s;
char fname[NFILEN];
@@ -389,8 +386,7 @@ static int makebackup = MAKEBACKUP;
/* ARGSUSED */
int
-filesave(f, n)
- int f, n;
+filesave(int f, int n)
{
return buffsave(curbp);
}
@@ -404,8 +400,7 @@ filesave(f, n)
* the value of makebackup.
*/
int
-buffsave(bp)
- BUFFER *bp;
+buffsave(BUFFER *bp)
{
int s;
@@ -454,8 +449,7 @@ buffsave(bp)
*/
/* ARGSUSED */
int
-makebkfile(f, n)
- int f, n;
+makebkfile(int f, int n)
{
if (f & FFARG)
makebackup = n > 0;
@@ -481,9 +475,7 @@ makebkfile(f, n)
* "fileio.c" package. Most of the grief is checking of some sort.
*/
int
-writeout(bp, fn)
- BUFFER *bp;
- char *fn;
+writeout(BUFFER *bp, char *fn)
{
int s;
@@ -507,8 +499,7 @@ writeout(bp, fn)
* mode line updated.
*/
void
-upmodes(bp)
- BUFFER *bp;
+upmodes(BUFFER *bp)
{
MGWIN *wp;
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index 093f11c2f09..a3418dd2cd6 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.5 2002/03/18 01:22:31 vincent Exp $ */
+/* $OpenBSD: grep.c,v 1.6 2002/07/01 14:33:44 vincent Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -77,11 +77,11 @@ grep(int f, int n)
BUFFER *bp;
MGWIN *wp;
- strlcpy(prompt, "grep -n ", sizeof prompt);
+ (void)strlcpy(prompt, "grep -n ", sizeof prompt);
if (eread("Run grep: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT)
return ABORT;
- snprintf(command, sizeof command, "%s /dev/null", prompt);
+ (void)snprintf(command, sizeof command, "%s /dev/null", prompt);
if ((bp = compile_mode("*grep*", command)) == NULL)
return FALSE;
@@ -100,11 +100,11 @@ compile(int f, int n)
BUFFER *bp;
MGWIN *wp;
- strlcpy(prompt, "make ", sizeof prompt);
+ (void)strlcpy(prompt, "make ", sizeof prompt);
if (eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT)
return ABORT;
- snprintf(command, sizeof command, "%s 2>&1", prompt);
+ (void)snprintf(command, sizeof command, "%s 2>&1", prompt);
if ((bp = compile_mode("*compile*", command)) == NULL)
return FALSE;
@@ -127,7 +127,7 @@ gid(int f, int n)
if (eread("Run gid (with args): ", prompt, NFILEN, EFNEW|EFCR) == ABORT)
return ABORT;
- snprintf(command, sizeof command, "gid %s", prompt);
+ (void)snprintf(command, sizeof command, "gid %s", prompt);
if ((bp = compile_mode("*gid*", command)) == NULL)
return FALSE;
@@ -199,7 +199,7 @@ retry:
if ((line = malloc(len + 1)) == NULL)
return FALSE;
- memcpy(line, curwp->w_dotp->l_text, len);
+ (void)memcpy(line, curwp->w_dotp->l_text, len);
line[len] = '\0';
lp = line;
diff --git a/usr.bin/mg/help.c b/usr.bin/mg/help.c
index f16bc79441d..cabbb05894b 100644
--- a/usr.bin/mg/help.c
+++ b/usr.bin/mg/help.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: help.c,v 1.18 2002/06/21 05:37:20 vincent Exp $ */
+/* $OpenBSD: help.c,v 1.19 2002/07/01 14:33:44 vincent Exp $ */
/*
* Help functions for Mg 2
@@ -141,7 +141,7 @@ showall(BUFFER *bp, KEYMAP *map, char *prefix)
if (fun == rescan || fun == selfinsert)
continue;
keyname(buf, sizeof(buf), c);
- snprintf(key, sizeof key, "%s%s ", prefix, buf);
+ (void)snprintf(key, sizeof key, "%s%s ", prefix, buf);
if (fun == NULL) {
if (showall(bp, newmap, key) == FALSE)
return FALSE;
@@ -229,7 +229,7 @@ findbind(KEYMAP *map, PF fun, char *buf, size_t len)
if (nfun == NULL) {
if (findbind(newmap, fun, buf2, sizeof(buf2)) == TRUE) {
keyname(key, sizeof(key), c);
- snprintf(buf, len, "%s %s", key, buf2);
+ (void)snprintf(buf, len, "%s %s", key, buf2);
return TRUE;
}
}
diff --git a/usr.bin/mg/kbd.c b/usr.bin/mg/kbd.c
index cf593ae296d..1006c1c293a 100644
--- a/usr.bin/mg/kbd.c
+++ b/usr.bin/mg/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.13 2002/02/21 15:27:29 deraadt Exp $ */
+/* $OpenBSD: kbd.c,v 1.14 2002/07/01 14:33:44 vincent Exp $ */
/*
* Terminal independent keyboard handling.
@@ -34,8 +34,7 @@ MAP_ELEMENT *ele;
* Toggle the value of use_metakey
*/
int
-do_meta(f, n)
- int f, n;
+do_meta(int f, int n)
{
if (f & FFARG)
use_metakey = n > 0;
@@ -52,8 +51,7 @@ static int bs_map = BSMAP;
* Toggle backspace mapping
*/
int
-bsmap(f, n)
- int f, n;
+bsmap(int f, int n)
{
if (f & FFARG)
bs_map = n > 0;
@@ -65,8 +63,7 @@ bsmap(f, n)
#endif /* BSMAP */
void
-ungetkey(c)
- int c;
+ungetkey(int c)
{
#ifdef DO_METAKEY
if (use_metakey && pushed && c == CCHR('['))
@@ -78,8 +75,7 @@ ungetkey(c)
}
int
-getkey(flag)
- int flag;
+getkey(int flag)
{
int c;
@@ -132,10 +128,7 @@ getkey(flag)
* keymap element the keyboard was found in as a side effect.
*/
PF
-doscan(map, c, newmap)
- KEYMAP *map;
- int c;
- KEYMAP **newmap;
+doscan(KEYMAP *map, int c, KEYMAP **newmap)
{
MAP_ELEMENT *elec = &map->map_element[0];
MAP_ELEMENT *last = &map->map_element[map->map_num];
@@ -157,7 +150,7 @@ doscan(map, c, newmap)
}
int
-doin()
+doin(void)
{
KEYMAP *curmap;
PF funct;
@@ -178,8 +171,7 @@ doin()
}
int
-rescan(f, n)
- int f, n;
+rescan(int f, int n)
{
int c;
KEYMAP *curmap;
@@ -237,8 +229,7 @@ rescan(f, n)
}
int
-universal_argument(f, n)
- int f, n;
+universal_argument(int f, int n)
{
KEYMAP *curmap;
PF funct;
@@ -275,8 +266,7 @@ universal_argument(f, n)
/* ARGSUSED */
int
-digit_argument(f, n)
- int f, n;
+digit_argument(int f, int n)
{
KEYMAP *curmap;
PF funct;
@@ -310,8 +300,7 @@ digit_argument(f, n)
}
int
-negative_argument(f, n)
- int f, n;
+negative_argument(int f, int n)
{
KEYMAP *curmap;
PF funct;
@@ -353,8 +342,7 @@ negative_argument(f, n)
* all inserted characters.
*/
int
-selfinsert(f, n)
- int f, n;
+selfinsert(int f, int n)
{
#ifndef NO_MACRO
LINE *lp;
@@ -422,8 +410,7 @@ selfinsert(f, n)
* This could be implemented as a keymap with everthing defined as self-insert.
*/
int
-quote(f, n)
- int f, n;
+quote(int f, int n)
{
int c;
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index 224d0ed8ac7..29ef7a1bb01 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.16 2002/03/18 01:45:54 vincent Exp $ */
+/* $OpenBSD: line.c,v 1.17 2002/07/01 14:33:44 vincent Exp $ */
/*
* Text line handling.
@@ -561,7 +561,7 @@ lreplace(RSIZE plen, char *st, int f)
* case the buffer has grown to an immense size. No errors.
*/
void
-kdelete()
+kdelete(void)
{
if (kbufp != NULL) {
free((char *)kbufp);
@@ -578,8 +578,7 @@ kdelete()
* Print a message on errors. Dir says whether to put it at back or front.
*/
int
-kinsert(c, dir)
- int c, dir;
+kinsert(int c, int dir)
{
if (kused == ksize && dir == KFORW && kgrow(FALSE) == FALSE)
return FALSE;
diff --git a/usr.bin/mg/macro.c b/usr.bin/mg/macro.c
index 95fde18c81f..bd774924723 100644
--- a/usr.bin/mg/macro.c
+++ b/usr.bin/mg/macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macro.c,v 1.5 2001/05/24 03:05:24 mickey Exp $ */
+/* $OpenBSD: macro.c,v 1.6 2002/07/01 14:33:44 vincent Exp $ */
/*
* Keyboard macros.
@@ -13,8 +13,7 @@
/* ARGSUSED */
int
-definemacro(f, n)
- int f, n;
+definemacro(int f, int n)
{
LINE *lp1, *lp2;
@@ -44,8 +43,7 @@ definemacro(f, n)
/* ARGSUSED */
int
-finishmacro(f, n)
- int f, n;
+finishmacro(int f, int n)
{
macrodef = FALSE;
ewprintf("End Keyboard Macro Definition");
@@ -54,8 +52,7 @@ finishmacro(f, n)
/* ARGSUSED */
int
-executemacro(f, n)
- int f, n;
+executemacro(int f, int n)
{
int i, j, flag, num;
PF funct;
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c
index 939e3345692..a56ba40ee75 100644
--- a/usr.bin/mg/main.c
+++ b/usr.bin/mg/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.19 2002/03/18 01:45:55 vincent Exp $ */
+/* $OpenBSD: main.c,v 1.20 2002/07/01 14:33:44 vincent Exp $ */
/*
* Mainline.
@@ -103,7 +103,7 @@ main(int argc, char **argv)
* Initialize default buffer and window.
*/
static void
-edinit()
+edinit(void)
{
BUFFER *bp;
MGWIN *wp;
@@ -135,8 +135,7 @@ edinit()
*/
/* ARGSUSED */
int
-quit(f, n)
- int f, n;
+quit(int f, int n)
{
int s;
@@ -159,8 +158,7 @@ quit(f, n)
*/
/* ARGSUSED */
int
-ctrlg(f, n)
- int f, n;
+ctrlg(int f, int n)
{
return ABORT;
}
diff --git a/usr.bin/mg/modes.c b/usr.bin/mg/modes.c
index 4dcd81cbb08..842a074bb96 100644
--- a/usr.bin/mg/modes.c
+++ b/usr.bin/mg/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.7 2002/02/16 21:27:49 millert Exp $ */
+/* $OpenBSD: modes.c,v 1.8 2002/07/01 14:33:44 vincent Exp $ */
/*
* Commands to toggle modes. Without an argument, these functions will
@@ -16,9 +16,7 @@ MAPS *defb_modes[PBMODES] = { &fundamental_mode };
int defb_flag = 0;
static int
-changemode(f, n, mode)
- int f, n;
- char *mode;
+changemode(int f, int n, char *mode)
{
int i;
MAPS *m;
@@ -60,15 +58,13 @@ changemode(f, n, mode)
}
int
-indentmode(f, n)
- int f, n;
+indentmode(int f, int n)
{
return changemode(f, n, "indent");
}
int
-fillmode(f, n)
- int f, n;
+fillmode(int f, int n)
{
return changemode(f, n, "fill");
}
@@ -77,16 +73,14 @@ fillmode(f, n)
* Fake the GNU "blink-matching-paren" variable.
*/
int
-blinkparen(f, n)
- int f, n;
+blinkparen(int f, int n)
{
return changemode(f, n, "blink");
}
#ifdef NOTAB
int
-notabmode(f, n)
- int f, n;
+notabmode(int f, int n)
{
if (changemode(f, n, "notab") == FALSE)
return FALSE;
@@ -102,8 +96,7 @@ notabmode(f, n)
#endif /* NOTAB */
int
-overwrite(f, n)
- int f, n;
+overwrite(int f, int n)
{
if (changemode(f, n, "overwrite") == FALSE)
return FALSE;
@@ -118,8 +111,7 @@ overwrite(f, n)
}
int
-set_default_mode(f, n)
- int f, n;
+set_default_mode(int f, int n)
{
int i;
MAPS *m;