Module Name: src Committed By: rillig Date: Mon Jul 26 16:22:24 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: ckbool.c Log Message: lint: make typeok_scalar_strict_bool simpler No functional change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint1/ckbool.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/ckbool.c diff -u src/usr.bin/xlint/lint1/ckbool.c:1.7 src/usr.bin/xlint/lint1/ckbool.c:1.8 --- src/usr.bin/xlint/lint1/ckbool.c:1.7 Sun Jul 4 09:13:59 2021 +++ src/usr.bin/xlint/lint1/ckbool.c Mon Jul 26 16:22:24 2021 @@ -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 @@ typeok_scalar_strict_bool(op_t op, const 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 @@ typeok_scalar_strict_bool(op_t op, const 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;