Module Name: src
Committed By: rillig
Date: Fri Jun 4 21:12:10 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: ckgetopt.c
Log Message:
lint: fix function name in check for getopt
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/xlint/lint1/ckgetopt.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/ckgetopt.c
diff -u src/usr.bin/xlint/lint1/ckgetopt.c:1.9 src/usr.bin/xlint/lint1/ckgetopt.c:1.10
--- src/usr.bin/xlint/lint1/ckgetopt.c:1.9 Sun Apr 18 17:36:18 2021
+++ src/usr.bin/xlint/lint1/ckgetopt.c Fri Jun 4 21:12:10 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ckgetopt.c,v 1.9 2021/04/18 17:36:18 rillig Exp $ */
+/* $NetBSD: ckgetopt.c,v 1.10 2021/06/04 21:12:10 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: ckgetopt.c,v 1.9 2021/04/18 17:36:18 rillig Exp $");
+__RCSID("$NetBSD: ckgetopt.c,v 1.10 2021/06/04 21:12:10 rillig Exp $");
#endif
#include <stdbool.h>
@@ -81,8 +81,9 @@ static struct {
return false; \
} while (false)
+/* Return whether tn has the form 'getopt(argc, argv, "literal") != -1'. */
static bool
-is_getopt_call(const tnode_t *tn, char **out_options)
+is_getopt_condition(const tnode_t *tn, char **out_options)
{
NEED(tn != NULL);
NEED(tn->tn_op == NE);
@@ -144,7 +145,7 @@ void
check_getopt_begin_while(const tnode_t *tn)
{
if (ck.while_level == 0) {
- if (!is_getopt_call(tn, &ck.options))
+ if (!is_getopt_condition(tn, &ck.options))
return;
ck.options_pos = curr_pos;
}
@@ -158,7 +159,6 @@ check_getopt_begin_switch(void)
ck.switch_level++;
}
-
void
check_getopt_case_label(int64_t value)
{