Module Name:    src
Committed By:   rillig
Date:           Mon Sep 28 23:31:18 UTC 2020

Modified Files:
        src/usr.bin/make: job.c targ.c

Log Message:
make(1): replace Lst_Open with direct iteration


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/usr.bin/make/job.c
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/make/targ.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/job.c
diff -u src/usr.bin/make/job.c:1.252 src/usr.bin/make/job.c:1.253
--- src/usr.bin/make/job.c:1.252	Mon Sep 28 23:13:57 2020
+++ src/usr.bin/make/job.c	Mon Sep 28 23:31:18 2020
@@ -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 @@ JobFinish(Job *job, int status)
 {
     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) &&

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.107 src/usr.bin/make/targ.c:1.108
--- src/usr.bin/make/targ.c:1.107	Mon Sep 28 22:23:35 2020
+++ src/usr.bin/make/targ.c	Mon Sep 28 23:31:18 2020
@@ -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 @@ GNode *Targ_GetEndNode(void)
 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;
 }
 

Reply via email to