Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 106101A9217 for ; Tue, 5 Jan 2021 00:17:24 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 0F7E884D7F; Tue, 5 Jan 2021 00:17:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 2FE3A84D6C for ; Tue, 5 Jan 2021 00:17:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 0ZUhrpUlMbRH for ; Tue, 5 Jan 2021 00:17:21 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id BAC8484CE7 for ; Tue, 5 Jan 2021 00:17:21 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B0836FA9D; Tue, 5 Jan 2021 00:17:21 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Tue, 5 Jan 2021 00:17:21 +0000 From: "Roland Illig" Subject: CVS commit: src/usr.bin/xlint/lint1 To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20210105001721.B0836FA9D@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roland Illig" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: rillig Date: Tue Jan 5 00:17:21 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: tree.c Log Message: lint: extract code for determining possible precedence confusion The function check_precedence_confusion was pretty long, and right in the middle of that function was the complicated part of determining which of the operand combinations are confusing and which aren't. Extract this part into a separate function to document on which information this decision is based. This makes it easier to understand the code since there are fewer local variables around. As a left-over from a previous commit, rop and rparn don't need to be initialized twice, now that the assertion for a binary operator is in place. Remove the large and useless switch statement over all operator types. This list was completely unsorted, for no apparent reason. To see the list of operators, better look them up in ops.def, there was no need to have this list duplicated here. To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.