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 redundant assignments



details:   https://anonhg.NetBSD.org/src/rev/d2f64469c59d
branches:  trunk
changeset: 946652:d2f64469c59d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 05 18:15:40 2020 +0000

description:
make(1): remove redundant assignments

diffstat:

 usr.bin/make/arch.c  |  5 ++---
 usr.bin/make/cond.c  |  6 +++---
 usr.bin/make/job.c   |  6 +++---
 usr.bin/make/parse.c |  8 ++++----
 usr.bin/make/var.c   |  5 ++---
 5 files changed, 14 insertions(+), 16 deletions(-)

diffs (142 lines):

diff -r 3b332e1cac30 -r d2f64469c59d usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sat Dec 05 18:13:44 2020 +0000
+++ b/usr.bin/make/arch.c       Sat Dec 05 18:15:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.185 2020/12/05 17:17:37 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.186 2020/12/05 18:15:40 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.185 2020/12/05 17:17:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.186 2020/12/05 18:15:40 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -444,7 +444,6 @@
                        size_t len = strlen(member);
 
                        if (len > AR_MAX_NAME_LEN) {
-                               len = AR_MAX_NAME_LEN;
                                snprintf(copy, sizeof copy, "%s", member);
                                hdr = HashTable_FindValue(&ar->members, copy);
                        }
diff -r 3b332e1cac30 -r d2f64469c59d usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sat Dec 05 18:13:44 2020 +0000
+++ b/usr.bin/make/cond.c       Sat Dec 05 18:15:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.220 2020/11/29 01:40:26 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.221 2020/12/05 18:15:40 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.220 2020/11/29 01:40:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.221 2020/12/05 18:15:40 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -800,7 +800,7 @@
        Token t;
        char *arg = NULL;
        size_t arglen;
-       const char *cp = par->p;
+       const char *cp;
        const char *cp1;
 
        if (CondParser_Func(par, doEval, &t))
diff -r 3b332e1cac30 -r d2f64469c59d usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sat Dec 05 18:13:44 2020 +0000
+++ b/usr.bin/make/job.c        Sat Dec 05 18:15:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.336 2020/12/05 17:44:22 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.337 2020/12/05 18:15:40 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.336 2020/12/05 17:44:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.337 2020/12/05 18:15:40 rillig Exp $");
 
 /* A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
@@ -1689,7 +1689,7 @@
 static void
 JobDoOutput(Job *job, Boolean finish)
 {
-    Boolean gotNL = FALSE;     /* true if got a newline */
+    Boolean gotNL;             /* true if got a newline */
     Boolean fbuf;              /* true if our buffer filled up */
     size_t nr;                 /* number of bytes read */
     size_t i;                  /* auxiliary index into outBuf */
diff -r 3b332e1cac30 -r d2f64469c59d usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Dec 05 18:13:44 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Dec 05 18:15:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.464 2020/12/04 20:23:33 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.465 2020/12/05 18:15:40 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.464 2020/12/04 20:23:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.465 2020/12/05 18:15:40 rillig Exp $");
 
 /* types and constants */
 
@@ -1422,7 +1422,7 @@
                         SearchPathList **inout_paths,
                         StringList *curTargs)
 {
-    char *cp = *inout_cp;
+    char *cp;
     char *tgt = *inout_line;
     char savec;
     const char *p;
@@ -1876,7 +1876,7 @@
 VarAssign_EvalSubst(const char *name, const char *uvalue, GNode *ctxt,
                    const char **out_avalue, void **out_avalue_freeIt)
 {
-    const char *avalue = uvalue;
+    const char *avalue;
     char *evalue;
     Boolean savedPreserveUndefined = preserveUndefined;
 
diff -r 3b332e1cac30 -r d2f64469c59d usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Dec 05 18:13:44 2020 +0000
+++ b/usr.bin/make/var.c        Sat Dec 05 18:15:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.705 2020/12/05 15:31:18 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.706 2020/12/05 18:15:40 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.705 2020/12/05 15:31:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.706 2020/12/05 18:15:40 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -2492,7 +2492,6 @@
                        *dst = *src;
                }
                *dst = '\0';
-               endpat = dst;
        } else {
                pattern = bmake_strsedup(mod + 1, endpat);
        }



Home | Main Index | Thread Index | Old Index