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: remove redundant braces in is_conf...



details:   https://anonhg.NetBSD.org/src/rev/1145e12edb7c
branches:  trunk
changeset: 979769:1145e12edb7c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 10 00:12:50 2021 +0000

description:
lint: remove redundant braces in is_confusing_precedence

This nicely aligns the different branches, in which "l" and "r" are
swapped.

No functional change.

diffstat:

 usr.bin/xlint/lint1/tree.c |  24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)

diffs (64 lines):

diff -r 8fe82487e015 -r 1145e12edb7c usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 10 00:05:45 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 10 00:12:50 2021 +0000
@@ -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 @@
 {
 
        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;
 }



Home | Main Index | Thread Index | Old Index