Hi,
This patch removes ``suggest parentheses around && within ||'' and
``suggest explicit braces to avoid ambiguous `else''' warnings,
unused variable warnings (except variables used in #if blocks),
unused goto labels, and puts a function's prototype in an
``#ifdef DEBUG'' block because the function is in one as well.
No binary change. More cleanup coming.
-Ray-
Index: cl/cl_main.c
RCS file: /,v
retrieving revision 1.14
diff -u -r1.14 cl_main.c
cl/cl_main.c18 Jul 2003 23:11:43 -00001.14
cl/cl_main.c29 Dec 2005 07:03:03 -0000
@@ -196,7 +196,6 @@
gs_init(name)
char *name;
{
-CL_PRIVATE *clp;
GS *gp;
char *p;
Index: cl/cl_screen.c
RCS file: /,v
retrieving revision 1.16
diff -u -r1.16 cl_screen.c
cl/cl_screen.c17 2005 19:12:16 -00001.16
cl/cl_screen.c29 Dec 2005 07:03:03 -0000
@@ -64,8 +64,8 @@
}
/* See if we're already in the right mode. */
-if (LF_ISSET(SC_EX) && F_ISSET(sp, SC_SCR_EX) ||
- LF_ISSET(SC_VI) && F_ISSET(sp, SC_SCR_VI))
+if ((LF_ISSET(SC_EX) && F_ISSET(sp, SC_SCR_EX)) ||
+ (LF_ISSET(SC_VI) && F_ISSET(sp, SC_SCR_VI)))
return (0);
/*
Index: cl/cl_term.c
RCS file: /,v
retrieving revision 1.13
diff -u -r1.13 cl_term.c
cl/cl_term.c17 2005 19:12:16 -00001.13
cl/cl_term.c29 Dec 2005 07:03:03 -0000
@@ -412,16 +412,18 @@
if (row == 0 || col == 0) {
if ((p = getenv("TERM")) == NULL)
goto noterm;
-if (row == 0)
+if (row == 0) {
if ((rval = tigetnum("lines")) < 0)
msgq(sp, M_SYSERR, "tigetnum: lines");
else
row = rval;
-if (col == 0)
+}
+if (col == 0) {
if ((rval = tigetnum("cols")) < 0)
msgq(sp, M_SYSERR, "tigetnum: cols");
else
col = rval;
+}
}
/* If nothing else, well, it's probably a VT100. */
Index: common/cut.c
RCS file: /,v
retrieving revision 1.8
diff -u -r1.8 cut.c
common/cut.c17 2005 19:12:16 -00001.8
common/cut.c29 Dec 2005 07:03:04 -0000
@@ -102,8 +102,8 @@
append = copy_one = copy_def = 0;
if (namep != NULL) {
name = *namep;
-if (LF_ISSET(CUT_NUMREQ) || LF_ISSET(CUT_NUMPT) &&
- (LF_ISSET(CUT_LINEMDE) || fm->lno != tm->lno)) {
+if (LF_ISSET(CUT_NUMREQ) || (LF_ISSET(CUT_NUMPT) &&
+ (LF_ISSET(CUT_LINEMDE) || fm->lno != tm->lno))) {
copy_one = 1;
cb_rotate(sp);
}
@@ -113,8 +113,8 @@
name = tolower(name);
}
namecb:CBNAME(sp, cbp, name);
-} else if (LF_ISSET(CUT_NUMREQ) || LF_ISSET(CUT_NUMPT) &&
- (LF_ISSET(CUT_LINEMDE) || fm->lno != tm->lno)) {
+} else if (LF_ISSET(CUT_NUMREQ) || (LF_ISSET(CUT_NUMPT) &&
+ (LF_ISSET(CUT_LINEMDE) || fm->lno != tm->lno))) {
name = '1';
cb_rotate(sp);
goto namecb;
Index: common/exf.c
RCS file: /,v
retrieving revision 1.21
diff -u -r1.21 exf.c
common/exf.c17 2005 19:12:16 -00001.21
common/exf.c29 Dec 2005 07:03:04 -0000
@@ -209,7 +209,7 @@
if (frp->name == NULL)
F_SET(frp, FR_TMPFILE);
if ((frp->tname = strdup(tname)) == NULL ||
- frp->name == NULL && (frp->name = strdup(tname)) == NULL) {
+ (frp->name == NULL && (frp->name = strdup(tname)) == NULL)) {
if (frp->tname != NULL)
free(frp->tname);
msgq(sp, M_SYSERR, NULL);
@@ -406,9 +406,9 @@
* probably isn't a problem for vi when it's running standalone.
*/
if (readonly || F_ISSET(sp, SC_READNLY) ||
- !F_ISSET(frp, FR_NEWFILE) &&
+ (!F_ISSET(frp, FR_NEWFILE) &&
(!(sb.st_mode & (S_IWUSR | S_IWGRP | S_IWTH)) ||
- access(frp->name, WK)))
+ access(frp->name, WK))))
SET(sp, READNLY);
else
CLR(sp, READNLY);
@@ -476,8 +476,8 @@
*existsp = 0;
return (0);
}
-if (name[0] == '/' || name[0] == '.' &&
- (name[1] == '/' || name[1] == '.' && name[2] == '/')) {
+if (name[0] == '/' || (name[0] == '.' &&
+ (name[1] == '/' || (name[1] == '.' && name[2] == '/')))) {
*existsp = !stat(name, sbp);
return (0);
}
@@ -824,8 +824,8 @@
mtype = NEWFILE;
else {
if (noname && !LF_ISSET(FS_FRCE | FS_APPEND) &&
- (F_ISSET(ep, F_DEVSET) &&
- (sb.st_dev != ep->mdev || sb.st_ino != ep->minode) ||
+ ((F_ISSET(ep, F_DEVSET) &&
+ (sb.st_dev != ep->mdev || sb.st_ino != ep->minode)) ||
sb.st_mtime != ep->mtime)) {
msgq_str(sp, M_ERR, name, LF_ISSET(FS_PSSIBLE) ?
"250|%s: file modified more recently than this copy; use ! to override" :
@@ -906,7 +906,7 @@
* we re-init the time. That way the user can clean up the disk
* and rewrite without having to force it.
*/
-if (noname)
+if (noname) {
if (stat(name, &sb))
time(&ep->mtime);
else {
@@ -916,6 +916,7 @@
ep->mtime = sb.st_mtime;
}
+}
/*
* If the write failed, complain loudly. ex_writefp() has already
@@ -944,11 +945,12 @@
*/
if (LF_ISSET(FS_ALL) && !LF_ISSET(FS_APPEND)) {
F_CLR(ep, F_MDIFIED);
-if (F_ISSET(frp, FR_TMPFILE))
+if (F_ISSET(frp, FR_TMPFILE)) {
if (noname)
F_SET(frp, FR_TMPEXIT);
else
F_CLR(frp, FR_TMPEXIT);
+}
}
p = msg_print(sp, name, &nf);
@@ -1260,7 +1262,7 @@
* unless force is also set. , we fail unless forced or
* there's another open screen on this file.
*/
-if (F_ISSET(ep, F_MDIFIED))
+if (F_ISSET(ep, F_MDIFIED)) {
if (ISSET(sp, AUTWRITE)) {
if (!force && file_aw(sp, flags))
return (1);
@@ -1270,6 +1272,7 @@
"263|File modified since last complete write; write or use :edit! to override");
return (1);
}
+}
return (file_m3(sp, force));
}
Index: common/key.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 key.c
common/key.c17 2005 19:12:16 -00001.7
common/key.c29 Dec 2005 07:03:04 -0000
@@ -632,7 +632,7 @@
*/
if (istimeout || F_ISSET(&evp->e_ch, CH_NMAP) ||
!LF_ISSET(EC_MAPCMMAND | EC_MAPINPUT) ||
- evp->e_c < MAX_BIT_SEQ && !bit_test(gp->seqb, evp->e_c))
+ (evp->e_c < MAX_BIT_SEQ && !bit_test(gp->seqb, evp->e_c)))
goto nomap;
/* Search the map. */
Index: common/line.c
RCS file: /,v
retrieving revision 1.6
diff -u -r1.6 line.c
common/line.c17 2005 19:12:16 -00001.6
common/line.c29 Dec 2005 07:03:04 -0000
@@ -62,7 +62,7 @@
return (1);
/* If the file isn't empty, fail loudly. */
-if (lno != 0 && lno != 1 || l1 != 0) {
+if ((lno != 0 && lno != 1) || l1 != 0) {
db_err(sp, lno);
return (1);
}
Index: common/main.c
RCS file: /,v
retrieving revision 1.11
diff -u -r1.11 main.c
common/main.c17 2005 19:12:16 -00001.11
common/main.c29 Dec 2005 07:03:04 -0000
@@ -41,7 +41,9 @@
#include "/vi/vi.h"
#include "pathnames.h"
+#ifdef DEBUG
static void attach(GS *);
+#endif
static void v_estr(char *, int, char *);
static int v_obsolete(char *, char *[]);
@@ -403,8 +405,8 @@
if (v_event_get(sp, &ev, 0, 0))
goto err;
if (ev.e_event == E_INTERRUPT ||
- ev.e_event == E_CHARACTER &&
- (ev.e_value == K_CR || ev.e_value == K_NL))
+ (ev.e_event == E_CHARACTER &&
+ (ev.e_value == K_CR || ev.e_value == K_NL)))
break;
(void)gp->scr_bell(sp);
}
@@ -562,7 +564,7 @@
argv[0][1] = 'c';
(void)strlcpy(argv[0] + 2, p + 1, len);
}
-} else if (argv[0][0] == '-')
+} else if (argv[0][0] == '-') {
if (argv[0][1] == '\0') {
argv[0] = strdup("-s");
if (argv[0] == NULL) {
@@ -574,6 +576,7 @@
argv[0][1] == 't' || argv[0][1] == 'w') &&
argv[0][2] == '\0')
++argv;
+}
return (0);
}
Index: common/mark.c
RCS file: /,v
retrieving revision 1.6
diff -u -r1.6 mark.c
common/mark.c17 2005 19:12:16 -00001.6
common/mark.c29 Dec 2005 07:03:04 -0000
@@ -237,12 +237,13 @@
abort();
case LINE_DELETE:
LIST_FREACH(lmp, &sp->ep->marks, q)
-if (lmp->lno >= lno)
+if (lmp->lno >= lno) {
if (lmp->lno == lno) {
F_SET(lmp, MARK_DELETED);
(void)log_mark(sp, lmp);
} else
>lno;
+}
break;
case LINE_INSERT:
/*
Index: common/msg.c
RCS file: /,v
retrieving revision 1.14
diff -u -r1.14 msg.c
common/msg.c25 Apr 2003 23:44:08 -00001.14
common/msg.c29 Dec 2005 07:03:04 -0000
@@ -332,7 +332,7 @@
(void)fprintf(stderr, "%.*s", (int)mlen, bp);
/* Cleanup. */
-ret:FREE_SPACE(sp, bp, blen);
+FREE_SPACE(sp, bp, blen);
alloc_err:
reenter = 0;
}
@@ -684,8 +684,8 @@
char *p, *t, buf[MAXPATHLEN];
if ((p = strrchr(file, '/')) != NULL && p[1] == '\0' &&
- ((t = getenv("LC_MESSAGES")) != NULL && t[0] != '\0' ||
- (t = getenv("LANG")) != NULL && t[0] != '\0')) {
+ (((t = getenv("LC_MESSAGES")) != NULL && t[0] != '\0') ||
+ ((t = getenv("LANG")) != NULL && t[0] != '\0'))) {
(void)snprintf(buf, sizeof(buf), "%s%s", file, t);
p = buf;
} else
Index: common/options.c
RCS file: /,v
retrieving revision 1.11
diff -u -r1.11 options.c
common/options.c7 Apr 2003 21:13:54 -00001.11
common/options.c29 Dec 2005 07:03:05 -0000
@@ -554,7 +554,7 @@
* Do nothing if the value is unchanged, the underlying
* functions can be expensive.
*/
-if (!F_ISSET(op, PT_ALWAYS))
+if (!F_ISSET(op, PT_ALWAYS)) {
if (turnoff) {
if (!ISSET(sp, offset))
break;
@@ -562,6 +562,7 @@
if (ISSET(sp, offset))
break;
}
+}
if (F_ISSET(op, PT_EARLYSET)) {
/* Set the value. */
@@ -572,8 +573,8 @@
}
/* Report to subsystems. */
-if (op->func != NULL &&
- op->func(sp, spo, NULL, &turnoff) ||
+if ((op->func != NULL &&
+ op->func(sp, spo, NULL, &turnoff)) ||
ex_optchange(sp, offset, NULL, &turnoff) ||
v_optchange(sp, offset, NULL, &turnoff) ||
sp->gp->scr_optchange(sp, offset, NULL, &turnoff)) {
@@ -667,8 +668,8 @@
}
/* Report to subsystems. */
-if (op->func != NULL &&
- op->func(sp, spo, sep, &value) ||
+if ((op->func != NULL &&
+ op->func(sp, spo, sep, &value)) ||
ex_optchange(sp, offset, sep, &value) ||
v_optchange(sp, offset, sep, &value) ||
sp->gp->scr_optchange(sp, offset, sep, &value)) {
@@ -714,8 +715,8 @@
}
/* Report to subsystems. */
-if (op->func != NULL &&
- op->func(sp, spo, sep, NULL) ||
+if ((op->func != NULL &&
+ op->func(sp, spo, sep, NULL)) ||
ex_optchange(sp, offset, sep, NULL) ||
v_optchange(sp, offset, sep, NULL) ||
sp->gp->scr_optchange(sp, offset, sep, NULL)) {
@@ -868,8 +869,8 @@
break;
case PT_STR:
if (STR(sp, cnt) == D_STR(sp, cnt) ||
- D_STR(sp, cnt) != NULL &&
- !strcmp(STR(sp, cnt), D_STR(sp, cnt)))
+ (D_STR(sp, cnt) != NULL &&
+ !strcmp(STR(sp, cnt), D_STR(sp, cnt))))
continue;
break;
}
Index: common/put.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 put.c
common/put.c17 2005 19:12:16 -00001.7
common/put.c29 Dec 2005 07:03:05 -0000
@@ -48,7 +48,7 @@
int rval;
char *bp, *p, *t;
-if (cbp == NULL)
+if (cbp == NULL) {
if (namep == NULL) {
cbp = sp->gp->dcbp;
if (cbp == NULL) {
@@ -65,6 +65,7 @@
return (1);
}
}
+}
tp = CIRCLEQ_FIRST(&cbp->textq);
/*
Index: common/search.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 search.c
common/search.c17 Feb 2002 19:42:34 -00001.7
common/search.c29 Dec 2005 07:03:05 -0000
@@ -211,7 +211,7 @@
}
cnt = INTERRUPT_CHECK;
}
-if (wrapped && lno fm->lno || db_get(sp, lno, 0, &l, &len)) {
+if ((wrapped && lno fm->lno) || db_get(sp, lno, 0, &l, &len)) {
if (wrapped) {
if (LF_ISSET(SEARCH_MSG))
search_msg(sp, S_NTFUND);
@@ -342,7 +342,7 @@
}
cnt = INTERRUPT_CHECK;
}
-if (wrapped && lno < fm->lno || lno == 0) {
+if ((wrapped && lno < fm->lno) || lno == 0) {
if (wrapped) {
if (LF_ISSET(SEARCH_MSG))
search_msg(sp, S_NTFUND);
Index: ex/ex.c
RCS file: /cvs/src/usr.bin/vi/ex/ex.c,v
retrieving revision 1.12
diff -u -r1.12 ex.c
ex/ex.c17 2005 19:12:16 -00001.12
ex/ex.c29 Dec 2005 07:03:05 -0000
@@ -1250,7 +1250,7 @@
ex_badaddr(sp, ecp->cmd, A_ZER, NUMK);
goto err;
}
-} else if (!db_exist(sp, ecp->addr2.lno))
+} else if (!db_exist(sp, ecp->addr2.lno)) {
if (FL_ISSET(ecp->iflags, E_C_****)) {
if (db_last(sp, &lno))
goto err;
@@ -1259,6 +1259,7 @@
ex_badaddr(sp, NULL, A_EF, NUMK);
goto err;
}
+}
/* FALLTHRUGH */
case 1:
if (ecp->addr1.lno == 0) {
@@ -1894,7 +1895,7 @@
* difference. C'est la vie.
*/
if (ecp->clen < 2 ||
- ecp->cp[1] != '/' && ecp->cp[1] != '?') {
+ (ecp->cp[1] != '/' && ecp->cp[1] != '?')) {
msgq(sp, M_ERR, "096|\\ not followed by / or ?");
*errp = 1;
return (0);
@@ -2000,9 +2001,9 @@
for (;;) {
for (; ecp->clen 0 && isblank(ecp->cp[0]);
++ecp->cp, >clen);
-if (ecp->clen == 0 || !isdigit(ecp->cp[0]) &&
+if (ecp->clen == 0 || (!isdigit(ecp->cp[0]) &&
ecp->cp[0] != '+' && ecp->cp[0] != '-' &&
- ecp->cp[0] != '^')
+ ecp->cp[0] != '^'))
break;
if (!isdigit(ecp->cp[0]) &&
!isdigit(ecp->cp[1])) {
@@ -2119,7 +2120,7 @@
/* If it's a global/v command, fix up the last line. */
if (FL_ISSET(ecp->agv_flags,
- AGV_GLBAL | AGV_V) && ecp->range_lno != BLN)
+ AGV_GLBAL | AGV_V) && ecp->range_lno != BLN) {
if (db_exist(sp, ecp->range_lno))
sp->lno = ecp->range_lno;
else {
@@ -2128,6 +2129,7 @@
if (sp->lno == 0)
sp->lno = 1;
}
+}
free(ecp->o_cp);
}
Index: ex/ex_bang.c
RCS file: /,v
retrieving revision 1.5
diff -u -r1.5 ex_bang.c
ex/ex_bang.c16 Feb 2002 21:27:57 -00001.5
ex/ex_bang.c29 Dec 2005 07:03:05 -0000
@@ -103,7 +103,7 @@
*/
if (cmdp->addrcnt == 0) {
msg = NULL;
-if (sp->ep != NULL && F_ISSET(sp->ep, F_MDIFIED))
+if (sp->ep != NULL && F_ISSET(sp->ep, F_MDIFIED)) {
if (ISSET(sp, AUTWRITE)) {
if (file_aw(sp, FS_ALL))
return (0);
@@ -112,6 +112,7 @@
msg = msg_cat(sp,
"303|File modified since last write.",
NULL);
+}
/* If we're still in a vi screen, move out explicitly. */
(void)ex_exec_proc(sp,
Index: ex/ex_cd.c
RCS file: /cvs/src/usr.bin/vi/ex/ex_cd.c,v
retrieving revision 1.7
diff -u -r1.7 ex_cd.c
ex/ex_cd.c21 Apr 2005 15:39:31 -00001.7
ex/ex_cd.c29 Dec 2005 07:03:05 -0000
@@ -93,9 +93,9 @@
*/
if (cmdp->argc == 0 ||
(ap = cmdp->argv[0])->bp[0] == '/' ||
- ap->len == 1 && ap->bp[0] == '.' ||
- ap->len >= 2 && ap->bp[0] == '.' && ap->bp[1] == '.' &&
- (ap->bp[2] == '/' || ap->bp[2] == '\0'))
+ (ap->len == 1 && ap->bp[0] == '.') ||
+ (ap->len >= 2 && ap->bp[0] == '.' && ap->bp[1] == '.' &&
+ (ap->bp[2] == '/' || ap->bp[2] == '\0')))
goto err;
/* Try the CDPATH option values. */
Index: ex/ex_cscope.c
RCS file: /,v
retrieving revision 1.11
diff -u -r1.11 ex_cscope.c
ex/ex_cscope.c17 2005 19:12:16 -00001.11
ex/ex_cscope.c29 Dec 2005 07:03:06 -0000
@@ -824,7 +824,7 @@
{
CC const *ccp;
-if (cmd != NULL && *cmd != '\0')
+if (cmd != NULL && *cmd != '\0') {
if ((ccp = lookup_ccmd(cmd)) == NULL) {
ex_printf(sp,
"%s doesn't match any cscope command\n", cmd);
@@ -835,6 +835,7 @@
ex_printf(sp, " Usage: %s\n", ccp->usage_msg);
return (0);
}
+}
ex_printf(sp, "cscope commands:\n");
for (ccp = cscope_cmds; ccp->name != NULL; ++ccp)
Index: ex/ex_filter.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 ex_filter.c
ex/ex_filter.c12 Jun 2002 06:07:17 -00001.7
ex/ex_filter.c29 Dec 2005 07:03:06 -0000
@@ -181,11 +181,12 @@
if (ex_readfp(sp, "filter", ofp, fm, &nread, 1))
rval = 1;
sp->rptlines[L_ADDED] += nread;
-if (ftype == FILTER_READ)
+if (ftype == FILTER_READ) {
if (fm->lno == 0)
rp->lno = nread;
else
rp->lno += nread;
+}
goto uwait;
}
Index: ex/ex_global.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 ex_global.c
ex/ex_global.c17 2005 19:12:16 -00001.7
ex/ex_global.c29 Dec 2005 07:03:06 -0000
@@ -125,11 +125,12 @@
*t = '\0';
break;
}
-if (p[0] == '\\')
+if (p[0] == '\\') {
if (p[1] == delim)
++p;
else if (p[1] == '\\')
*t++ = *p++;
+}
*t++ = *p++;
}
Index: ex/ex_script.c
RCS file: /,v
retrieving revision 1.12
diff -u -r1.12 ex_script.c
ex/ex_script.c17 2005 19:12:16 -00001.12
ex/ex_script.c29 Dec 2005 07:03:06 -0000
@@ -379,7 +379,7 @@
GS *gp;
struct timeval tv;
fd_set *rdfd;
-int maxfd, nfd;
+int maxfd;
gp = sp->gp;
@@ -434,7 +434,6 @@
sscr_insert(sp)
SCR *sp;
{
-struct timeval tv;
CHAR_T *endp, *p, *t;
SCRIPT *sc;
struct pollfd pfd[1];
Index: ex/ex_shell.c
RCS file: /,v
retrieving revision 1.9
diff -u -r1.9 ex_shell.c
ex/ex_shell.c12 Jun 2002 06:07:17 -00001.9
ex/ex_shell.c29 Dec 2005 07:03:06 -0000
@@ -226,136 +226,136 @@
SIGS const sigs[] = {
#ifdef SIGABRT
-SIGABRT,"Abort trap",
+{ SIGABRT,"Abort trap" },
#endif
#ifdef SIGALRM
-SIGALRM,"Alarm clock",
+{ SIGALRM,"Alarm clock" },
#endif
#ifdef SIGBUS
-SIGBUS,"Bus error",
+{ SIGBUS,"Bus error" },
#endif
#ifdef SIGCLD
-SIGCLD,"Child exited or stopped",
+{ SIGCLD,"Child exited or stopped" },
#endif
#ifdef SIGCHLD
-SIGCHLD,"Child exited",
+{ SIGCHLD,"Child exited" },
#endif
#ifdef SIGCNT
-SIGCNT,"Continued",
+{ SIGCNT,"Continued" },
#endif
#ifdef SIGDANGER
-SIGDANGER,"System crash imminent",
+{ SIGDANGER,"System crash imminent" },
#endif
#ifdef SIGEMT
-SIGEMT,"EMT trap",
+{ SIGEMT,"EMT trap" },
#endif
#ifdef SIGFPE
-SIGFPE,"Floating point exception",
+{ SIGFPE,"Floating point exception" },
#endif
#ifdef SIGGRANT
-SIGGRANT,"HFT monitor mode granted",
+{ SIGGRANT,"HFT monitor mode granted" },
#endif
#ifdef SIGHUP
-SIGHUP,"Hangup",
+{ SIGHUP,"Hangup" },
#endif
#ifdef SIGILL
-SIGILL,"Illegal instruction",
+{ SIGILL,"Illegal instruction" },
#endif
#ifdef SIGINF
-SIGINF,"Information request",
+{ SIGINF,"Information request" },
#endif
#ifdef SIGINT
-SIGINT,"Interrupt",
+{ SIGINT,"Interrupt" },
#endif
#ifdef SIGI
-SIGI,"I/ possible",
+{ SIGI,"I/ possible" },
#endif
#ifdef SIGIT
-SIGIT,"IT trap",
+{ SIGIT,"IT trap" },
#endif
#ifdef SIGKILL
-SIGKILL,"Killed",
+{ SIGKILL,"Killed" },
#endif
#ifdef SIGLST
-SIGLST,"Record lock",
+{ SIGLST,"Record lock" },
#endif
#ifdef SIGMIGRATE
-SIGMIGRATE,"Migrate process to another CPU",
+{ SIGMIGRATE,"Migrate process to another CPU" },
#endif
#ifdef SIGMSG
-SIGMSG,"HFT input data pending",
+{ SIGMSG,"HFT input data pending" },
#endif
#ifdef SIGPIPE
-SIGPIPE,"Broken pipe",
+{ SIGPIPE,"Broken pipe" },
#endif
#ifdef SIGPLL
-SIGPLL,"I/ possible",
+{ SIGPLL,"I/ possible" },
#endif
#ifdef SIGPRE
-SIGPRE,"Programming error",
+{ SIGPRE,"Programming error" },
#endif
#ifdef SIGPRF
-SIGPRF,"Profiling timer expired",
+{ SIGPRF,"Profiling timer expired" },
#endif
#ifdef SIGPWR
-SIGPWR,"Power failure imminent",
+{ SIGPWR,"Power failure imminent" },
#endif
#ifdef SIGRETRACT
-SIGRETRACT,"HFT monitor mode retracted",
+{ SIGRETRACT,"HFT monitor mode retracted" },
#endif
#ifdef SIGQUIT
-SIGQUIT,"Quit",
+{ SIGQUIT,"Quit" },
#endif
#ifdef SIGSAK
-SIGSAK,"Secure Attention Key",
+{ SIGSAK,"Secure Attention Key" },
#endif
#ifdef SIGSEGV
-SIGSEGV,"Segmentation fault",
+{ SIGSEGV,"Segmentation fault" },
#endif
#ifdef SIGSUND
-SIGSUND,"HFT sound sequence completed",
+{ SIGSUND,"HFT sound sequence completed" },
#endif
#ifdef SIGSTP
-SIGSTP,"Suspended (signal)",
+{ SIGSTP,"Suspended (signal)" },
#endif
#ifdef SIGSYS
-SIGSYS,"Bad system call",
+{ SIGSYS,"Bad system call" },
#endif
#ifdef SIGTERM
-SIGTERM,"Terminated",
+{ SIGTERM,"Terminated" },
#endif
#ifdef SIGTRAP
-SIGTRAP,"Trace/BPT trap",
+{ SIGTRAP,"Trace/BPT trap" },
#endif
#ifdef SIGTSTP
-SIGTSTP,"Suspended",
+{ SIGTSTP,"Suspended" },
#endif
#ifdef SIGTTIN
-SIGTTIN,"Stopped (tty input)",
+{ SIGTTIN,"Stopped (tty input)" },
#endif
#ifdef SIGTTU
-SIGTTU,"Stopped (tty output)",
+{ SIGTTU,"Stopped (tty output)" },
#endif
#ifdef SIGURG
-SIGURG,"Urgent I/ condition",
+{ SIGURG,"Urgent I/ condition" },
#endif
#ifdef SIGUSR1
-SIGUSR1,"User defined signal 1",
+{ SIGUSR1,"User defined signal 1" },
#endif
#ifdef SIGUSR2
-SIGUSR2,"User defined signal 2",
+{ SIGUSR2,"User defined signal 2" },
#endif
#ifdef SIGVTALRM
-SIGVTALRM,"Virtual timer expired",
+{ SIGVTALRM,"Virtual timer expired" },
#endif
#ifdef SIGWINCH
-SIGWINCH,"Window size changes",
+{ SIGWINCH,"Window size changes" },
#endif
#ifdef SIGXCPU
-SIGXCPU,"Cputime limit exceeded",
+{ SIGXCPU,"Cputime limit exceeded" },
#endif
#ifdef SIGXFSZ
-SIGXFSZ,"Filesize limit exceeded",
+{ SIGXFSZ,"Filesize limit exceeded" },
#endif
};
Index: ex/ex_subst.c
RCS file: /,v
retrieving revision 1.13
diff -u -r1.13 ex_subst.c
ex/ex_subst.c17 2005 19:12:16 -00001.13
ex/ex_subst.c29 Dec 2005 07:03:06 -0000
@@ -122,11 +122,12 @@
*t = '\0';
break;
}
-if (p[0] == '\\')
+if (p[0] == '\\') {
if (p[1] == delim)
++p;
else if (p[1] == '\\')
*t++ = *p++;
+}
*t++ = *p++;
}
@@ -476,7 +477,7 @@
goto usage;
}
-if (*s != '\0' || !rflag && LF_ISSET(SUB_MUSTSETR)) {
+if (*s != '\0' || (!rflag && LF_ISSET(SUB_MUSTSETR))) {
usage:ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE);
return (1);
}
Index: ex/ex_tag.c
RCS file: /cvs/src/usr.bin/vi/ex/ex_tag.c,v
retrieving revision 1.11
diff -u -r1.11 ex_tag.c
ex/ex_tag.c17 2005 19:12:16 -00001.11
ex/ex_tag.c29 Dec 2005 07:03:06 -0000
@@ -169,7 +169,7 @@
lno = sp->lno;
cno = sp->cno;
istmp = frp == NULL ||
- F_ISSET(frp, FR_TMPFILE) && !F_ISSET(cmdp, E_NEWSCREEN);
+ (F_ISSET(frp, FR_TMPFILE) && !F_ISSET(cmdp, E_NEWSCREEN));
/* Try to switch to the tag. */
force = FL_ISSET(cmdp->iflags, E_C_FRCE);
@@ -939,7 +939,7 @@
m.lno = 1;
m.cno = 0;
if (f_search(sp, &m, &m,
- search, slen, NULL, SEARCH_FILE | SEARCH_TAG))
+ search, slen, NULL, SEARCH_FILE | SEARCH_TAG)) {
if ((p = strrchr(search, '(')) != NULL) {
slen = p - search;
if (f_search(sp, &m, &m, search, slen,
@@ -949,6 +949,7 @@
notfound:tag_msg(sp, TAG_SEARCH, tag);
return (1);
}
+}
/*
* !!!
* Historically, tags set the search direction if it wasn't
Index: ex/ex_usage.c
RCS file: /,v
retrieving revision 1.4
diff -u -r1.4 ex_usage.c
ex/ex_usage.c16 Feb 2002 21:27:57 -00001.4
ex/ex_usage.c29 Dec 2005 07:03:07 -0000
@@ -79,7 +79,7 @@
for (cp = cmds; cp->name != NULL &&
memcmp(ap->bp, cp->name, ap->len); ++cp);
if (cp->name == NULL ||
- newscreen && !F_ISSET(cp, E_NEWSCREEN)) {
+ (newscreen && !F_ISSET(cp, E_NEWSCREEN))) {
if (newscreen)
ap->bp[0] = toupper(ap->bp[0]);
(void)ex_printf(sp, "The %.*s command is unknown\n",
Index: vi/getc.c
RCS file: /cvs/src/usr.bin/vi/vi/getc.c,v
retrieving revision 1.6
diff -u -r1.6 getc.c
vi/getc.c16 Feb 2002 21:27:58 -00001.6
vi/getc.c29 Dec 2005 07:03:07 -0000
@@ -156,7 +156,7 @@
if (cs_next(sp, csp))
return (1);
if (csp->cs_flags == CS_EL || csp->cs_flags == CS_EMP ||
- csp->cs_flags == 0 && isblank(csp->cs_ch))
+ (csp->cs_flags == 0 && isblank(csp->cs_ch)))
continue;
break;
}
@@ -230,7 +230,7 @@
if (cs_prev(sp, csp))
return (1);
if (csp->cs_flags == CS_EL || csp->cs_flags == CS_EMP ||
- csp->cs_flags == 0 && isblank(csp->cs_ch))
+ (csp->cs_flags == 0 && isblank(csp->cs_ch)))
continue;
break;
}
Index: vi/v_at.c
RCS file: /cvs/src/usr.bin/vi/vi/v_at.c,v
retrieving revision 1.5
diff -u -r1.5 v_at.c
vi/v_at.c17 2005 19:12:16 -00001.5
vi/v_at.c29 Dec 2005 07:03:07 -0000
@@ -90,9 +90,9 @@
* logging code to be available.
*/
CIRCLEQ_FREACH_REVERSE(tp, &cbp->textq, q)
-if ((F_ISSET(cbp, CB_LMDE) ||
+if (((F_ISSET(cbp, CB_LMDE) ||
CIRCLEQ_NEXT(tp, q) != CIRCLEQ_END(&cbp->textq)) &&
- v_event_push(sp, NULL, "\n", 1, 0) ||
+ v_event_push(sp, NULL, "\n", 1, 0)) ||
v_event_push(sp, NULL, tp->lb, tp->len, 0))
return (1);
Index: vi/v_mark.c
RCS file: /cvs/src/usr.bin/vi/vi/v_mark.c,v
retrieving revision 1.5
diff -u -r1.5 v_mark.c
vi/v_mark.c16 Feb 2002 21:27:58 -00001.5
vi/v_mark.c29 Dec 2005 07:03:07 -0000
@@ -113,7 +113,7 @@
if (db_get(sp, vp->m_stop.lno, DBG_FATAL, NULL, &len))
return (1);
if (vp->m_stop.cno < len ||
- vp->m_stop.cno == len && len == 0)
+ (vp->m_stop.cno == len && len == 0))
break;
if (ISMTIN(vp))
@@ -154,8 +154,8 @@
* and backward motions can happen for any kind of search command.
*/
if (vp->m_start.lno vp->m_stop.lno ||
- vp->m_start.lno == vp->m_stop.lno &&
- vp->m_start.cno vp->m_stop.cno) {
+ (vp->m_start.lno == vp->m_stop.lno &&
+ vp->m_start.cno vp->m_stop.cno)) {
m = vp->m_start;
vp->m_start = vp->m_stop;
vp->m_stop = m;
Index: vi/v_match.c
RCS file: /,v
retrieving revision 1.4
diff -u -r1.4 v_match.c
vi/v_match.c16 Feb 2002 21:27:58 -00001.4
vi/v_match.c29 Dec 2005 07:03:07 -0000
@@ -137,8 +137,8 @@
* starting cursor position when deleting to a match.
*/
if (vp->m_start.lno < vp->m_stop.lno ||
- vp->m_start.lno == vp->m_stop.lno &&
- vp->m_start.cno < vp->m_stop.cno)
+ (vp->m_start.lno == vp->m_stop.lno &&
+ vp->m_start.cno < vp->m_stop.cno))
vp->m_final = ISMTIN(vp) ? vp->m_start : vp->m_stop;
else
vp->m_final = vp->m_stop;
Index: vi/v_paragraph.c
RCS file: /,v
retrieving revision 1.4
diff -u -r1.4 v_paragraph.c
vi/v_paragraph.c16 Feb 2002 21:27:58 -00001.4
vi/v_paragraph.c29 Dec 2005 07:03:07 -0000
@@ -51,7 +51,7 @@
continue;\
for (lp = VIP(sp)->ps; *lp != '\0'; lp += 2)\
if (lp[0] == p[1] &&\
- (lp[1] == ' ' && len == 2 || lp[1] == p[2]) &&\
+ ((lp[1] == ' ' && len == 2) || lp[1] == p[2]) &&\
!)\
goto found;\
}
@@ -90,7 +90,7 @@
* line itself remained. If somebody complains, don't pause, don't
* hesitate, just hit them.
*/
-if (ISMTIN(vp))
+if (ISMTIN(vp)) {
if (vp->m_start.cno == 0)
F_SET(vp, VM_LMDE);
else {
@@ -101,6 +101,7 @@
if (vp->m_start.cno <= vp->m_stop.cno)
F_SET(vp, VM_LMDE);
}
+}
/* Figure out what state we're currently in. */
lno = vp->m_start.lno;
@@ -234,7 +235,7 @@
*/
lno = vp->m_start.lno;
-if (ISMTIN(vp))
+if (ISMTIN(vp)) {
if (vp->m_start.cno == 0) {
if (vp->m_start.lno == 1) {
v_sof(sp, &vp->m_start);
@@ -244,6 +245,7 @@
F_SET(vp, VM_LMDE);
} else
>m_start.cno;
+}
if (vp->m_start.lno <= 1)
goto sof;
Index: vi/v_replace.c
RCS file: /,v
retrieving revision 1.5
diff -u -r1.5 v_replace.c
vi/v_replace.c16 Feb 2002 21:27:58 -00001.5
vi/v_replace.c29 Dec 2005 07:03:07 -0000
@@ -156,7 +156,7 @@
* is different from the historic vi, which replaced N characters with
* a single new line. Users complained, so we match historic practice.
*/
-if (!quote && vip->rvalue == K_CR || vip->rvalue == K_NL) {
+if ((!quote && vip->rvalue == K_CR) || vip->rvalue == K_NL) {
/* Set return line. */
vp->m_stop.lno = vp->m_start.lno + 1;
vp->m_stop.cno = 0;
Index: vi/v_scroll.c
RCS file: /,v
retrieving revision 1.5
diff -u -r1.5 v_scroll.c
vi/v_scroll.c16 Feb 2002 21:27:58 -00001.5
vi/v_scroll.c29 Dec 2005 07:03:07 -0000
@@ -201,8 +201,8 @@
* stay at the start of the range. Ignore others.
*/
if (vp->m_stop.lno < vp->m_start.lno ||
- vp->m_stop.lno == vp->m_start.lno &&
- vp->m_stop.cno < vp->m_start.cno) {
+ (vp->m_stop.lno == vp->m_start.lno &&
+ vp->m_stop.cno < vp->m_start.cno)) {
if (ISCMD(vp->rkp, 'y') && vp->m_stop.lno == vp->m_start.lno)
vp->m_final = vp->m_start;
} else
Index: vi/v_search.c
RCS file: /,v
retrieving revision 1.8
diff -u -r1.8 v_search.c
vi/v_search.c17 2005 19:12:16 -00001.8
vi/v_search.c29 Dec 2005 07:03:07 -0000
@@ -468,8 +468,8 @@
* because of the wrapscan option.
*/
if (vp->m_start.lno vp->m_stop.lno ||
- vp->m_start.lno == vp->m_stop.lno &&
- vp->m_start.cno vp->m_stop.cno) {
+ (vp->m_start.lno == vp->m_stop.lno &&
+ vp->m_start.cno vp->m_stop.cno)) {
m = vp->m_start;
vp->m_start = vp->m_stop;
vp->m_stop = m;
Index: vi/v_section.c
RCS file: /,v
retrieving revision 1.4
diff -u -r1.4 v_section.c
vi/v_section.c16 Feb 2002 21:27:58 -00001.4
vi/v_section.c29 Dec 2005 07:03:07 -0000
@@ -84,7 +84,7 @@
* check here, because we know that the end is going to be the start
* or end of a line.
*/
-if (ISMTIN(vp))
+if (ISMTIN(vp)) {
if (vp->m_start.cno == 0)
F_SET(vp, VM_LMDE);
else {
@@ -95,12 +95,13 @@
if (vp->m_start.cno <= vp->m_stop.cno)
F_SET(vp, VM_LMDE);
}
+}
cnt = F_ISSET(vp, VC_C1SET) ? vp->count : 1;
for (lno = vp->m_start.lno; !db_get(sp, ++lno, 0, &p, &len);) {
if (len == 0)
continue;
-if (p[0] == '{' || ISMTIN(vp) && p[0] == '}') {
+if (p[0] == '{' || (ISMTIN(vp) && p[0] == '}')) {
if (!) {
if (p[0] == '{')
goto adjust1;
@@ -124,7 +125,7 @@
continue;
for (lp = list; *lp != '\0'; lp += 2 * sizeof(*lp))
if (lp[0] == p[1] &&
- (lp[1] == ' ' && len == 2 || lp[1] == p[2]) &&
+ ((lp[1] == ' ' && len == 2) || lp[1] == p[2]) &&
!) {
/*
* !!!
@@ -215,7 +216,7 @@
continue;
for (lp = list; *lp != '\0'; lp += 2 * sizeof(*lp))
if (lp[0] == p[1] &&
- (lp[1] == ' ' && len == 2 || lp[1] == p[2]) &&
+ ((lp[1] == ' ' && len == 2) || lp[1] == p[2]) &&
!) {
adjust1:vp->m_stop.lno = lno;
vp->m_stop.cno = 0;
Index: vi/v_sentence.c
RCS file: /,v
retrieving revision 1.4
diff -u -r1.4 v_sentence.c
vi/v_sentence.c16 Feb 2002 21:27:58 -00001.4
vi/v_sentence.c29 Dec 2005 07:03:07 -0000
@@ -76,7 +76,7 @@
* This may not handle " . " correctly, but it's real unclear
* what correctly means in that case.
*/
-if (cs.cs_flags == CS_EMP || cs.cs_flags == 0 && isblank(cs.cs_ch)) {
+if (cs.cs_flags == CS_EMP || (cs.cs_flags == 0 && isblank(cs.cs_ch))) {
if (cs_fblank(sp, &cs))
return (1);
if ( == 0) {
@@ -346,7 +346,7 @@
* All commands move to the end of the range. Adjust the start of
* the range for motion commands.
*/
-if (ISMTIN(vp))
+if (ISMTIN(vp)) {
if (vp->m_start.cno == 0 &&
(cs.cs_flags != 0 || vp->m_stop.cno == 0)) {
if (db_get(sp,
@@ -356,6 +356,7 @@
F_SET(vp, VM_LMDE);
} else
>m_start.cno;
+}
vp->m_final = vp->m_stop;
return (0);
}
Index: vi/v_txt.c
RCS file: /cvs/src/usr.bin/vi/vi/v_txt.c,v
retrieving revision 1.16
diff -u -r1.16 v_txt.c
vi/v_txt.c17 2005 19:12:16 -00001.16
vi/v_txt.c29 Dec 2005 07:03:08 -0000
@@ -1563,7 +1563,7 @@
*
* This makes the layering look like a Nachos Supreme.
*/
-search:if (isinfoline)
+search:if (isinfoline) {
if (off == tp->ai || off == tp->offset)
if (ex_is_abbrev(p, len)) {
*turnoffp = 1;
@@ -1573,6 +1573,7 @@
else
if (*turnoffp)
return (0);
+}
/* Check for any abbreviations. */
if ((qp = seq_find(sp, NULL, NULL, p, len, SEQ_ABBREV, NULL)) == NULL)
@@ -1732,7 +1733,7 @@
* If there are no spaces, or no tabs after spaces and less than
* ts spaces, it's already minimal.
*/
-if (!spaces || !tab_after_sp && spaces < ts)
+if (!spaces || (!tab_after_sp && spaces < ts))
return;
/* Count up spaces/tabs needed to get to the target. */
@@ -1911,7 +1912,7 @@
{
CHAR_T ch;
u_long sw, ts;
-size_t cno, current, spaces, target, tabs, off;
+size_t cno, current, spaces, target, tabs;
int ai_reset;
ts = VAL(sp, TABSTP);
@@ -2707,7 +2708,7 @@
else
changed = 0;
if (db_set(sp, tp->lno, tp->lb, tp->len) ||
- changed && vs_change(sp, tp->lno, LINE_RESET))
+ (changed && vs_change(sp, tp->lno, LINE_RESET)))
return (1);
for (lno = tp->lno; (tp = CIRCLEQ_NEXT(tp, q)) != (void *)&sp->tiq; ++lno) {
@@ -2716,7 +2717,7 @@
else
changed = 0;
if (db_append(sp, 0, lno, tp->lb, tp->len) ||
- changed && vs_change(sp, tp->lno, LINE_RESET))
+ (changed && vs_change(sp, tp->lno, LINE_RESET)))
return (1);
}
@@ -2791,7 +2792,7 @@
}
/* If the match is on the screen, move to it. */
-if (cs.cs_lno < m.lno || cs.cs_lno == m.lno && cs.cs_cno < m.cno)
+if (cs.cs_lno < m.lno || (cs.cs_lno == m.lno && cs.cs_cno < m.cno))
return (0);
sp->lno = cs.cs_lno;
sp->cno = cs.cs_cno;
Index: vi/v_word.c
RCS file: /cvs/src/usr.bin/vi/vi/v_word.c,v
retrieving revision 1.4
diff -u -r1.4 v_word.c
vi/v_word.c16 Feb 2002 21:27:58 -00001.4
vi/v_word.c29 Dec 2005 07:03:08 -0000
@@ -127,7 +127,7 @@
*counts as a single word move. If it's a motion command,
*don't move off the end of the line.
*/
-if (cs.cs_flags == CS_EMP || cs.cs_flags == 0 && isblank(cs.cs_ch)) {
+if (cs.cs_flags == CS_EMP || (cs.cs_flags == 0 && isblank(cs.cs_ch))) {
if (ISMTIN(vp) && cs.cs_flags != CS_EMP && cnt == 1) {
if (ISCMD(vp->rkp, 'c'))
return (0);
Index: vi/vi.c
RCS file: /cvs/src/usr.bin/vi/vi/vi.c,v
retrieving revision 1.11
diff -u -r1.11 vi.c
vi/vi.c17 2005 19:12:16 -00001.11
vi/vi.c29 Dec 2005 07:03:08 -0000
@@ -349,9 +349,9 @@
* command, since the tag may be moving to the same file.
*/
if ((F_ISSET(vp, V_ABS) ||
- F_ISSET(vp, V_ABS_L) && sp->lno != abs.lno ||
- F_ISSET(vp, V_ABS_C) &&
- (sp->lno != abs.lno || sp->cno != abs.cno)) &&
+ (F_ISSET(vp, V_ABS_L) && sp->lno != abs.lno) ||
+ (F_ISSET(vp, V_ABS_C) &&
+ (sp->lno != abs.lno || sp->cno != abs.cno))) &&
mark_set(sp, ABSMARK1, &abs, 1))
goto err;
@@ -787,7 +787,7 @@
vp->m_stop.lno = sp->lno + motion.count - 1;
if (db_get(sp, vp->m_stop.lno, 0, NULL, &len)) {
if (vp->m_stop.lno != 1 ||
- vp->key != 'c' && vp->key != '!') {
+ (vp->key != 'c' && vp->key != '!')) {
v_emsg(sp, NULL, VIM_EMPTY);
return (1);
}
@@ -859,7 +859,7 @@
*/
if (!db_exist(sp, vp->m_stop.lno)) {
if (vp->m_stop.lno != 1 ||
- vp->key != 'c' && vp->key != '!') {
+ (vp->key != 'c' && vp->key != '!')) {
v_emsg(sp, NULL, VIM_EMPTY);
return (1);
}
@@ -903,8 +903,8 @@
* Motions are from the from MARK to the to MARK (inclusive).
*/
if (motion.m_start.lno motion.m_stop.lno ||
- motion.m_start.lno == motion.m_stop.lno &&
- motion.m_start.cno motion.m_stop.cno) {
+ (motion.m_start.lno == motion.m_stop.lno &&
+ motion.m_start.cno motion.m_stop.cno)) {
vp->m_start = motion.m_stop;
vp->m_stop = motion.m_start;
} else {
Index: vi/vs_line.c
RCS file: /,v
retrieving revision 1.7
diff -u -r1.7 vs_line.c
vi/vs_line.c21 Jul 2003 07:20:18 -00001.7
vi/vs_line.c29 Dec 2005 07:03:08 -0000
@@ -174,7 +174,7 @@
* Lots of special cases for empty lines, but they only apply
* if we're displaying the first screen of the line.
*/
-if (skip_cols == 0)
+if (skip_cols == 0) {
if (dne) {
if (smp->lno == 1) {
if (list_dollar) {
@@ -191,6 +191,7 @@
empty:(void)gp->scr_addstr(sp,
KEY_NAME(sp, ch), KEY_LEN(sp, ch));
}
+}
(void)gp->scr_clrtoeol(sp);
(void)gp->scr_move(sp, oldy, oldx);
Index: vi/vs_msg.c
RCS file: /cvs/src/usr.bin/vi/vi/vs_msg.c,v
retrieving revision 1.8
diff -u -r1.8 vs_msg.c
vi/vs_msg.c17 2005 19:12:16 -00001.8
vi/vs_msg.c29 Dec 2005 07:03:08 -0000
@@ -250,12 +250,13 @@
* XXX
* Shouldn't we save this, too?
*/
-if (F_ISSET(sp, SC_TINPUT_INF) || F_ISSET(gp, G_BELLSCHED))
+if (F_ISSET(sp, SC_TINPUT_INF) || F_ISSET(gp, G_BELLSCHED)) {
if (F_ISSET(sp, SC_SCR_VI)) {
F_CLR(gp, G_BELLSCHED);
(void)gp->scr_bell(sp);
} else
F_SET(gp, G_BELLSCHED);
+}
/*
* If vi is using the error line for text input, there's no screen
@@ -281,13 +282,14 @@
* the screen, so previous opinions are ignored.
*/
if (F_ISSET(sp, SC_EX | SC_SCR_EXWRTE)) {
-if (!F_ISSET(sp, SC_SCR_EX))
+if (!F_ISSET(sp, SC_SCR_EX)) {
if (F_ISSET(sp, SC_SCR_EXWRTE)) {
if (sp->gp->scr_screen(sp, SC_EX))
return;
} else
if (ex_init(sp))
return;
+}
if (mtype == M_ERR)
(void)gp->scr_attr(sp, SA_INVERSE, 1);
@@ -349,13 +351,14 @@
padding += 2;
maxcols = sp->cols - 1;
-if (vip->lcontinue != 0)
+if (vip->lcontinue != 0) {
if (len + vip->lcontinue + padding maxcols)
vs_output(sp, vip->mtype, ".\n", 2);
else {
vs_output(sp, vip->mtype, ";", 1);
vs_output(sp, M_NNE, " ", 1);
}
+}
vip->mtype = mtype;
for (s = line;; s = t) {
for (; len 0 && isblank(*s); , ++s);
Index: vi/vs_refresh.c
RCS file: /,v
retrieving revision 1.10
diff -u -r1.10 vs_refresh.c
vi/vs_refresh.c17 2005 19:12:16 -00001.10
vi/vs_refresh.c29 Dec 2005 07:03:09 -0000
@@ -247,7 +247,7 @@
* screen but the column offset is not, we'll end up in the adjust
* code, when we should probably have compressed the screen.
*/
-if (IS_SMALL(sp))
+if (IS_SMALL(sp)) {
if (LN < HMAP->lno) {
lcnt = vs_sm_nlines(sp, HMAP, LN, sp->t_maxrows);
if (lcnt <= HALFSCREEN(sp))
@@ -284,6 +284,7 @@
goto adjust;
}
}
+}
/*
* 6b: Line down, or current screen.
@@ -395,7 +396,7 @@
adjust:if (!ISSET(sp, LEFTRIGHT) &&
(LN == HMAP->lno || LN == TMAP->lno)) {
cnt = vs_screens(sp, LN, &CN);
-if (LN == HMAP->lno && cnt < HMAP->soff)
+if (LN == HMAP->lno && cnt < HMAP->soff) {
if ((HMAP->soff - cnt) HALFTEXT(sp)) {
HMAP->soff = cnt;
vs_sm_fill(sp, BLN, P_TP);
@@ -404,7 +405,8 @@
while (cnt < HMAP->soff)
if (vs_sm_1down(sp))
return (1);
-if (LN == TMAP->lno && cnt TMAP->soff)
+}
+if (LN == TMAP->lno && cnt TMAP->soff) {
if ((cnt - TMAP->soff) HALFTEXT(sp)) {
TMAP->soff = cnt;
vs_sm_fill(sp, BLN, P_BTTM);
@@ -413,6 +415,7 @@
while (cnt TMAP->soff)
if (vs_sm_1up(sp))
return (1);
+}
}
/*
@@ -613,8 +616,8 @@
}
/* Adjust the window towards the end of the line. */
-if (off == 0 && off + SCREEN_CLS(sp) < cnt ||
- off != 0 && off + sp->cols < cnt) {
+if ((off == 0 && off + SCREEN_CLS(sp) < cnt) ||
+ (off != 0 && off + sp->cols < cnt)) {
do {
off += VAL(sp, SIDESCRLL);
} while (off + sp->cols < cnt);
Index: vi/vs_relative.c
RCS file: /,v
retrieving revision 1.3
diff -u -r1.3 vs_relative.c
vi/vs_relative.c16 Feb 2002 21:27:58 -00001.3
vi/vs_relative.c29 Dec 2005 07:03:09 -0000
@@ -155,12 +155,13 @@
*/
#defineTAB_RESET {\
curoff += chlen;\
-if (!leftright && curoff >= sp->cols)\
+if (!leftright && curoff >= sp->cols) {\
if (ch == '\t') {\
curoff = 0;\
scno -= scno % sp->cols;\
} else\
curoff -= sp->cols;\
+}\
}
if (cnop == NULL)
while (len--) {
Index: vi/vs_smap.c
RCS file: /,v
retrieving revision 1.5
diff -u -r1.5 vs_smap.c
vi/vs_smap.c10 Mar 2003 03:53:32 -00001.5
vi/vs_smap.c29 Dec 2005 07:03:09 -0000
@@ -66,7 +66,7 @@
*
* Check for line #2 before going to the end of the file.
*/
-if ((op == LINE_APPEND && lno == 0 || op == LINE_INSERT && lno == 1) &&
+if (((op == LINE_APPEND && lno == 0) || (op == LINE_INSERT && lno == 1)) &&
!db_exist(sp, 2)) {
lno = 1;
op = LINE_RESET;