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: untangle conditions in initstack_n...



details:   https://anonhg.NetBSD.org/src/rev/e4fae796dbc2
branches:  trunk
changeset: 958258:e4fae796dbc2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 29 20:56:28 2020 +0000

description:
lint: untangle conditions in initstack_next_nobrace

diffstat:

 usr.bin/xlint/lint1/init.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r f820d046bb90 -r e4fae796dbc2 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Tue Dec 29 20:07:04 2020 +0000
+++ b/usr.bin/xlint/lint1/init.c        Tue Dec 29 20:56:28 2020 +0000
@@ -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 @@
        /* 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();
        }
 }
 



Home | Main Index | Thread Index | Old Index