summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mg/display.c11
-rw-r--r--usr.bin/mg/extend.c26
-rw-r--r--usr.bin/mg/fileio.c12
-rw-r--r--usr.bin/mg/help.c16
-rw-r--r--usr.bin/mg/line.c4
-rw-r--r--usr.bin/mg/search.c4
-rw-r--r--usr.bin/mg/undo.c4
7 files changed, 38 insertions, 39 deletions
diff --git a/usr.bin/mg/display.c b/usr.bin/mg/display.c
index 38f35e3db2e..49f74a3ead2 100644
--- a/usr.bin/mg/display.c
+++ b/usr.bin/mg/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.24 2005/11/20 03:53:45 deraadt Exp $ */
+/* $OpenBSD: display.c,v 1.25 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -748,9 +748,8 @@ uline(int row, struct video *vvp, struct video *pvp)
void
modeline(struct mgwin *wp)
{
- int n;
+ int n, md;
struct buffer *bp;
- int mode;
n = wp->w_toprow + wp->w_ntrows; /* Location. */
vscreen[n]->v_color = CMODE; /* Mode line color. */
@@ -783,9 +782,9 @@ modeline(struct mgwin *wp)
}
vtputc('(');
++n;
- for (mode = 0; ; ) {
- n += vtputs(bp->b_modes[mode]->p_name);
- if (++mode > bp->b_nmodes)
+ for (md = 0; ; ) {
+ n += vtputs(bp->b_modes[md]->p_name);
+ if (++md > bp->b_nmodes)
break;
vtputc('-');
++n;
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c
index 2c91901f582..dacd77eea8d 100644
--- a/usr.bin/mg/extend.c
+++ b/usr.bin/mg/extend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extend.c,v 1.40 2005/11/18 20:56:52 deraadt Exp $ */
+/* $OpenBSD: extend.c,v 1.41 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -326,7 +326,7 @@ dobind(KEYMAP *curmap, const char *p, int unbind)
{
KEYMAP *pref_map = NULL;
PF funct;
- char prompt[80], *bufp, *pep;
+ char bprompt[80], *bufp, *pep;
int c, s, n;
#ifndef NO_MACRO
@@ -353,15 +353,15 @@ dobind(KEYMAP *curmap, const char *p, int unbind)
} else {
#endif /* !NO_STARTUP */
#endif /* !NO_MACRO */
- n = strlcpy(prompt, p, sizeof(prompt));
- if (n >= sizeof(prompt))
- n = sizeof(prompt) - 1;
- pep = prompt + n;
+ n = strlcpy(bprompt, p, sizeof(bprompt));
+ if (n >= sizeof(bprompt))
+ n = sizeof(bprompt) - 1;
+ pep = bprompt + n;
for (;;) {
- ewprintf("%s", prompt);
+ ewprintf("%s", bprompt);
pep[-1] = ' ';
- pep = keyname(pep, sizeof(prompt) - (pep - prompt),
- c = getkey(FALSE));
+ pep = keyname(pep, sizeof(bprompt) -
+ (pep - bprompt), c = getkey(FALSE));
if (doscan(curmap, c, &curmap) != NULL)
break;
*pep++ = '-';
@@ -373,13 +373,13 @@ dobind(KEYMAP *curmap, const char *p, int unbind)
if (unbind)
funct = rescan;
else {
- if ((bufp = eread("%s to command: ", prompt, sizeof(prompt),
- EFFUNC | EFNEW, prompt)) == NULL)
+ if ((bufp = eread("%s to command: ", bprompt, sizeof(bprompt),
+ EFFUNC | EFNEW, bprompt)) == NULL)
return (ABORT);
else if (bufp[0] == '\0')
return (FALSE);
- if (((funct = name_function(prompt)) == NULL) ?
- (pref_map = name_map(prompt)) == NULL : funct == NULL) {
+ if (((funct = name_function(bprompt)) == NULL) ?
+ (pref_map = name_map(bprompt)) == NULL : funct == NULL) {
ewprintf("[No match]");
return (FALSE);
}
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c
index 2e3ddeb469e..75ee6363608 100644
--- a/usr.bin/mg/fileio.c
+++ b/usr.bin/mg/fileio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fileio.c,v 1.65 2005/11/20 18:47:11 kjell Exp $ */
+/* $OpenBSD: fileio.c,v 1.66 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -57,12 +57,12 @@ int
ffwopen(const char *fn, struct buffer *bp)
{
int fd;
- mode_t mode = DEFFILEMODE;
+ mode_t fmode = DEFFILEMODE;
if (bp && bp->b_fi.fi_mode)
- mode = bp->b_fi.fi_mode & 07777;
+ fmode = bp->b_fi.fi_mode & 07777;
- fd = open(fn, O_RDWR | O_CREAT | O_TRUNC, mode);
+ fd = open(fn, O_RDWR | O_CREAT | O_TRUNC, fmode);
if (fd == -1) {
ffp = NULL;
ewprintf("Cannot open file for writing : %s", strerror(errno));
@@ -353,7 +353,7 @@ copy(char *frname, char *toname)
{
int ifd, ofd, n;
char buf[BUFSIZ];
- mode_t mode = DEFFILEMODE; /* XXX?? */
+ mode_t fmode = DEFFILEMODE; /* XXX?? */
struct stat orig;
if ((ifd = open(frname, O_RDONLY)) == -1)
@@ -364,7 +364,7 @@ copy(char *frname, char *toname)
return (FALSE);
}
- if ((ofd = open(toname, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
+ if ((ofd = open(toname, O_WRONLY|O_CREAT|O_TRUNC, fmode)) == -1) {
close(ifd);
return (FALSE);
}
diff --git a/usr.bin/mg/help.c b/usr.bin/mg/help.c
index 7a1c5d5457b..d84e5045578 100644
--- a/usr.bin/mg/help.c
+++ b/usr.bin/mg/help.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: help.c,v 1.27 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: help.c,v 1.28 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -31,24 +31,24 @@ desckey(int f, int n)
PF funct;
int c, m, i, num;
char *pep;
- char prompt[80];
+ char dprompt[80];
#ifndef NO_MACRO
if (inmacro)
return (TRUE); /* ignore inside keyboard macro */
#endif /* !NO_MACRO */
- num = strlcpy(prompt, "Describe key briefly: ", sizeof(prompt));
- if (num >= sizeof(prompt))
- num = sizeof(prompt) - 1;
- pep = prompt + num;
+ num = strlcpy(dprompt, "Describe key briefly: ", sizeof(dprompt));
+ if (num >= sizeof(dprompt))
+ num = sizeof(dprompt) - 1;
+ pep = dprompt + num;
key.k_count = 0;
m = curbp->b_nmodes;
curmap = curbp->b_modes[m]->p_map;
for (;;) {
for (;;) {
- ewprintf("%s", prompt);
+ ewprintf("%s", dprompt);
pep[-1] = ' ';
- pep = keyname(pep, sizeof(prompt) - (pep - prompt),
+ pep = keyname(pep, sizeof(dprompt) - (pep - dprompt),
key.k_chars[key.k_count++] = c = getkey(FALSE));
if ((funct = doscan(curmap, c, &curmap)) != NULL)
break;
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index 3c3abeaa45e..19d293fbc8e 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.33 2005/11/22 05:02:44 kjell Exp $ */
+/* $OpenBSD: line.c,v 1.34 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -462,7 +462,7 @@ ldelete(RSIZE n, int kflag)
}
n -= chunk;
}
- if (kchunk(sv, len, kflag) != TRUE)
+ if (kchunk(sv, (RSIZE)len, kflag) != TRUE)
return (FALSE);
free(sv);
return (TRUE);
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c
index e8ddff9a7ab..b59ccd203cc 100644
--- a/usr.bin/mg/search.c
+++ b/usr.bin/mg/search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.c,v 1.25 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: search.c,v 1.26 2005/12/13 05:40:33 kjell Exp $ */
/* This file is in the public domain. */
@@ -338,7 +338,7 @@ isearch(int dir)
ewprintf("Mark set");
curwp->w_flag |= WFMOVE;
return (TRUE);
- } /* and continue */
+ } /* FALLTHRU */
case CCHR('I'):
case CCHR('J'):
addchar:
diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c
index 3e7ac4bfdfe..339beba572f 100644
--- a/usr.bin/mg/undo.c
+++ b/usr.bin/mg/undo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undo.c,v 1.35 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: undo.c,v 1.36 2005/12/13 05:40:33 kjell Exp $ */
/*
* Copyright (c) 2002 Vincent Labrecque <vincent@openbsd.org>
* All rights reserved.
@@ -435,7 +435,7 @@ undo(int f, int n)
{
struct undo_rec *ptr, *nptr;
int done, rval;
- struct line *lp;
+ struct line *lp;
int offset, save, dot;
static int nulled = FALSE;