Module Name:    src
Committed By:   rillig
Date:           Thu Sep 24 07:59:33 UTC 2020

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

Log Message:
make(1): inline Lst_ForEach in Targ_PrintCmds


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 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/targ.c
diff -u src/usr.bin/make/targ.c:1.92 src/usr.bin/make/targ.c:1.93
--- src/usr.bin/make/targ.c:1.92	Thu Sep 24 07:11:29 2020
+++ src/usr.bin/make/targ.c	Thu Sep 24 07:59:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.92 2020/09/24 07:11:29 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.93 2020/09/24 07:59:33 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.92 2020/09/24 07:11:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.93 2020/09/24 07:59:33 rillig Exp $");
 
 static GNodeList *allTargets;	/* the list of all targets found so far */
 #ifdef CLEANUP
@@ -385,17 +385,14 @@ PrintNodeNamesLine(const char *label, GN
     fprintf(debug_file, "\n");
 }
 
-static int
-TargPrintCmd(void *cmd, void *dummy MAKE_ATTR_UNUSED)
-{
-    fprintf(debug_file, "\t%s\n", (char *)cmd);
-    return 0;
-}
-
 void
 Targ_PrintCmds(GNode *gn)
 {
-    Lst_ForEachUntil(gn->commands, TargPrintCmd, NULL);
+    StringListNode *node = Lst_First(gn->commands);
+    for (; node != NULL; node = LstNode_Next(node)) {
+	const char *cmd = LstNode_Datum(node);
+	fprintf(debug_file, "\t%s\n", cmd);
+    }
 }
 
 /* Format a modification time in some reasonable way and return it.

Reply via email to