Module Name:    src
Committed By:   rillig
Date:           Tue Dec 29 20:56:28 UTC 2020

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

Log Message:
lint: untangle conditions in initstack_next_nobrace


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.41 src/usr.bin/xlint/lint1/init.c:1.42
--- src/usr.bin/xlint/lint1/init.c:1.41	Tue Dec 29 20:07:04 2020
+++ src/usr.bin/xlint/lint1/init.c	Tue Dec 29 20:56:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.41 2020/12/29 20:07:04 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.42 2020/12/29 20:56:28 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -459,10 +459,11 @@ initstack_next_nobrace(void)
 	/* Make sure an entry with a scalar type is at the top of the stack. */
 	if (!initerr)
 		initstack_check_too_many();
-	while (!initerr && (initstk->i_type == NULL ||
-			    !tspec_is_scalar(initstk->i_type->t_tspec))) {
-		if (!initerr)
-			initstack_push();
+	while (!initerr) {
+		if ((initstk->i_type != NULL &&
+		     tspec_is_scalar(initstk->i_type->t_tspec)))
+			break;
+		initstack_push();
 	}
 }
 

Reply via email to