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 c_cont to c_continue



details:   https://anonhg.NetBSD.org/src/rev/46377987a883
branches:  trunk
changeset: 981798:46377987a883
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 21 12:08:34 2021 +0000

description:
lint: rename c_cont to c_continue

No functional change.

diffstat:

 usr.bin/xlint/lint1/func.c  |  13 +++++++------
 usr.bin/xlint/lint1/lint1.h |   4 ++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r afc045432094 -r 46377987a883 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sun Mar 21 12:06:10 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sun Mar 21 12:08:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.84 2021/03/21 12:03:56 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.85 2021/03/21 12:08:34 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.84 2021/03/21 12:03:56 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.85 2021/03/21 12:08:34 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -815,7 +815,7 @@
         * If there was a continue statement, the expression controlling the
         * loop is reached.
         */
-       if (cstmt->c_cont)
+       if (cstmt->c_continue)
                reached = true;
 
        if (tn != NULL)
@@ -823,7 +823,7 @@
 
        if (tn != NULL && tn->tn_op == CON) {
                cstmt->c_maybe_endless = constant_is_nonzero(tn);
-               if (!cstmt->c_maybe_endless && cstmt->c_cont)
+               if (!cstmt->c_maybe_endless && cstmt->c_continue)
                        /* continue in 'do ... while (0)' loop */
                        error(323);
        }
@@ -895,7 +895,7 @@
        pos_t   cpos, cspos;
        tnode_t *tn3;
 
-       if (cstmt->c_cont)
+       if (cstmt->c_continue)
                reached = true;
 
        cpos = curr_pos;
@@ -986,7 +986,8 @@
                /* continue outside loop */
                error(209);
        } else {
-               ci->c_cont = true;
+               /* TODO: only if reachable, for symmetry with c_break */
+               ci->c_continue = true;
        }
 
        check_statement_reachable();
diff -r afc045432094 -r 46377987a883 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Sun Mar 21 12:06:10 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Sun Mar 21 12:08:34 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.83 2021/03/21 12:06:10 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.84 2021/03/21 12:08:34 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -387,7 +387,7 @@
        bool    c_switch : 1;           /* case && break are valid */
        bool    c_break : 1;            /* the loop/switch has a reachable
                                         * break statement */
-       bool    c_cont : 1;             /* loop has continue */
+       bool    c_continue : 1;         /* loop has continue */
        bool    c_default : 1;          /* switch has default */
        bool    c_maybe_endless : 1;    /* the controlling expression is
                                         * always true (as in 'for (;;)' or



Home | Main Index | Thread Index | Old Index