From 8644c277f78bf43018c255ba88d4160a78e88db4 Mon Sep 17 00:00:00 2001 From: rillig Date: Mon, 28 Sep 2020 23:31:18 +0000 Subject: [PATCH] make(1): replace Lst_Open with direct iteration --- usr.bin/make/job.c | 6 +++--- usr.bin/make/targ.c | 15 +++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 902e73ef9354..bae7bd8336d4 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -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) && diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 19c9b274bacd..1a098a5216f1 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -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; }