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 unnecessary variable assignment



details:   https://anonhg.NetBSD.org/src/rev/a1c77ab1b4ca
branches:  trunk
changeset: 936493:a1c77ab1b4ca
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 27 22:21:29 2020 +0000

description:
make(1): remove unnecessary variable assignment

It is not the job of an ApplyModifier function to directly manipulate the
final result of the ApplyModifiers function.  In fact, the resulting
pointer was overwritten unconditionally, in such an obvious way that the
compiler could have detected this.  GCC 5 didn't though, which reduces
the code size a bit.

diffstat:

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

diffs (34 lines):

diff -r ba4d6e5f8427 -r a1c77ab1b4ca usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Jul 27 22:02:26 2020 +0000
+++ b/usr.bin/make/var.c        Mon Jul 27 22:21:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.341 2020/07/27 22:02:26 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.342 2020/07/27 22:21:29 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.341 2020/07/27 22:02:26 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.342 2020/07/27 22:21:29 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.341 2020/07/27 22:02:26 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.342 2020/07/27 22:21:29 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2510,7 +2510,6 @@
     int error = regcomp(&args.re, re, REG_EXTENDED);
     free(re);
     if (error) {
-       *st->lengthPtr = st->cp - st->start + 1;
        VarREError(error, &args.re, "RE substitution error");
        free(args.replace);
        return FALSE;



Home | Main Index | Thread Index | Old Index