Module Name:    src
Committed By:   rillig
Date:           Thu Mar 18 23:37:31 UTC 2021

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

Log Message:
lint: clean up control flow in initstack_push

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 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.97 src/usr.bin/xlint/lint1/init.c:1.98
--- src/usr.bin/xlint/lint1/init.c:1.97	Thu Mar 18 23:23:40 2021
+++ src/usr.bin/xlint/lint1/init.c	Thu Mar 18 23:37:31 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.97 2021/03/18 23:23:40 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.98 2021/03/18 23:37:31 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.97 2021/03/18 23:23:40 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.98 2021/03/18 23:37:31 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -574,7 +574,9 @@ again:
 			debug_step("ARRAY %s brace=%d",
 			    namedmem->n_name, istk->i_brace);
 			goto pop;
-		} else if (istk->i_enclosing->i_seen_named_member) {
+		}
+
+		if (istk->i_enclosing->i_seen_named_member) {
 			istk->i_brace = true;
 			debug_step("ARRAY brace=%d, namedmem=%d",
 			    istk->i_brace,
@@ -586,9 +588,7 @@ again:
 			/* initialization of an incomplete type */
 			error(175);
 			initerr = true;
-			debug_initstack();
-			debug_leave();
-			return;
+			break;
 		}
 		istk->i_subt = istk->i_type->t_subt;
 		istk->i_array_of_unknown_size = is_incomplete(istk->i_type);
@@ -607,9 +607,7 @@ again:
 			/* initialization of an incomplete type */
 			error(175);
 			initerr = true;
-			debug_initstack();
-			debug_leave();
-			return;
+			break;
 		}
 		cnt = 0;
 		debug_named_member();
@@ -655,9 +653,7 @@ again:
 			/* cannot init. struct/union with no named member */
 			error(179);
 			initerr = true;
-			debug_initstack();
-			debug_leave();
-			return;
+			break;
 		}
 		istk->i_remaining = istk->i_type->t_tspec == STRUCT ? cnt : 1;
 		break;

Reply via email to