Module Name:    src
Committed By:   rillig
Date:           Tue Apr  6 21:35:25 UTC 2021

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

Log Message:
lint: reduce indentation of typeok_shift

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.269 -r1.270 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.269 src/usr.bin/xlint/lint1/tree.c:1.270
--- src/usr.bin/xlint/lint1/tree.c:1.269	Tue Apr  6 21:32:57 2021
+++ src/usr.bin/xlint/lint1/tree.c	Tue Apr  6 21:35:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.269 2021/04/06 21:32:57 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.270 2021/04/06 21:35:25 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.269 2021/04/06 21:32:57 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.270 2021/04/06 21:35:25 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -900,21 +900,21 @@ typeok_shl(const mod_t *mp, tspec_t lt, 
 static void
 typeok_shift(tspec_t lt, const tnode_t *rn, tspec_t rt)
 {
-	if (rn->tn_op == CON) {
-		if (!is_uinteger(rt) && rn->tn_val->v_quad < 0) {
-			/* negative shift */
-			warning(121);
-		} else if ((uint64_t)rn->tn_val->v_quad ==
-			   (uint64_t)size_in_bits(lt)) {
-			/* shift equal to size of object */
-			warning(267);
-		} else if ((uint64_t)rn->tn_val->v_quad >
-			   (uint64_t)size_in_bits(lt)) {
-			/* shift amount %llu is greater than bit-size %llu of '%s' */
-			warning(122, (unsigned long long)rn->tn_val->v_quad,
-			    (unsigned long long)size_in_bits(lt),
-			    tspec_name(lt));
-		}
+	if (rn->tn_op != CON)
+		return;
+
+	if (!is_uinteger(rt) && rn->tn_val->v_quad < 0) {
+		/* negative shift */
+		warning(121);
+	} else if ((uint64_t)rn->tn_val->v_quad ==
+		   (uint64_t)size_in_bits(lt)) {
+		/* shift equal to size of object */
+		warning(267);
+	} else if ((uint64_t)rn->tn_val->v_quad > (uint64_t)size_in_bits(lt)) {
+		/* shift amount %llu is greater than bit-size %llu of '%s' */
+		warning(122, (unsigned long long)rn->tn_val->v_quad,
+		    (unsigned long long)size_in_bits(lt),
+		    tspec_name(lt));
 	}
 }
 

Reply via email to