From f653234f1bb91fdca11fbfa65477f68ac1a1cc87 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sat, 20 Jan 2018 22:21:43 +0100
Subject: [PATCH] ift usr.bin

---
 usr.bin/at/at.c             | 2 +-
 usr.bin/at/parsetime.c      | 7 ++++++-
 usr.bin/chat/chat.c         | 2 ++
 usr.bin/colcrt/colcrt.c     | 1 +
 usr.bin/ctags/ctags.c       | 1 +
 usr.bin/indent/indent.c     | 2 ++
 usr.bin/indent/io.c         | 1 +
 usr.bin/indent/lexi.c       | 1 +
 usr.bin/indent/parse.c      | 2 ++
 usr.bin/jot/jot.c           | 5 +++++
 usr.bin/limits/limits.c     | 1 +
 usr.bin/rs/rs.c             | 6 ++++++
 usr.bin/sed/main.c          | 3 +--
 usr.bin/tput/tput.c         | 1 +
 usr.bin/truncate/truncate.c | 4 ++++
 usr.bin/tset/wrterm.c       | 1 +
 usr.bin/vgrind/vfontedpr.c  | 1 +
 usr.bin/window/cmd.c        | 2 ++
 usr.bin/window/parser1.c    | 1 +
 usr.bin/window/parser3.c    | 4 ++++
 usr.bin/window/scanner.c    | 3 +++
 usr.bin/window/ttzapple.c   | 4 ++++
 22 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index cd29b33cf0..002cba68c6 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -804,7 +804,7 @@ main(int argc, char **argv)
 
 	case 'd':
 	    warnx("-d is deprecated; use -r instead");
-	    /* fall through to 'r' */
+	    /* FALLTHROUGH */
 
 	case 'r':
 	    if (program != AT)
diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c
index 1c56f12d77..731cb33d8e 100644
--- a/usr.bin/at/parsetime.c
+++ b/usr.bin/at/parsetime.c
@@ -300,6 +300,7 @@ plus(struct tm *tm)
 	    break;
     case WEEKS:
 	    delay *= 7;
+	    /* FALLTHROUGH */
     case DAYS:
 	    tm->tm_mday += delay;
 	    break;
@@ -458,6 +459,7 @@ month(struct tm *tm)
 	    /* do something tomorrow */
 	    tm->tm_mday ++;
 	    tm->tm_wday ++;
+	    /* FALLTHROUGH */
     case TODAY:	/* force ourselves to stay in today - no further processing */
 	    token();
 	    break;
@@ -581,6 +583,7 @@ parsetime(int argc, char **argv)
 	    }
 	    /* now is optional prefix for PLUS tree */
 	    expect(PLUS);
+	    /* FALLTHROUGH */
     case PLUS:
 	    plus(&runtime);
 	    break;
@@ -599,8 +602,10 @@ parsetime(int argc, char **argv)
 	     */
     case TEATIME:
 	    hr += 4;
+	    /* FALLTHROUGH */
     case NOON:
 	    hr += 12;
+	    /* FALLTHROUGH */
     case MIDNIGHT:
 	    if (runtime.tm_hour >= hr) {
 		runtime.tm_mday++;
@@ -609,7 +614,7 @@ parsetime(int argc, char **argv)
 	    runtime.tm_hour = hr;
 	    runtime.tm_min = 0;
 	    token();
-	    /* FALLTHROUGH to month setting */
+	    /* FALLTHROUGH */
     default:
 	    month(&runtime);
 	    break;
diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c
index f7640ebd57..606b017fc3 100644
--- a/usr.bin/chat/chat.c
+++ b/usr.bin/chat/chat.c
@@ -1030,6 +1030,7 @@ get_char(void)
 
     default:
 	chat_logf("warning: read() on stdin returned %d", status);
+	/* FALLTHROUGH */
 
     case -1:
 	if ((status = fcntl(0, F_GETFL, 0)) == -1)
@@ -1057,6 +1058,7 @@ static int put_char(int c)
 	
     default:
 	chat_logf("warning: write() on stdout returned %d", status);
+	/* FALLTHROUGH */
 	
     case -1:
 	if ((status = fcntl(0, F_GETFL, 0)) == -1)
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c
index 0a9332d8ac..295ef57eb7 100644
--- a/usr.bin/colcrt/colcrt.c
+++ b/usr.bin/colcrt/colcrt.c
@@ -144,6 +144,7 @@ main(int argc, char *argv[])
 				outcol &= ~7;
 				outcol--;
 				c = ' ';
+				/* FALLTHROUGH */
 			default:
 				if ((w = wcwidth(c)) <= 0)
 					w = 1;	/* XXX */
diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c
index f0f9cc5032..0a852019b1 100644
--- a/usr.bin/ctags/ctags.c
+++ b/usr.bin/ctags/ctags.c
@@ -118,6 +118,7 @@ main(int argc, char **argv)
 			break;
 		case 'v':
 			vflag++;
+			/* FALLTHROUGH */
 		case 'x':
 			xflag++;
 			break;
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 6006560c9b..a71de3a5dd 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -322,6 +322,7 @@ main(int argc, char **argv)
 		    goto sw_buffer;	/* go to common code to get out of
 					 * this loop */
 		}
