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: make typeok_scalar_strict_bool sim...



details:   https://anonhg.NetBSD.org/src/rev/39c5e20475be
branches:  trunk
changeset: 1022592:39c5e20475be
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 26 16:22:24 2021 +0000

description:
lint: make typeok_scalar_strict_bool simpler

No functional change.

diffstat:

 usr.bin/xlint/lint1/ckbool.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 1566c7a8ff6f -r 39c5e20475be usr.bin/xlint/lint1/ckbool.c
--- a/usr.bin/xlint/lint1/ckbool.c      Mon Jul 26 12:49:13 2021 +0000
+++ b/usr.bin/xlint/lint1/ckbool.c      Mon Jul 26 16:22:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ckbool.c,v 1.7 2021/07/04 09:13:59 rillig Exp $ */
+/* $NetBSD: ckbool.c,v 1.8 2021/07/26 16:22:24 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include <sys/cdefs.h>
 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: ckbool.c,v 1.7 2021/07/04 09:13:59 rillig Exp $");
+__RCSID("$NetBSD: ckbool.c,v 1.8 2021/07/26 16:22:24 rillig Exp $");
 #endif
 
 #include <string.h>
@@ -181,7 +181,7 @@
 
        if (!mp->m_takes_bool) {
                bool binary = mp->m_binary;
-               bool lbool = ln->tn_type->t_tspec == BOOL;
+               bool lbool = lt == BOOL;
                bool ok = true;
 
                if (!binary && lbool) {
@@ -194,7 +194,7 @@
                        error(336, op_name(op));
                        ok = false;
                }
-               if (binary && rn->tn_type->t_tspec == BOOL) {
+               if (binary && rt == BOOL) {
                        /* right operand of '%s' must not be bool */
                        error(337, op_name(op));
                        ok = false;



Home | Main Index | Thread Index | Old Index