Module Name: src
Committed By: rillig
Date: Sun Jan 10 00:12:50 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: remove redundant braces in is_confusing_precedence
This nicely aligns the different branches, in which "l" and "r" are
swapped.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 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.
Modified files:
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.144 src/usr.bin/xlint/lint1/tree.c:1.145
--- src/usr.bin/xlint/lint1/tree.c:1.144 Sun Jan 10 00:05:46 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 10 00:12:50 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.144 2021/01/10 00:05:46 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.145 2021/01/10 00:12:50 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.144 2021/01/10 00:05:46 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.145 2021/01/10 00:12:50 rillig Exp $");
#endif
#include <float.h>
@@ -4082,37 +4082,33 @@ is_confusing_precedence(op_t op, op_t lo
{
if (op == SHL || op == SHR) {
- if (!lparen && (lop == PLUS || lop == MINUS)) {
+ if (!lparen && (lop == PLUS || lop == MINUS))
return true;
- } else if (!rparen && (rop == PLUS || rop == MINUS)) {
+ if (!rparen && (rop == PLUS || rop == MINUS))
return true;
- }
return false;
}
if (op == LOGOR) {
- if (!lparen && lop == LOGAND) {
+ if (!lparen && lop == LOGAND)
return true;
- } else if (!rparen && rop == LOGAND) {
+ if (!rparen && rop == LOGAND)
return true;
- }
return false;
}
lint_assert(op == AND || op == XOR || op == OR);
if (!lparen && lop != op) {
- if (lop == PLUS || lop == MINUS) {
+ if (lop == PLUS || lop == MINUS)
return true;
- } else if (lop == AND || lop == XOR) {
+ if (lop == AND || lop == XOR)
return true;
- }
}
if (!rparen && rop != op) {
- if (rop == PLUS || rop == MINUS) {
+ if (rop == PLUS || rop == MINUS)
return true;
- } else if (rop == AND || rop == XOR) {
+ if (rop == AND || rop == XOR)
return true;
- }
}
return false;
}