+		/* FALLTHROUGH */
 	    case comment:	/* we have a comment, so we must copy it into
 				 * the buffer */
 		if (!flushed_nl || sc_end != 0) {
@@ -359,6 +360,7 @@ main(int argc, char **argv)
 			fill_buffer();
 		    break;
 		}
+		/* FALLTHROUGH */
 	    default:		/* it is the start of a normal statement */
 		if (flushed_nl)	/* if we flushed a newline, make sure it is
 				 * put back */
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c
index c29c67599a..435ffd89b1 100644
--- a/usr.bin/indent/io.c
+++ b/usr.bin/indent/io.c
@@ -189,6 +189,7 @@ dump_line(void)
 				break;
 			    case '\\':
 				putc('\\', output);
+				/* FALLTHROUGH */
 			    default:
 				putc(*follow, output);
 			    }
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index 1cd29f27fa..85cc868b65 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -304,6 +304,7 @@ lexi(void)
 
 	    case 7:
 		ps.sizeof_keyword = true;
+		/* FALLTHROUGH */
 	    default:		/* all others are treated like any other
 				 * identifier */
 		return (ident);
diff --git a/usr.bin/indent/parse.c b/usr.bin/indent/parse.c
index f5e903a1de..054fc89e49 100644
--- a/usr.bin/indent/parse.c
+++ b/usr.bin/indent/parse.c
@@ -84,6 +84,7 @@ parse(int tk) /* tk: the code for the construct scanned */
     case ifstmt:		/* scanned if (...) */
 	if (ps.p_stack[ps.tos] == elsehead && ps.else_if)	/* "else if ..." */
 	    ps.i_l_follow = ps.il[ps.tos];
+	/* FALLTHROUGH */
     case dolit:		/* 'do' */
     case forstmt:		/* for (...) */
 	ps.p_stack[++ps.tos] = tk;
@@ -287,6 +288,7 @@ reduce(void)
 	    case swstmt:
 		/* <switch> <stmt> */
 		case_ind = ps.cstk[ps.tos - 1];
+		/* FALLTHROUGH */
 
 	    case decl:		/* finish of a declaration */
 	    case elsehead:
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index a075f27d13..a6c9916c67 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -127,6 +127,7 @@ main(int argc, char **argv)
 				errx(1, "bad s value: %s", argv[3]);
 			mask |= 01;
 		}
+		/* FALLTHROUGH */
 	case 3:
 		if (!is_default(argv[2])) {
 			if (!sscanf(argv[2], "%lf", &ender))
@@ -135,6 +136,7 @@ main(int argc, char **argv)
 			if (!prec)
 				n = getprec(argv[2]);
 		}
+		/* FALLTHROUGH */
 	case 2:
 		if (!is_default(argv[1])) {
 			if (!sscanf(argv[1], "%lf", &begin))
@@ -145,6 +147,7 @@ main(int argc, char **argv)
 			if (n > prec)		/* maximum precision */
 				prec = n;
 		}
+		/* FALLTHROUGH */
 	case 1:
 		if (!is_default(argv[0])) {
 			if (!sscanf(argv[0], "%ld", &reps))
@@ -400,11 +403,13 @@ getformat(void)
 				intdata = 1;
 				break;
 			}
+			/* FALLTHROUGH */
 		case 'O': case 'U':
 			if (!longdata) {
 				intdata = nosign = 1;
 				break;
 			}
