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: re-order conditions for lossy conv...



details:   https://anonhg.NetBSD.org/src/rev/859212045baf
branches:  trunk
changeset: 366418:859212045baf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu May 26 10:48:47 2022 +0000

description:
lint: re-order conditions for lossy conversions

Now that can_represent does more work, put it at the end of the
conditions.

No functional change.

diffstat:

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

diffs (30 lines):

diff -r f8d821e998cc -r 859212045baf usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Thu May 26 09:55:31 2022 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Thu May 26 10:48:47 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.444 2022/05/26 09:26:00 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.445 2022/05/26 10:48:47 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.444 2022/05/26 09:26:00 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.445 2022/05/26 10:48:47 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2404,9 +2404,9 @@
 
        if (aflag > 0 &&
            portable_size_in_bits(nt) < portable_size_in_bits(ot) &&
-           !can_represent(tp, tn) &&
            (ot == LONG || ot == ULONG || ot == QUAD || ot == UQUAD ||
-            aflag > 1)) {
+            aflag > 1) &&
+           !can_represent(tp, tn)) {
                if (op == FARG) {
                        /* conversion from '%s' to '%s' may lose ... */
                        warning(298,



Home | Main Index | Thread Index | Old Index