Module Name:    src
Committed By:   rillig
Date:           Fri Apr 15 16:38:30 UTC 2022

Modified Files:
        src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: reduce indentation in check_integer_conversion

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 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.424 src/usr.bin/xlint/lint1/tree.c:1.425
--- src/usr.bin/xlint/lint1/tree.c:1.424	Sat Apr  9 23:41:22 2022
+++ src/usr.bin/xlint/lint1/tree.c	Fri Apr 15 16:38:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.424 2022/04/09 23:41:22 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.425 2022/04/15 16:38:30 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.424 2022/04/09 23:41:22 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.425 2022/04/15 16:38:30 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2226,20 +2226,18 @@ check_integer_conversion(op_t op, int ar
 		}
 	}
 
-	if (portable_size_in_bits(nt) < portable_size_in_bits(ot) &&
+	if (aflag > 0 &&
+	    portable_size_in_bits(nt) < portable_size_in_bits(ot) &&
 	    (ot == LONG || ot == ULONG || ot == QUAD || ot == UQUAD ||
 	     aflag > 1)) {
-		/* conversion from '%s' may lose accuracy */
-		if (aflag > 0) {
-			if (op == FARG) {
-				/* conversion from '%s' to '%s' may ... */
-				warning(298,
-				    type_name(tn->tn_type), type_name(tp), arg);
-			} else {
-				/* conversion from '%s' to '%s' may ... */
-				warning(132,
-				    type_name(tn->tn_type), type_name(tp));
-			}
+		if (op == FARG) {
+			/* conversion from '%s' to '%s' may lose ... */
+			warning(298,
+			    type_name(tn->tn_type), type_name(tp), arg);
+		} else {
+			/* conversion from '%s' to '%s' may lose accuracy */
+			warning(132,
+			    type_name(tn->tn_type), type_name(tp));
 		}
 	}
 }

Reply via email to