Module Name:    src
Committed By:   rillig
Date:           Mon Oct 19 20:51:18 UTC 2020

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

Log Message:
make(1): remove void pointers from ParseClearPath


To generate a diff of this commit:
cvs rdiff -u -r1.391 -r1.392 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.391 src/usr.bin/make/parse.c:1.392
--- src/usr.bin/make/parse.c:1.391	Sun Oct 18 20:46:42 2020
+++ src/usr.bin/make/parse.c	Mon Oct 19 20:51:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.391 2020/10/18 20:46:42 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.391 2020/10/18 20:46:42 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $");
 
 /* types and constants */
 
@@ -196,6 +196,7 @@ typedef enum ParseSpecial {
 } ParseSpecial;
 
 typedef List SearchPathList;
+typedef ListNode SearchPathListNode;
 
 /* result data */
 
@@ -1018,12 +1019,6 @@ ParseAddDir(void *path, void *name)
     (void)Dir_AddDir(path, name);
 }
 
-static void
-ParseClearPath(void *path, void *unused MAKE_ATTR_UNUSED)
-{
-    Dir_ClearPath(path);
-}
-
 /*
  * We got to the end of the line while we were still looking at targets.
  *
@@ -1350,6 +1345,18 @@ ParseDoDependencyParseOp(char **const pp
 }
 
 static void
+ClearPaths(SearchPathList *paths)
+{
+    if (paths != NULL) {
+	SearchPathListNode *ln;
+	for (ln = paths->first; ln != NULL; ln = ln->next)
+	    Dir_ClearPath(ln->datum);
+    }
+
+    Dir_SetPATH();
+}
+
+static void
 ParseDoDependencySourcesEmpty(ParseSpecial const specType,
 			      SearchPathList *const paths)
 {
@@ -1367,9 +1374,7 @@ ParseDoDependencySourcesEmpty(ParseSpeci
 	beSilent = TRUE;
 	break;
     case ExPath:
-	if (paths != NULL)
-	    Lst_ForEach(paths, ParseClearPath, NULL);
-	Dir_SetPATH();
+	ClearPaths(paths);
 	break;
 #ifdef POSIX
     case Posix:

Reply via email to