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: clean up control flow in initstack...
details: https://anonhg.NetBSD.org/src/rev/7a103366c8f4
branches: trunk
changeset: 953734:7a103366c8f4
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Mar 18 23:37:31 2021 +0000
description:
lint: clean up control flow in initstack_push
No functional change.
diffstat:
usr.bin/xlint/lint1/init.c | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diffs (62 lines):
diff -r fa380efd4f0f -r 7a103366c8f4 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c Thu Mar 18 23:23:40 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c Thu Mar 18 23:37:31 2021 +0000
@@ -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 @@
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 @@
/* 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 @@
/* initialization of an incomplete type */
error(175);
initerr = true;
- debug_initstack();
- debug_leave();
- return;
+ break;
}
cnt = 0;
debug_named_member();
@@ -655,9 +653,7 @@
/* 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;
Home |
Main Index |
Thread Index |
Old Index