diff options
author | Toomas Soome <tsoome@me.com> | 2017-07-17 23:41:59 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-02-15 11:32:32 -0500 |
commit | 9097ca5ce73b708ddec06afebe14c676da44d1ed (patch) | |
tree | fce2224021ac7118d48dd681d252a96d100c2e47 | |
parent | 58a05777fb9e6b7931e6a6f1226be4b27ef01bb5 (diff) | |
download | illumos-joyent-9097ca5ce73b708ddec06afebe14c676da44d1ed.tar.gz |
9107 vi: this statement may fall through
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <af@citrus-it.net>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/cmd/vi/port/ex.c | 1 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_addr.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_cmds.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_cmdsub.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_io.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_re.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_subr.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_unix.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_v.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vget.c | 1 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vmain.c | 12 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_voper.c | 21 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vops.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vops2.c | 3 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vput.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/ex_vwind.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/vi/port/printf.c | 12 |
17 files changed, 46 insertions, 43 deletions
diff --git a/usr/src/cmd/vi/port/ex.c b/usr/src/cmd/vi/port/ex.c index 5475c23a2b..591081cea9 100644 --- a/usr/src/cmd/vi/port/ex.c +++ b/usr/src/cmd/vi/port/ex.c @@ -311,6 +311,7 @@ main(int ac, char *av[]) rcvname = (unsigned char *)av[optind]; optind++; } + /* FALLTHROUGH */ case 'L': recov++; diff --git a/usr/src/cmd/vi/port/ex_addr.c b/usr/src/cmd/vi/port/ex_addr.c index dd2c2203a9..05e26a7290 100644 --- a/usr/src/cmd/vi/port/ex_addr.c +++ b/usr/src/cmd/vi/port/ex_addr.c @@ -30,7 +30,6 @@ /* Copyright (c) 1981 Regents of the University of California */ -#pragma ident "%Z%%M% %I% %E% SMI" #include "ex.h" #include "ex_re.h" @@ -246,6 +245,7 @@ address(inputline) case '\'': case '\\': bigmove++; + /* FALLTHROUGH */ case '.': if (addr || offset) error(gettext("Badly formed address")); diff --git a/usr/src/cmd/vi/port/ex_cmds.c b/usr/src/cmd/vi/port/ex_cmds.c index ab7146ce0f..48bb3f8a0b 100644 --- a/usr/src/cmd/vi/port/ex_cmds.c +++ b/usr/src/cmd/vi/port/ex_cmds.c @@ -803,7 +803,7 @@ suspend: #endif } - /* fall into ... */ + /* FALLTHROUGH */ /* & */ /* ~ */ diff --git a/usr/src/cmd/vi/port/ex_cmdsub.c b/usr/src/cmd/vi/port/ex_cmdsub.c index 73cd8d75fe..9004ac7271 100644 --- a/usr/src/cmd/vi/port/ex_cmdsub.c +++ b/usr/src/cmd/vi/port/ex_cmdsub.c @@ -1020,12 +1020,14 @@ zop(int hadpr) case '^': zweight = 1; + /* FALLTHROUGH */ case '-': case '+': while (peekchar() == op) { ignchar(); zweight++; } + /* FALLTHROUGH */ case '=': case '.': c = getchar(); @@ -1080,6 +1082,7 @@ zop2(int nlines, int op) case EOF: if (addr2 == dol) error(gettext("\nAt EOF")); + /* FALLTHROUGH */ case '+': if (addr2 == dol) error(gettext("At EOF")); @@ -1087,6 +1090,7 @@ zop2(int nlines, int op) if (addr2 > dol) error(gettext("Hit BOTTOM")); addr2++; + /* FALLTHROUGH */ default: addr1 = addr2; addr2 += nlines-1; diff --git a/usr/src/cmd/vi/port/ex_io.c b/usr/src/cmd/vi/port/ex_io.c index fd11f486a0..7ccbc0ac1c 100644 --- a/usr/src/cmd/vi/port/ex_io.c +++ b/usr/src/cmd/vi/port/ex_io.c @@ -101,7 +101,7 @@ gettext("No current filename")); case 'f': edited = 0; - /* fall into ... */ + /* FALLTHROUGH */ case 'e': if (savedfile[0]) { @@ -215,7 +215,7 @@ getargs(void) case '\\': if (any(peekchar(), "#%|")) c = getchar(); - /* fall into... */ + /* FALLTHROUGH */ default: if (cp > &genbuf[LBSIZE - 2]) @@ -416,6 +416,7 @@ rop(int c) case S_IFBLK: error(gettext(" Block special file")); + /* FALLTHROUGH */ case S_IFCHR: if (isatty(io)) @@ -423,6 +424,7 @@ rop(int c) if (samei(&stbuf, "/dev/null")) break; error(gettext(" Character special file")); + /* FALLTHROUGH */ case S_IFDIR: error(gettext(" Directory")); diff --git a/usr/src/cmd/vi/port/ex_re.c b/usr/src/cmd/vi/port/ex_re.c index 00f7fe083a..fd87b91338 100644 --- a/usr/src/cmd/vi/port/ex_re.c +++ b/usr/src/cmd/vi/port/ex_re.c @@ -327,7 +327,7 @@ gettext("Missing regular expression for substitute")); case '~': uselastre = 1; - /* fall into ... */ + /* FALLTHROUGH */ case '&': redo: if (re == NULL || re->Expbuf[1] == 0) @@ -474,6 +474,7 @@ gettext("Replacement pattern too long - limit 256 characters")); ungetchar(c); goto endrhs; } + /* FALLTHROUGH */ case '~': case '&': @@ -981,6 +982,7 @@ cerror(value(vi_TERSE) ? (unsigned char *)gettext("No newlines in re's") : } cerror(value(vi_TERSE) ? (unsigned char *)gettext("Badly formed re") : (unsigned char *)gettext("Missing closing delimiter for regular expression")); + /* FALLTHROUGH */ case '.': case '~': @@ -990,6 +992,7 @@ cerror(value(vi_TERSE) ? (unsigned char *)gettext("Badly formed re") : goto magic; if(c != '~') *gp++ = '\\'; + /* FALLTHROUGH */ defchar: default: *gp++ = (value(vi_IGNORECASE) ? tolower(c) : c); @@ -1038,6 +1041,7 @@ out: case 42: cerror((unsigned char *)gettext("\\( \\) Imbalance")); + /* FALLTHROUGH */ case 43: cerror(value(vi_TERSE) ? (unsigned char *)gettext("Awash in \\('s!") : (unsigned char *) diff --git a/usr/src/cmd/vi/port/ex_subr.c b/usr/src/cmd/vi/port/ex_subr.c index c920d55853..3f0980a825 100644 --- a/usr/src/cmd/vi/port/ex_subr.c +++ b/usr/src/cmd/vi/port/ex_subr.c @@ -1123,7 +1123,7 @@ int sig; flush(); setty(f); if (!inopen) - error(0); + syserror(0); else { if(vcnt < 0) { vcnt = -vcnt; diff --git a/usr/src/cmd/vi/port/ex_unix.c b/usr/src/cmd/vi/port/ex_unix.c index 5a050acf06..e1df4ae399 100644 --- a/usr/src/cmd/vi/port/ex_unix.c +++ b/usr/src/cmd/vi/port/ex_unix.c @@ -30,8 +30,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ex.h" #include "ex_temp.h" #include "ex_tty.h" @@ -100,6 +98,7 @@ gettext("Incomplete shell escape command - use 'shell' to get a shell")); contread = 1; } } + /* FALLTHROUGH */ default: if (up >= (unsigned char *)&uxb[UXBSIZE]) { tunix: diff --git a/usr/src/cmd/vi/port/ex_v.c b/usr/src/cmd/vi/port/ex_v.c index c93a59ea7e..b242efb1e4 100644 --- a/usr/src/cmd/vi/port/ex_v.c +++ b/usr/src/cmd/vi/port/ex_v.c @@ -30,8 +30,6 @@ /* Copyright (c) 1981 Regents of the University of California */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ex.h" #include "ex_re.h" #include "ex_tty.h" @@ -440,7 +438,7 @@ setwind(void) case ONEOPEN: if (auto_right_margin) WCOLS--; - /* fall into ... */ + /* FALLTHROUGH */ case HARDOPEN: basWTOP = WTOP = WBOT = WECHO = 0; @@ -450,7 +448,7 @@ setwind(void) case CRTOPEN: basWTOP = lines - 2; - /* fall into */ + /* FALLTHROUGH */ case VISUAL: ZERO = lines - TUBESIZE / WCOLS; diff --git a/usr/src/cmd/vi/port/ex_vget.c b/usr/src/cmd/vi/port/ex_vget.c index c96d4bc29c..9ea4e6acb6 100644 --- a/usr/src/cmd/vi/port/ex_vget.c +++ b/usr/src/cmd/vi/port/ex_vget.c @@ -398,6 +398,7 @@ char *cmdstr, *sgn; } else if (cmdstr[1] != 'o') { goto Default; } + /* FALLTHROUGH */ case 't': if (cmdstr[1] != '\0') goto Default; diff --git a/usr/src/cmd/vi/port/ex_vmain.c b/usr/src/cmd/vi/port/ex_vmain.c index b11439a182..e37f03b3b0 100644 --- a/usr/src/cmd/vi/port/ex_vmain.c +++ b/usr/src/cmd/vi/port/ex_vmain.c @@ -698,7 +698,7 @@ reread: operate('$', 1); appnd: c = 'a'; - /* fall into ... */ + /* FALLTHROUGH */ /* * a Appends text after cursor. Text can continue @@ -730,7 +730,7 @@ appnd: case 'I': operate('^', 1); c = 'i'; - /* fall into ... */ + /* FALLTHROUGH */ /* * R Replace characters, one for one, by input @@ -743,7 +743,7 @@ appnd: * you can't move around within a R, etc. */ case 'R': - /* fall into... */ + /* FALLTHROUGH */ /* * i Insert text to an escape in the buffer. @@ -789,7 +789,7 @@ insrt: (void) beep(); if (initev || peekkey() != ATTN) continue; - /* fall into... */ + /* FALLTHROUGH */ /* * ^\ A quit always gets command mode. @@ -822,7 +822,7 @@ insrt: continue; } #endif - /* fall into... */ + /* FALLTHROUGH */ /* * Q Is like q, but always gets to command mode @@ -1484,7 +1484,7 @@ vzop(bool hadcnt, int cnt, int c) case '+': forbid (addr >= dol); - /* fall into ... */ + /* FALLTHROUGH */ case CR: case NL: diff --git a/usr/src/cmd/vi/port/ex_voper.c b/usr/src/cmd/vi/port/ex_voper.c index 8ce2904af2..704a166987 100644 --- a/usr/src/cmd/vi/port/ex_voper.c +++ b/usr/src/cmd/vi/port/ex_voper.c @@ -106,7 +106,7 @@ operate(int c, int cnt) case 's': ungetkey(' '); subop++; - /* fall into ... */ + /* FALLTHROUGH */ /* * c Change operator. @@ -140,7 +140,7 @@ operate(int c, int cnt) */ case '=': forbid(!value(vi_LISP)); - /* fall into ... */ + /* FALLTHROUGH */ /* * > Right shift operator. @@ -269,7 +269,7 @@ nocount: case 'b': case 'B': dir = -1; - /* fall into ... */ + /* FALLTHROUGH */ /* * w Forward a word. @@ -304,7 +304,7 @@ ein: */ case '(': dir = -1; - /* fall into... */ + /* FALLTHROUGH */ /* * ) Forward an s-expression. @@ -321,7 +321,7 @@ ein: */ case '{': dir = -1; - /* fall into... */ + /* FALLTHROUGH */ /* * } Forward an s-expression, but don't stop on atoms. @@ -377,7 +377,7 @@ ein: */ case '[': dir = -1; - /* fall into ... */ + /* FALLTHROUGH */ /* * ] Forward to next defun, i.e. a ( in column 1. @@ -451,7 +451,7 @@ ein: case 'F': /* inverted find */ case 'T': dir = -1; - /* fall into ... */ + /* FALLTHROUGH */ /* * f Find single character following cursor in current line. @@ -483,6 +483,7 @@ ein: case 't': wcursor = lastchr(linebuf, wcursor); + /* FALLTHROUGH */ case 'f': fixup: if (moveop != vmove) @@ -544,7 +545,7 @@ fixup: case 'h': case CTRL('h'): dir = -1; - /* fall into ... */ + /* FALLTHROUGH */ /* * space Forward a character. @@ -580,7 +581,7 @@ fixup: */ case 'X': dir = -1; - /* fall into ... */ + /* FALLTHROUGH */ deleteit: /* * x Delete character at cursor, leaving cursor where it is. @@ -611,7 +612,7 @@ errlab: vmacp = 0; return; } - /* fall into ... */ + /* FALLTHROUGH */ /* * _ Target for a line or group of lines. diff --git a/usr/src/cmd/vi/port/ex_vops.c b/usr/src/cmd/vi/port/ex_vops.c index 71dba8cf5a..9b92299233 100644 --- a/usr/src/cmd/vi/port/ex_vops.c +++ b/usr/src/cmd/vi/port/ex_vops.c @@ -115,7 +115,7 @@ bool show; /* if true update the screen */ vsave(); (void) YANKreg('1'); notecnt = 0; - /* fall into ... */ + /* FALLTHROUGH */ case VMANY: case VMCHNG: diff --git a/usr/src/cmd/vi/port/ex_vops2.c b/usr/src/cmd/vi/port/ex_vops2.c index f47b9adcdf..1b10b6d273 100644 --- a/usr/src/cmd/vi/port/ex_vops2.c +++ b/usr/src/cmd/vi/port/ex_vops2.c @@ -1362,7 +1362,7 @@ ws: goto def; } c = '\n'; - /* presto chango ... */ + /* FALLTHROUGH */ /* * \n Start new line. @@ -1417,6 +1417,7 @@ ws: ogcursor = cp; goto vbackup; } + /* FALLTHROUGH */ /* * ^D works only if we are at the (end of) the * generated autoindent. We count the ^D for repeat diff --git a/usr/src/cmd/vi/port/ex_vput.c b/usr/src/cmd/vi/port/ex_vput.c index 6641d11cbd..726a941658 100644 --- a/usr/src/cmd/vi/port/ex_vput.c +++ b/usr/src/cmd/vi/port/ex_vput.c @@ -30,8 +30,6 @@ /* Copyright (c) 1981 Regents of the University of California */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" @@ -1309,7 +1307,7 @@ vputchar(wchar_t c) return (0); } c = ' ' | QUOTE; - /* fall into ... */ + /* FALLTHROUGH */ def: default: diff --git a/usr/src/cmd/vi/port/ex_vwind.c b/usr/src/cmd/vi/port/ex_vwind.c index cdaf577a2b..3fa2f9fc22 100644 --- a/usr/src/cmd/vi/port/ex_vwind.c +++ b/usr/src/cmd/vi/port/ex_vwind.c @@ -206,7 +206,7 @@ vcontext(line *addr, unsigned char where) case '^': addr = vback(addr, basWLINES - vdepth()); getaline(*addr); - /* fall into ... */ + /* FALLTHROUGH */ case '-': top = vback(addr, basWLINES - vdepth()); diff --git a/usr/src/cmd/vi/port/printf.c b/usr/src/cmd/vi/port/printf.c index ba242a4e92..fef1440e14 100644 --- a/usr/src/cmd/vi/port/printf.c +++ b/usr/src/cmd/vi/port/printf.c @@ -37,12 +37,6 @@ * contributors. */ -/* The pwb version this is based on */ -static char *printf_id = "@(#) printf.c:2.2 6/5/79"; -/* The local sccs version within ex */ - -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdarg.h> #include <stdlib.h> #include <limits.h> @@ -162,7 +156,7 @@ viprintf(unsigned char *fmt, ...) case 'L': case 'l': length = 2; - /* no break!! */ + /* FALLTHROUGH */ case 'h': case 'H': length--; @@ -196,7 +190,7 @@ viprintf(unsigned char *fmt, ...) case 'O': length = 1; fcode = 'o'; - /* no break */ + /* FALLTHROUGH */ case 'o': case 'X': case 'x': @@ -245,7 +239,7 @@ viprintf(unsigned char *fmt, ...) case 'I': length = 1; fcode = fcode + 'a' - 'A'; - /* no break */ + /* FALLTHROUGH */ case 'd': case 'i': case 'u': |