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): replace Lst_Open with direct iteration



details:   https://anonhg.NetBSD.org/src/rev/2592f88d9544
branches:  trunk
changeset: 944441:2592f88d9544
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 28 23:31:18 2020 +0000

description:
make(1): replace Lst_Open with direct iteration

diffstat:

 usr.bin/make/job.c  |   6 +++---
 usr.bin/make/targ.c |  15 +++++----------
 2 files changed, 8 insertions(+), 13 deletions(-)

diffs (67 lines):

diff -r bfbecca32f46 -r 2592f88d9544 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Mon Sep 28 23:13:57 2020 +0000
+++ b/usr.bin/make/job.c        Mon Sep 28 23:31:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.252 2020/09/28 23:13:57 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.253 2020/09/28 23:31:18 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.252 2020/09/28 23:13:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.253 2020/09/28 23:31:18 rillig Exp $");
 
 # define STATIC static
 
@@ -871,7 +871,7 @@
 {
     Boolean done, return_job_token;
 
-    DEBUG3(JOB, "Jobfinish: %d [%s], status %d\n",
+    DEBUG3(JOB, "JobFinish: %d [%s], status %d\n",
           job->pid, job->node->name, status);
 
     if ((WIFEXITED(status) &&
diff -r bfbecca32f46 -r 2592f88d9544 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Mon Sep 28 23:13:57 2020 +0000
+++ b/usr.bin/make/targ.c       Mon Sep 28 23:31:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -122,7 +122,7 @@
 #include         "dir.h"
 
 /*     "@(#)targ.c     8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.107 2020/09/28 22:23:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.108 2020/09/28 23:31:18 rillig Exp $");
 
 static GNodeList *allTargets;  /* the list of all targets found so far */
 #ifdef CLEANUP
@@ -292,18 +292,13 @@
 GNodeList *
 Targ_FindList(StringList *names)
 {
-    GNodeList *nodes;
     StringListNode *ln;
-
-    nodes = Lst_Init();
-
-    Lst_Open(names);
-    while ((ln = Lst_Next(names)) != NULL) {
-       char *name = LstNode_Datum(ln);
+    GNodeList *nodes = Lst_Init();
+    for (ln = names->first; ln != NULL; ln = ln->next) {
+       const char *name = ln->datum;
        GNode *gn = Targ_GetNode(name);
        Lst_Append(nodes, gn);
     }
-    Lst_Close(names);
     return nodes;
 }
 



Home | Main Index | Thread Index | Old Index