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 double inversion from is_ou...



details:   https://anonhg.NetBSD.org/src/rev/4ab0883aae7f
branches:  trunk
changeset: 1023176:4ab0883aae7f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 28 16:51:57 2021 +0000

description:
lint: remove double inversion from is_out_of_char_range

No functional change.

diffstat:

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

diffs (29 lines):

diff -r 2243391cb504 -r 4ab0883aae7f usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Aug 28 16:43:50 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Aug 28 16:51:57 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.359 2021/08/28 16:43:50 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.360 2021/08/28 16:51:57 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.359 2021/08/28 16:43:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.360 2021/08/28 16:51:57 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -4102,8 +4102,8 @@
 is_out_of_char_range(const tnode_t *tn)
 {
        return tn->tn_op == CON &&
-           (tn->tn_val->v_quad < 0 ||
-            tn->tn_val->v_quad > (int)~(~0U << (CHAR_SIZE - 1)));
+              !(0 <= tn->tn_val->v_quad &&
+                tn->tn_val->v_quad < 1 << (CHAR_SIZE - 1));
 }
 
 /*



Home | Main Index | Thread Index | Old Index