diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-08 21:05:41 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-08 21:05:41 +0000 |
commit | fcde5ec1a7e7dda343ba822c73be5f080b0ff0c8 (patch) | |
tree | fae8f53125cc8dbd05f4b107c32d3733dbfdd6da /usr.bin/vi/ex | |
parent | e36b0788688a5dd823dc99c40167de645deb9988 (diff) |
Explicit braces around macro fields and logical operations, gets rid of 148
warnings, no functional change.
From Ray Lai.
Diffstat (limited to 'usr.bin/vi/ex')
-rw-r--r-- | usr.bin/vi/ex/ex.c | 14 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex.h | 12 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_bang.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_cd.c | 8 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_cscope.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_filter.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_global.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_script.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_shell.c | 90 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_subst.c | 31 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_tag.c | 9 | ||||
-rw-r--r-- | usr.bin/vi/ex/ex_usage.c | 4 |
12 files changed, 100 insertions, 93 deletions
diff --git a/usr.bin/vi/ex/ex.c b/usr.bin/vi/ex/ex.c index 68d82bc8bb1..93ffa588d45 100644 --- a/usr.bin/vi/ex/ex.c +++ b/usr.bin/vi/ex/ex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex.c,v 1.12 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex.c,v 1.13 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -1250,7 +1250,7 @@ addr_verify: ex_badaddr(sp, ecp->cmd, A_ZERO, NUM_OK); 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_COUNT)) { if (db_last(sp, &lno)) goto err; @@ -1259,6 +1259,7 @@ addr_verify: ex_badaddr(sp, NULL, A_EOF, NUM_OK); goto err; } + } /* FALLTHROUGH */ case 1: if (ecp->addr1.lno == 0) { @@ -1894,7 +1895,7 @@ ex_line(sp, ecp, mp, isaddrp, errp) * 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 @@ search: mp->lno = sp->lno; for (;;) { for (; ecp->clen > 0 && isblank(ecp->cp[0]); ++ecp->cp, --ecp->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 @@ ex_load(sp) /* If it's a global/v command, fix up the last line. */ if (FL_ISSET(ecp->agv_flags, - AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) + AGV_GLOBAL | AGV_V) && ecp->range_lno != OOBLNO) { if (db_exist(sp, ecp->range_lno)) sp->lno = ecp->range_lno; else { @@ -2128,6 +2129,7 @@ ex_load(sp) if (sp->lno == 0) sp->lno = 1; } + } free(ecp->o_cp); } diff --git a/usr.bin/vi/ex/ex.h b/usr.bin/vi/ex/ex.h index 5f0ea3183ea..95de526aa64 100644 --- a/usr.bin/vi/ex/ex.h +++ b/usr.bin/vi/ex/ex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ex.h,v 1.5 2002/02/16 21:27:57 millert Exp $ */ +/* $OpenBSD: ex.h,v 1.6 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -48,8 +48,8 @@ extern EXCMDLIST const cmds[]; /* Table of ex commands. */ * enforce that here, just in case someone depends on it. */ #define IS_ESCAPE(sp, cmdp, ch) \ - (F_ISSET(cmdp, E_VLITONLY) ? \ - (ch) == CH_LITERAL : KEY_VAL(sp, ch) == K_VLNEXT) + (F_ISSET((cmdp), E_VLITONLY) ? \ + (ch) == CH_LITERAL : KEY_VAL((sp), (ch)) == K_VLNEXT) /* * File state must be checked for each command -- any ex command may be entered @@ -58,7 +58,7 @@ extern EXCMDLIST const cmds[]; /* Table of ex commands. */ */ #define NEEDFILE(sp, cmdp) { \ if ((sp)->ep == NULL) { \ - ex_emsg(sp, (cmdp)->cmd->name, EXM_NOFILEYET); \ + ex_emsg((sp), (cmdp)->cmd->name, EXM_NOFILEYET); \ return (1); \ } \ } @@ -104,10 +104,10 @@ struct _excmd { /* Clear the structure before each ex command. */ #define CLEAR_EX_CMD(cmdp) { \ - u_int32_t L__f = F_ISSET(cmdp, E_PRESERVE); \ + u_int32_t L__f = F_ISSET((cmdp), E_PRESERVE); \ memset(&((cmdp)->buffer), 0, ((char *)&(cmdp)->flags - \ (char *)&((cmdp)->buffer)) + sizeof((cmdp)->flags)); \ - F_SET(cmdp, L__f); \ + F_SET((cmdp), L__f); \ } CHAR_T buffer; /* Command: named buffer. */ diff --git a/usr.bin/vi/ex/ex_bang.c b/usr.bin/vi/ex/ex_bang.c index e80c7594746..2532b7be7ed 100644 --- a/usr.bin/vi/ex/ex_bang.c +++ b/usr.bin/vi/ex/ex_bang.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_bang.c,v 1.5 2002/02/16 21:27:57 millert Exp $ */ +/* $OpenBSD: ex_bang.c,v 1.6 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -103,7 +103,7 @@ ex_bang(sp, cmdp) */ if (cmdp->addrcnt == 0) { msg = NULL; - if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) + if (sp->ep != NULL && F_ISSET(sp->ep, F_MODIFIED)) { if (O_ISSET(sp, O_AUTOWRITE)) { if (file_aw(sp, FS_ALL)) return (0); @@ -112,6 +112,7 @@ ex_bang(sp, cmdp) 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, diff --git a/usr.bin/vi/ex/ex_cd.c b/usr.bin/vi/ex/ex_cd.c index 059c46d2ce5..d2782413331 100644 --- a/usr.bin/vi/ex/ex_cd.c +++ b/usr.bin/vi/ex/ex_cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cd.c,v 1.7 2005/04/21 15:39:31 jmc Exp $ */ +/* $OpenBSD: ex_cd.c,v 1.8 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -93,9 +93,9 @@ ex_cd(sp, cmdp) */ 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 O_CDPATH option values. */ diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index 83b5ca5a3dd..b6344c3846f 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.11 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.12 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -824,7 +824,7 @@ csc_help(sp, cmd) { 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 @@ csc_help(sp, cmd) 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) diff --git a/usr.bin/vi/ex/ex_filter.c b/usr.bin/vi/ex/ex_filter.c index 89d610efa39..e709f6e539f 100644 --- a/usr.bin/vi/ex/ex_filter.c +++ b/usr.bin/vi/ex/ex_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_filter.c,v 1.7 2002/06/12 06:07:17 mpech Exp $ */ +/* $OpenBSD: ex_filter.c,v 1.8 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -181,11 +181,12 @@ err: if (input[0] != -1) 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; } diff --git a/usr.bin/vi/ex/ex_global.c b/usr.bin/vi/ex/ex_global.c index 8c55c211d8b..0858bebf70d 100644 --- a/usr.bin/vi/ex/ex_global.c +++ b/usr.bin/vi/ex/ex_global.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_global.c,v 1.7 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex_global.c,v 1.8 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -125,11 +125,12 @@ usage: ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c index a98bc633fa1..bb6bf982cd4 100644 --- a/usr.bin/vi/ex/ex_script.c +++ b/usr.bin/vi/ex/ex_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_script.c,v 1.12 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex_script.c,v 1.13 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -379,7 +379,7 @@ sscr_input(sp) GS *gp; struct timeval tv; fd_set *rdfd; - int maxfd, nfd; + int maxfd; gp = sp->gp; @@ -434,7 +434,6 @@ static int sscr_insert(sp) SCR *sp; { - struct timeval tv; CHAR_T *endp, *p, *t; SCRIPT *sc; struct pollfd pfd[1]; diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c index e5ce2832654..a8ff35b4bc4 100644 --- a/usr.bin/vi/ex/ex_shell.c +++ b/usr.bin/vi/ex/ex_shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_shell.c,v 1.9 2002/06/12 06:07:17 mpech Exp $ */ +/* $OpenBSD: ex_shell.c,v 1.10 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -226,136 +226,136 @@ typedef struct _sigs { 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 SIGCONT - SIGCONT, "Continued", + { SIGCONT, "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 SIGINFO - SIGINFO, "Information request", + { SIGINFO, "Information request" }, #endif #ifdef SIGINT - SIGINT, "Interrupt", + { SIGINT, "Interrupt" }, #endif #ifdef SIGIO - SIGIO, "I/O possible", + { SIGIO, "I/O possible" }, #endif #ifdef SIGIOT - SIGIOT, "IOT trap", + { SIGIOT, "IOT trap" }, #endif #ifdef SIGKILL - SIGKILL, "Killed", + { SIGKILL, "Killed" }, #endif #ifdef SIGLOST - SIGLOST, "Record lock", + { SIGLOST, "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 SIGPOLL - SIGPOLL, "I/O possible", + { SIGPOLL, "I/O possible" }, #endif #ifdef SIGPRE - SIGPRE, "Programming error", + { SIGPRE, "Programming error" }, #endif #ifdef SIGPROF - SIGPROF, "Profiling timer expired", + { SIGPROF, "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 SIGSOUND - SIGSOUND, "HFT sound sequence completed", + { SIGSOUND, "HFT sound sequence completed" }, #endif #ifdef SIGSTOP - SIGSTOP, "Suspended (signal)", + { SIGSTOP, "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 SIGTTOU - SIGTTOU, "Stopped (tty output)", + { SIGTTOU, "Stopped (tty output)" }, #endif #ifdef SIGURG - SIGURG, "Urgent I/O condition", + { SIGURG, "Urgent I/O 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 }; diff --git a/usr.bin/vi/ex/ex_subst.c b/usr.bin/vi/ex/ex_subst.c index 454f1d2f85e..97eef49722c 100644 --- a/usr.bin/vi/ex/ex_subst.c +++ b/usr.bin/vi/ex/ex_subst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_subst.c,v 1.13 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex_subst.c,v 1.14 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -122,11 +122,12 @@ subagain: return (ex_subagain(sp, cmdp)); *t = '\0'; break; } - if (p[0] == '\\') + if (p[0] == '\\') { if (p[1] == delim) ++p; else if (p[1] == '\\') *t++ = *p++; + } *t++ = *p++; } @@ -308,12 +309,12 @@ ex_subtilde(sp, cmdp) * confident. */ #define NEEDNEWLINE(sp) { \ - if (sp->newl_len == sp->newl_cnt) { \ - sp->newl_len += 25; \ - REALLOC(sp, sp->newl, size_t *, \ - sp->newl_len * sizeof(size_t)); \ - if (sp->newl == NULL) { \ - sp->newl_len = 0; \ + if ((sp)->newl_len == (sp)->newl_cnt) { \ + (sp)->newl_len += 25; \ + REALLOC((sp), (sp)->newl, size_t *, \ + (sp)->newl_len * sizeof(size_t)); \ + if ((sp)->newl == NULL) { \ + (sp)->newl_len = 0; \ return (1); \ } \ } \ @@ -322,25 +323,25 @@ ex_subtilde(sp, cmdp) #define BUILD(sp, l, len) { \ if (lbclen + (len) > lblen) { \ lblen += MAX(lbclen + (len), 256); \ - REALLOC(sp, lb, char *, lblen); \ + REALLOC((sp), lb, char *, lblen); \ if (lb == NULL) { \ lbclen = 0; \ return (1); \ } \ } \ - memcpy(lb + lbclen, l, len); \ - lbclen += len; \ + memcpy(lb + lbclen, (l), (len)); \ + lbclen += (len); \ } #define NEEDSP(sp, len, pnt) { \ if (lbclen + (len) > lblen) { \ lblen += MAX(lbclen + (len), 256); \ - REALLOC(sp, lb, char *, lblen); \ + REALLOC((sp), lb, char *, lblen); \ if (lb == NULL) { \ lbclen = 0; \ return (1); \ } \ - pnt = lb + lbclen; \ + (pnt) = lb + lbclen; \ } \ } @@ -476,7 +477,7 @@ s(sp, cmdp, s, re, flags) 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); } @@ -1367,7 +1368,7 @@ re_sub(sp, ip, lbp, lbclenp, lblenp, match) #define OUTCH(ch, nltrans) { \ CHAR_T __ch = (ch); \ u_int __value = KEY_VAL(sp, __ch); \ - if (nltrans && (__value == K_CR || __value == K_NL)) { \ + if ((nltrans) && (__value == K_CR || __value == K_NL)) { \ NEEDNEWLINE(sp); \ sp->newl[sp->newl_cnt++] = lbclen; \ } else if (conv != C_NOTSET) { \ diff --git a/usr.bin/vi/ex/ex_tag.c b/usr.bin/vi/ex/ex_tag.c index 56022d9b051..ea4ccc9a1cc 100644 --- a/usr.bin/vi/ex/ex_tag.c +++ b/usr.bin/vi/ex/ex_tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_tag.c,v 1.11 2005/10/17 19:12:16 otto Exp $ */ +/* $OpenBSD: ex_tag.c,v 1.12 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -169,7 +169,7 @@ ex_tag_push(sp, cmdp) 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_FORCE); @@ -939,7 +939,7 @@ ctag_search(sp, search, slen, tag) 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 @@ ctag_search(sp, search, slen, tag) notfound: tag_msg(sp, TAG_SEARCH, tag); return (1); } + } /* * !!! * Historically, tags set the search direction if it wasn't @@ -1244,7 +1245,7 @@ ctag_file(sp, tfp, name, dirp, dlenp) #define GREATER 1 #define LESS (-1) -#define SKIP_PAST_NEWLINE(p, back) while (p < back && *p++ != '\n'); +#define SKIP_PAST_NEWLINE(p, back) while ((p) < (back) && *(p)++ != '\n'); static char * binary_search(string, front, back) diff --git a/usr.bin/vi/ex/ex_usage.c b/usr.bin/vi/ex/ex_usage.c index 389b012bc1c..654938ee56b 100644 --- a/usr.bin/vi/ex/ex_usage.c +++ b/usr.bin/vi/ex/ex_usage.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_usage.c,v 1.4 2002/02/16 21:27:57 millert Exp $ */ +/* $OpenBSD: ex_usage.c,v 1.5 2006/01/08 21:05:40 miod Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -79,7 +79,7 @@ ex_usage(sp, cmdp) 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", |