Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): remove unused assignments to local var...



details:   https://anonhg.NetBSD.org/src/rev/14f81aa236d3
branches:  trunk
changeset: 976676:14f81aa236d3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 29 18:44:30 2020 +0000

description:
make(1): remove unused assignments to local variables

These only became obvious once ApplyModifier had been extracted, which
shrank the source code of ApplyModifiers by about 100 lines.

Even GCC 5 had seen that they are redundant and had not generated any
code for them.

diffstat:

 usr.bin/make/var.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 17f5019d4cc9 -r 14f81aa236d3 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Sep 29 18:33:22 2020 +0000
+++ b/usr.bin/make/var.c        Tue Sep 29 18:44:30 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include    "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.551 2020/09/29 18:31:39 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.552 2020/09/29 18:44:30 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3190,7 +3190,6 @@
        }
     apply_mods:
        st.newVal = var_Error;  /* default value, in case of errors */
-       res = AMR_BAD;          /* just a safe fallback */
        mod = p;
 
        if (DEBUG(VAR))
@@ -3237,7 +3236,6 @@
        } else if (*p == ':') {
            p++;
        }
-       mod = p;
     }
 out:
     *pp = p;



Home | Main Index | Thread Index | Old Index