Module Name:    src
Committed By:   rillig
Date:           Sat Mar 20 16:16:32 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y externs1.h func.c

Log Message:
lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/xlint/lint1/func.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.187 src/usr.bin/xlint/lint1/cgram.y:1.188
--- src/usr.bin/xlint/lint1/cgram.y:1.187	Sat Mar 20 16:11:12 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Sat Mar 20 16:16:32 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.187 2021/03/20 16:11:12 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.188 2021/03/20 16:16:32 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.187 2021/03/20 16:11:12 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.188 2021/03/20 16:16:32 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1484,7 +1484,7 @@ non_expr_statement:
 	| selection_statement
 	| iteration_statement
 	| jump_statement {
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	| asm_statement
 
@@ -1504,16 +1504,16 @@ label:
 	  }
 	| T_CASE constant_expr T_COLON {
 		case_label($2);
-		ftflg = true;
+		seen_fallthrough = true;
 	  }
 	| T_CASE constant_expr T_ELLIPSIS constant_expr T_COLON {
 		/* XXX: We don't fill all cases */
 		case_label($2);
-		ftflg = true;
+		seen_fallthrough = true;
 	  }
 	| T_DEFAULT T_COLON {
 		default_label();
-		ftflg = true;
+		seen_fallthrough = true;
 	  }
 	;
 
@@ -1536,7 +1536,7 @@ compound_statement_rbrace:
 		freeblk();
 		mem_block_level--;
 		block_level--;
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	;
 
@@ -1563,10 +1563,10 @@ block_item:
 expr_statement:
 	  expr T_SEMI {
 		expr($1, false, false, false, false);
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	| T_SEMI {
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	;
 
@@ -1582,7 +1582,7 @@ expr_statement_val:
 			$1->tn_sym->s_used = true;
 		$$ = $1;
 		expr($1, false, false, false, false);
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	| non_expr_statement {
 		$$ = getnode();
@@ -1676,7 +1676,7 @@ iteration_statement:		/* C99 6.8.5 */
 	  }
 	| do_statement do_while_expr {
 		do2($2);
-		ftflg = false;
+		seen_fallthrough = false;
 	  }
 	| do error {
 		clear_warning_flags();

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.79 src/usr.bin/xlint/lint1/externs1.h:1.80
--- src/usr.bin/xlint/lint1/externs1.h:1.79	Fri Mar 19 08:23:39 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Mar 20 16:16:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.79 2021/03/19 08:23:39 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.80 2021/03/20 16:16:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -236,7 +236,7 @@ extern	void	debug_node(const tnode_t *, 
 extern	sym_t	*funcsym;
 extern	bool	reached;
 extern	bool	rchflg;
-extern	bool	ftflg;
+extern	bool	seen_fallthrough;
 extern	int	nargusg;
 extern	pos_t	argsused_pos;
 extern	int	nvararg;

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.77 src/usr.bin/xlint/lint1/func.c:1.78
--- src/usr.bin/xlint/lint1/func.c:1.77	Wed Mar 17 01:15:31 2021
+++ src/usr.bin/xlint/lint1/func.c	Sat Mar 20 16:16:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.77 2021/03/17 01:15:31 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.78 2021/03/20 16:16:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.77 2021/03/17 01:15:31 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.78 2021/03/20 16:16:32 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -67,13 +67,13 @@ bool	rchflg;
  * Reset by each statement and set by FALLTHROUGH, switch (switch1())
  * and case (label()).
  *
- * Control statements if, for, while and switch do not reset ftflg because
- * this must be done by the controlled statement. At least for if this is
- * important because ** FALLTHROUGH ** after "if (expr) statement" is
+ * Control statements if, for, while and switch do not reset seen_fallthrough
+ * because this must be done by the controlled statement. At least for if this
+ * is important because ** FALLTHROUGH ** after "if (expr) statement" is
  * evaluated before the following token, which causes reduction of above.
  * This means that ** FALLTHROUGH ** after "if ..." would always be ignored.
  */
-bool	ftflg;
+bool	seen_fallthrough;
 
 /* The innermost control statement */
 cstk_t	*cstmt;
@@ -474,7 +474,7 @@ check_case_label(tnode_t *tn, cstk_t *ci
 
 	lint_assert(ci->c_swtype != NULL);
 
-	if (reached && !ftflg) {
+	if (reached && !seen_fallthrough) {
 		if (hflag)
 			/* fallthrough on case statement */
 			warning(220);
@@ -554,7 +554,7 @@ default_label(void)
 		/* duplicate default in switch */
 		error(202);
 	} else {
-		if (reached && !ftflg) {
+		if (reached && !seen_fallthrough) {
 			if (hflag)
 				/* fallthrough on default statement */
 				warning(284);
@@ -683,7 +683,7 @@ switch1(tnode_t *tn)
 	cstmt->c_swtype = tp;
 
 	reached = rchflg = false;
-	ftflg = true;
+	seen_fallthrough = true;
 }
 
 /*
@@ -1236,7 +1236,7 @@ void
 fallthru(int n)
 {
 
-	ftflg = true;
+	seen_fallthrough = true;
 }
 
 /*

Reply via email to