Module Name: src
Committed By: rillig
Date: Sun Jan 29 13:47:16 UTC 2023
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: untangle conditions in promote_c90
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.499 -r1.500 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.499 src/usr.bin/xlint/lint1/tree.c:1.500
--- src/usr.bin/xlint/lint1/tree.c:1.499 Sat Jan 28 00:55:48 2023
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 29 13:47:16 2023
@@ -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 @@ promote_c90(const tnode_t *tn, tspec_t t
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)