Module Name:    src
Committed By:   rillig
Date:           Tue Sep 29 18:44:30 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.551 -r1.552 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.551 src/usr.bin/make/var.c:1.552
--- src/usr.bin/make/var.c:1.551	Tue Sep 29 18:31:39 2020
+++ src/usr.bin/make/var.c	Tue Sep 29 18:44:30 2020
@@ -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 @@ ApplyModifiers(
 	}
     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 @@ ApplyModifiers(
 	} else if (*p == ':') {
 	    p++;
 	}
-	mod = p;
     }
 out:
     *pp = p;

Reply via email to