Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: rename ftflg to seen_fallthrough



details:   https://anonhg.NetBSD.org/src/rev/fc9b0b3c014a
branches:  trunk
changeset: 953775:fc9b0b3c014a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Mar 20 16:16:32 2021 +0000

description:
lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y    |  22 +++++++++++-----------
 usr.bin/xlint/lint1/externs1.h |   4 ++--
 usr.bin/xlint/lint1/func.c     |  20 ++++++++++----------
 3 files changed, 23 insertions(+), 23 deletions(-)

diffs (178 lines):

diff -r 87063ac1ef5b -r fc9b0b3c014a usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Mar 20 16:11:12 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Mar 20 16:16:32 2021 +0000
@@ -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 @@
        | selection_statement
        | iteration_statement
        | jump_statement {
-               ftflg = false;
+               seen_fallthrough = false;
          }
        | asm_statement
 
@@ -1504,16 +1504,16 @@
          }
        | 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 @@
                freeblk();
                mem_block_level--;
                block_level--;
-               ftflg = false;
+               seen_fallthrough = false;
          }
        ;
 
@@ -1563,10 +1563,10 @@
 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 @@
                        $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 @@
          }
        | do_statement do_while_expr {
                do2($2);
-               ftflg = false;
+               seen_fallthrough = false;
          }
        | do error {
                clear_warning_flags();
diff -r 87063ac1ef5b -r fc9b0b3c014a usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sat Mar 20 16:11:12 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sat Mar 20 16:16:32 2021 +0000
@@ -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 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;
diff -r 87063ac1ef5b -r fc9b0b3c014a usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sat Mar 20 16:11:12 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sat Mar 20 16:16:32 2021 +0000
@@ -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 @@
  * 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 @@
 
        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 @@
                /* 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 @@
        cstmt->c_swtype = tp;
 
        reached = rchflg = false;
-       ftflg = true;
+       seen_fallthrough = true;
 }
 
 /*
@@ -1236,7 +1236,7 @@
 fallthru(int n)
 {
 
-       ftflg = true;
+       seen_fallthrough = true;
 }
 
 /*



Home | Main Index | Thread Index | Old Index