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 to_int_constant



details:   https://anonhg.NetBSD.org/src/rev/0347e3f4d8f2
branches:  trunk
changeset: 369644:0347e3f4d8f2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 26 19:44:19 2022 +0000

description:
lint: clean up to_int_constant

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 6a3f5845da14 -r 0347e3f4d8f2 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Fri Aug 26 19:30:44 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Fri Aug 26 19:44:19 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.294 2022/07/03 14:35:54 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.295 2022/08/26 19:44:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.294 2022/07/03 14:35:54 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.295 2022/08/26 19:44:19 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -3374,13 +3374,11 @@
        tspec_t t;
        val_t   *v;
 
+       if (tn == NULL)
+               return 1;
+
        v = constant(tn, required);
 
-       if (tn == NULL) {
-               i = 1;
-               goto done;
-       }
-
        /*
         * Abstract declarations are used inside expression. To free
         * the memory would be a fatal error.
@@ -3410,7 +3408,6 @@
                }
        }
 
-done:
        free(v);
        return i;
 }



Home | Main Index | Thread Index | Old Index