Module Name: src
Committed By: rillig
Date: Sun Mar 21 12:08:34 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: func.c lint1.h
Log Message:
lint: rename c_cont to c_continue
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/xlint/lint1/lint1.h
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/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.84 src/usr.bin/xlint/lint1/func.c:1.85
--- src/usr.bin/xlint/lint1/func.c:1.84 Sun Mar 21 12:03:56 2021
+++ src/usr.bin/xlint/lint1/func.c Sun Mar 21 12:08:34 2021
@@ -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 @@ do2(tnode_t *tn)
* 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 @@ do2(tnode_t *tn)
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 @@ for2(void)
pos_t cpos, cspos;
tnode_t *tn3;
- if (cstmt->c_cont)
+ if (cstmt->c_continue)
reached = true;
cpos = curr_pos;
@@ -986,7 +986,8 @@ docont(void)
/* 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();
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.83 src/usr.bin/xlint/lint1/lint1.h:1.84
--- src/usr.bin/xlint/lint1/lint1.h:1.83 Sun Mar 21 12:06:10 2021
+++ src/usr.bin/xlint/lint1/lint1.h Sun Mar 21 12:08:34 2021
@@ -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 @@ typedef struct control_statement {
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