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: untangle conditions in promote_c90



details:   https://anonhg.NetBSD.org/src/rev/fed5b9c6c381
branches:  trunk
changeset: 373276:fed5b9c6c381
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 29 13:47:16 2023 +0000

description:
lint: untangle conditions in promote_c90

No functional change.

diffstat:

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

diffs (39 lines):

diff -r 950a395c31da -r fed5b9c6c381 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 29 09:24:33 2023 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 29 13:47:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.499 2023/01/28 00:55:48 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.500 2023/01/29 13:47:16 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.499 2023/01/28 00:55:48 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.500 2023/01/29 13:47:16 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2126,12 +2126,14 @@
                return t;
        }
 
-       if (t == CHAR || t == UCHAR || t == SCHAR)
-               return size_in_bits(CHAR) < size_in_bits(INT) || t != UCHAR
-                   ? INT : UINT;
-       if (t == SHORT || t == USHORT)
-               return size_in_bits(SHORT) < size_in_bits(INT) || t == SHORT
-                   ? INT : UINT;
+       if (t == CHAR || t == SCHAR)
+               return INT;
+       if (t == UCHAR)
+               return size_in_bits(CHAR) < size_in_bits(INT) ? INT : UINT;
+       if (t == SHORT)
+               return INT;
+       if (t == USHORT)
+               return size_in_bits(SHORT) < size_in_bits(INT) ? INT : UINT;
        if (t == ENUM)
                return INT;
        if (farg && t == FLOAT)



Home | Main Index | Thread Index | Old Index