+			/* FALLTHROUGH */
 		case 'c':
 			if (!(intdata | longdata)) {
 				chardata = 1;
diff --git a/usr.bin/limits/limits.c b/usr.bin/limits/limits.c
index 8782a74cab..0e535646d3 100644
--- a/usr.bin/limits/limits.c
+++ b/usr.bin/limits/limits.c
@@ -587,6 +587,7 @@ resource_num(int which, int ch, const char *str)
 		switch (*e++) {
 		case 0:	/* end of string */
 		    e--;
+		    /* FALLTHROUGH */
 		default:
 		    mult = 1;
 		    break;
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index c855fd795e..47b835614f 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -384,11 +384,13 @@ getargs(int ac, char *av[])
 			switch (*p) {
 			case 'T':
 				flags |= MTRANSPOSE;
+				/* FALLTHROUGH */
 			case 't':
 				flags |= TRANSPOSE;
 				break;
 			case 'c':		/* input col. separator */
 				flags |= ONEISEPONLY;
+				/* FALLTHROUGH */
 			case 's':		/* one or more allowed */
 				if (p[1])
 					isep = *++p;
@@ -397,6 +399,7 @@ getargs(int ac, char *av[])
 				break;
 			case 'C':
 				flags |= ONEOSEPONLY;
+				/* FALLTHROUGH */
 			case 'S':
 				if (p[1])
 					osep = *++p;
@@ -410,6 +413,7 @@ getargs(int ac, char *av[])
 				break;
 			case 'K':			/* skip N lines */
 				flags |= SKIPPRINT;
+				/* FALLTHROUGH */
 			case 'k':			/* skip, do not print */
 				p = getnum(&skip, p, 0);
 				if (!skip)
@@ -441,6 +445,7 @@ getargs(int ac, char *av[])
 				break;
 			case 'H':			/* print shape only */
 				flags |= DETAILSHAPE;
+				/* FALLTHROUGH */
 			case 'h':
 				flags |= SHAPEONLY;
 				break;
@@ -471,6 +476,7 @@ getargs(int ac, char *av[])
 		opages = atoi(av[2]);*/
 	case 2:
 		ocols = atoi(av[1]);
+		/* FALLTHROUGH */
 	case 1:
 		orows = atoi(av[0]);
 	case 0:
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 566fd57271..2b01a83299 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -228,7 +228,6 @@ cu_fgets(char *buf, int n, int *more)
 				err(1, "%s", script->s);
 			fname = script->s;
 			state = ST_FILE;
-			goto again;
 		case CU_STRING:
 			if (((size_t)snprintf(string_ident,
 			    sizeof(string_ident), "\"%s\"", script->s)) >=
@@ -238,8 +237,8 @@ cu_fgets(char *buf, int n, int *more)
 			fname = string_ident;
 			s = script->s;
 			state = ST_STRING;
-			goto again;
 		}
+		goto again;
 	case ST_FILE:
 		if ((p = fgets(buf, n, f)) != NULL) {
 			linenum++;
diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c
index e35eb64a99..1c3e1974d9 100644
--- a/usr.bin/tput/tput.c
+++ b/usr.bin/tput/tput.c
@@ -153,6 +153,7 @@ process(const char *cap, const char *str, char **argv)
 					cp++;
 					break;
 				    }
+				    /* FALLTHROUGH */
 			    default:
 				/*
 				 * hpux has lot's of them, but we complain
diff --git a/usr.bin/truncate/truncate.c b/usr.bin/truncate/truncate.c
index 8fee51661d..17d484980f 100644
--- a/usr.bin/truncate/truncate.c
+++ b/usr.bin/truncate/truncate.c
@@ -158,6 +158,7 @@ parselength(char *ls, off_t *sz)
 	switch (*ls) {
 	case '-':
 		lsign = -1;
+		/* FALLTHROUGH */
 	case '+':
 		ls++;
 	}
@@ -176,14 +177,17 @@ parselength(char *ls, off_t *sz)
 	case 'G':
 		oflow = length * 1024;
 		ASSIGN_CHK_OFLOW(oflow, length);
+		/* FALLTHROUGH */
 	case 'M':
 		oflow = length * 1024;
 		ASSIGN_CHK_OFLOW(oflow, length);
+		/* FALLTHROUGH */
 	case 'K':
 		if (ls[1] != '\0')
 			return -1;
 		oflow = length * 1024;
 		ASSIGN_CHK_OFLOW(oflow, length);
+		/* FALLTHROUGH */
 	case '\0':
 		break;
 	default:
diff --git a/usr.bin/tset/wrterm.c b/usr.bin/tset/wrterm.c
index 2053a35b47..d5c17fae29 100644
--- a/usr.bin/tset/wrterm.c
+++ b/usr.bin/tset/wrterm.c
@@ -76,6 +76,7 @@ wrtermcap(char *bp)
 			switch(ch) {
 			case '\033':
 				(void)printf("\\E");
+				/* FALLTHROUGH */
 			case  ' ':		/* No spaces. */
 				(void)printf("\\040");
 				break;
diff --git a/usr.bin/vgrind/vfontedpr.c b/usr.bin/vgrind/vfontedpr.c
index 9114512ad9..3848df3317 100644
--- a/usr.bin/vgrind/vfontedpr.c
+++ b/usr.bin/vgrind/vfontedpr.c
@@ -662,6 +662,7 @@ putcp(int c)
 	default:
 		if (c < 040)
 			putchar('^'), c |= '@';
+		/* FALLTHROUGH */
 	case '\t':
 	case '\n':
 		putchar(c);
diff --git a/usr.bin/window/cmd.c b/usr.bin/window/cmd.c
index 020a792514..2a1eb5fbfc 100644
--- a/usr.bin/window/cmd.c
+++ b/usr.bin/window/cmd.c
@@ -64,6 +64,7 @@ docmd(void)
 		default:
 			if (c != escapec)
 				break;
+			/* FALLTHROUGH */
 		case 'h': case 'j': case 'k': case 'l':
 		case 'y': case 'p':
 		case ctrl('y'):
@@ -193,6 +194,7 @@ docmd(void)
 				c_debug();
 				break;
 			}
+			/* FALLTHROUGH */
 		default:
 			if (c == escapec) {
 				if (checkproc(selwin) >= 0) {
diff --git a/usr.bin/window/parser1.c b/usr.bin/window/parser1.c
index f5733b950f..60eaba4162 100644
--- a/usr.bin/window/parser1.c
+++ b/usr.bin/window/parser1.c
@@ -100,6 +100,7 @@ p_if(char flag)
 	case V_STR:
 		p_error("if: Numeric value required.");
 		str_free(t.v_str);
+		/* FALLTHROUGH */
 	case V_ERR:
 		flag = 0;
 		break;
diff --git a/usr.bin/window/parser3.c b/usr.bin/window/parser3.c
index 313e6a2dc4..1cd30082f2 100644
--- a/usr.bin/window/parser3.c
+++ b/usr.bin/window/parser3.c
@@ -67,6 +67,7 @@ p_expr(struct value *v, char flag)
 	switch (t.v_type) {
 	case V_NUM:
 		p_error("%d: Not a variable.", t.v_num);
+		/* FALLTHROUGH */
 	case V_ERR:
 		t.v_str = 0;
 		break;
@@ -98,6 +99,7 @@ p_expr0(struct value *v, char flag)
 		p_error("?: Numeric left operand required.");
 		str_free(v->v_str);
 		v->v_type = V_ERR;
+		/* FALLTHROUGH */
 	case V_ERR:
 		flag = 0;
 		break;
@@ -136,6 +138,7 @@ p_expr1(struct value *v, char flag)
 			p_error("||: Numeric operands required.");
 			str_free(v->v_str);
 			v->v_type = V_ERR;
+			/* FALLTHROUGH */
 		case V_ERR:
 			flag = 0;
 			break;
@@ -169,6 +172,7 @@ p_expr2(struct value *v, char flag)
 			p_error("&&: Numeric operands required.");
 			str_free(v->v_str);
 			v->v_type = V_ERR;
+			/* FALLTHROUGH */
 		case V_ERR:
 			flag = 0;
 			break;
diff --git a/usr.bin/window/scanner.c b/usr.bin/window/scanner.c
index 38ca877630..2bea9f6156 100644
--- a/usr.bin/window/scanner.c
+++ b/usr.bin/window/scanner.c
@@ -288,6 +288,7 @@ s_gettok(void)
 			break;
 		default:
 			(void) s_ungetc(c);
+			/* FALLTHROUGH */
 		case EOF:
 			*p = 0;
 			cx.x_token = T_STR;
@@ -335,6 +336,7 @@ s_gettok(void)
 		switch (c) {
 		case '\n':
 			(void) s_ungetc(c);
+			/* FALLTHROUGH */
 		case EOF:
 		case '"':
 			state = 2;
@@ -359,6 +361,7 @@ s_gettok(void)
 		switch (c) {
 		case '\n':
 			(void) s_ungetc(c);
+			/* FALLTHROUGH */
 		case EOF:
 		case '\'':
 			state = 2;
diff --git a/usr.bin/window/ttzapple.c b/usr.bin/window/ttzapple.c
index 9f20fe69d6..831ca0ab56 100644
--- a/usr.bin/window/ttzapple.c
+++ b/usr.bin/window/ttzapple.c
@@ -158,11 +158,13 @@ zz_move(int row, int col)
 		switch (x) {
 		case 2:
 			ttctrl('f');
+			/* FALLTHROUGH */
 		case 1:
 			ttctrl('f');
 			goto out;
 		case -2:
 			ttctrl('h');
+			/* FALLTHROUGH */
 		case -1:
 			ttctrl('h');
 			goto out;
@@ -181,11 +183,13 @@ zz_move(int row, int col)
 		switch (row - tt.tt_row) {
 		case 2:
 			ttctrl('j');
+			/* FALLTHROUGH */
 		case 1:
 			ttctrl('j');
 			goto out;
 		case -2:
 			ttctrl('k');
+			/* FALLTHROUGH */
 		case -1:
 			ttctrl('k');
 			goto out;
-- 
2.15.1

