Module Name: src
Committed By: rillig
Date: Mon Oct 19 20:55:30 UTC 2020
Modified Files:
src/usr.bin/make: parse.c
Log Message:
make(1): remove void pointers from ParseAddDir
To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 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.392 src/usr.bin/make/parse.c:1.393
--- src/usr.bin/make/parse.c:1.392 Mon Oct 19 20:51:18 2020
+++ src/usr.bin/make/parse.c Mon Oct 19 20:55:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.392 2020/10/19 20:51:18 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.393 2020/10/19 20:55:30 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.392 2020/10/19 20:51:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.393 2020/10/19 20:55:30 rillig Exp $");
/* types and constants */
@@ -1013,12 +1013,6 @@ FindMainTarget(void)
}
}
-static void
-ParseAddDir(void *path, void *name)
-{
- (void)Dir_AddDir(path, name);
-}
-
/*
* We got to the end of the line while we were still looking at targets.
*
@@ -1386,6 +1380,16 @@ ParseDoDependencySourcesEmpty(ParseSpeci
}
}
+static void
+AddToPaths(const char *dir, SearchPathList *paths)
+{
+ if (paths != NULL) {
+ SearchPathListNode *ln;
+ for (ln = paths->first; ln != NULL; ln = ln->next)
+ (void)Dir_AddDir(ln->datum, dir);
+ }
+}
+
/*
* If the target was one that doesn't take files as its sources
* but takes something like suffixes, we take each
@@ -1422,8 +1426,7 @@ ParseDoDependencySourceSpecial(ParseSpec
Suff_AddSuffix(line, &mainNode);
break;
case ExPath:
- if (paths != NULL)
- Lst_ForEach(paths, ParseAddDir, line);
+ AddToPaths(line, paths);
break;
case Includes:
Suff_AddInclude(line);