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: fix function name in check for getopt



details:   https://anonhg.NetBSD.org/src/rev/630ebc8d8bb9
branches:  trunk
changeset: 1021563:630ebc8d8bb9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 04 21:12:10 2021 +0000

description:
lint: fix function name in check for getopt

No functional change.

diffstat:

 usr.bin/xlint/lint1/ckgetopt.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 765a984374c0 -r 630ebc8d8bb9 usr.bin/xlint/lint1/ckgetopt.c
--- a/usr.bin/xlint/lint1/ckgetopt.c    Fri Jun 04 20:54:18 2021 +0000
+++ b/usr.bin/xlint/lint1/ckgetopt.c    Fri Jun 04 21:12:10 2021 +0000
@@ -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 @@
                        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 @@
 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 @@
                ck.switch_level++;
 }
 
-
 void
 check_getopt_case_label(int64_t value)
 {



Home | Main Index | Thread Index | Old Index