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: eliminate redundant code



details:   https://anonhg.NetBSD.org/src/rev/c3ee3432b7fa
branches:  trunk
changeset: 378287:c3ee3432b7fa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 29 11:03:18 2023 +0000

description:
lint: eliminate redundant code

No functional change.

diffstat:

 usr.bin/xlint/lint1/decl.c |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (54 lines):

diff -r 14dbac578aad -r c3ee3432b7fa usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Jul 29 10:45:00 2023 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Jul 29 11:03:18 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.366 2023/07/29 07:49:14 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.367 2023/07/29 11:03:18 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.366 2023/07/29 07:49:14 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.367 2023/07/29 11:03:18 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -264,26 +264,27 @@ typedef_error(type_t *td, tspec_t t)
        if (t != LONG)
                goto invalid;
 
+       tspec_t lt;
        if (t2 == INT)
-               td = gettyp(LONG);
+               lt = LONG;
        else if (t2 == UINT)
-               td = gettyp(ULONG);
+               lt = ULONG;
        else if (t2 == LONG)
-               td = gettyp(LLONG);
+               lt = LLONG;
        else if (t2 == ULONG)
-               td = gettyp(ULLONG);
+               lt = ULLONG;
        else if (t2 == FLOAT)
-               td = gettyp(DOUBLE);
+               lt = DOUBLE;
        else if (t2 == DOUBLE)
-               td = gettyp(LDOUBLE);
+               lt = LDOUBLE;
        else if (t2 == DCOMPLEX)
-               td = gettyp(LCOMPLEX);
+               lt = LCOMPLEX;
        else
                goto invalid;
 
        /* modifying typedef with '%s'; only qualifiers allowed */
        warning(5, "long");
-       td = block_dup_type(td);
+       td = block_dup_type(gettyp(lt));
        td->t_typedef = true;
        return td;
 



Home | Main Index | Thread Index | Old Index