Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make make(1): rename Lst_FindB back to Lst_Find
details: https://anonhg.NetBSD.org/src/rev/c27990f3914e
branches: trunk
changeset: 943250:c27990f3914e
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Aug 29 10:12:06 2020 +0000
description:
make(1): rename Lst_FindB back to Lst_Find
The migration from "comparison function" to "match function" is done,
the "B" in the names is no longer needed.
diffstat:
usr.bin/make/arch.c | 10 +++++-----
usr.bin/make/cond.c | 10 +++++-----
usr.bin/make/dir.c | 12 ++++++------
usr.bin/make/lst.c | 12 ++++++------
usr.bin/make/lst.h | 9 ++++-----
usr.bin/make/main.c | 16 ++++++++--------
usr.bin/make/meta.c | 10 +++++-----
usr.bin/make/suff.c | 42 +++++++++++++++++++++---------------------
8 files changed, 60 insertions(+), 61 deletions(-)
diffs (truncated from 513 to 300 lines):
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/arch.c
--- a/usr.bin/make/arch.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/arch.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arch.c,v 1.103 2020/08/29 09:30:10 rillig Exp $ */
+/* $NetBSD: arch.c,v 1.104 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.103 2020/08/29 09:30:10 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.104 2020/08/29 10:12:06 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: arch.c,v 1.103 2020/08/29 09:30:10 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.104 2020/08/29 10:12:06 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -455,7 +455,7 @@
}
/* See if the given archive is the one we are looking for.
- * Called via Lst_FindB. */
+ * Called via Lst_Find. */
static Boolean
ArchFindArchive(const void *ar, const void *desiredName)
{
@@ -507,7 +507,7 @@
member = base + 1;
}
- ln = Lst_FindB(archives, ArchFindArchive, archive);
+ ln = Lst_Find(archives, ArchFindArchive, archive);
if (ln != NULL) {
ar = Lst_Datum(ln);
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/cond.c
--- a/usr.bin/make/cond.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/cond.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.104 2020/08/29 09:30:10 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.105 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.104 2020/08/29 09:30:10 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.105 2020/08/29 10:12:06 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.104 2020/08/29 09:30:10 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.105 2020/08/29 10:12:06 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -272,7 +272,7 @@
return result;
}
-/* Wrapper around Str_Match, to be used by Lst_FindB. */
+/* Wrapper around Str_Match, to be used by Lst_Find. */
static Boolean
CondFindStrMatch(const void *string, const void *pattern)
{
@@ -283,7 +283,7 @@
static Boolean
CondDoMake(int argLen MAKE_ATTR_UNUSED, const char *arg)
{
- return Lst_FindB(create, CondFindStrMatch, arg) != NULL;
+ return Lst_Find(create, CondFindStrMatch, arg) != NULL;
}
/* See if the given file exists. */
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/dir.c
--- a/usr.bin/make/dir.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/dir.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.121 2020/08/29 09:30:10 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.122 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.121 2020/08/29 09:30:10 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.122 2020/08/29 10:12:06 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: dir.c,v 1.121 2020/08/29 09:30:10 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.122 2020/08/29 10:12:06 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -517,7 +517,7 @@
/* See if the Path structure describes the same directory as the
* given one by comparing their names. Called from Dir_AddDir via
- * Lst_FindB when searching the list of open directories. */
+ * Lst_Find when searching the list of open directories. */
static Boolean
DirFindName(const void *p, const void *desiredName)
{
@@ -1549,7 +1549,7 @@
struct dirent *dp; /* entry in directory */
if (path != NULL && strcmp(name, ".DOTLAST") == 0) {
- ln = Lst_FindB(path, DirFindName, name);
+ ln = Lst_Find(path, DirFindName, name);
if (ln != NULL)
return Lst_Datum(ln);
@@ -1558,7 +1558,7 @@
}
if (path != NULL)
- ln = Lst_FindB(openDirectories, DirFindName, name);
+ ln = Lst_Find(openDirectories, DirFindName, name);
if (ln != NULL) {
p = Lst_Datum(ln);
if (Lst_Member(path, p) == NULL) {
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/lst.c
--- a/usr.bin/make/lst.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/lst.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.54 2020/08/29 10:06:23 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.55 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -37,11 +37,11 @@
#include "make.h"
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lst.c,v 1.54 2020/08/29 10:06:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.55 2020/08/29 10:12:06 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.54 2020/08/29 10:06:23 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.55 2020/08/29 10:12:06 rillig Exp $");
#endif /* not lint */
#endif
@@ -378,9 +378,9 @@
/* Return the first node from the list for which the match function returns
* TRUE, or NULL if none of the nodes matched. */
LstNode
-Lst_FindB(Lst list, LstFindBProc match, const void *matchArgs)
+Lst_Find(Lst list, LstFindProc match, const void *matchArgs)
{
- return Lst_FindFromB(list, Lst_First(list), match, matchArgs);
+ return Lst_FindFrom(list, Lst_First(list), match, matchArgs);
}
/* Return the first node from the list, starting at the given node, for which
@@ -389,7 +389,7 @@
* The start node may be NULL, in which case nothing is found. This allows
* for passing Lst_First or Lst_Succ as the start node. */
LstNode
-Lst_FindFromB(Lst list, LstNode node, LstFindBProc match, const void *matchArgs)
+Lst_FindFrom(Lst list, LstNode node, LstFindProc match, const void *matchArgs)
{
LstNode tln;
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/lst.h
--- a/usr.bin/make/lst.h Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/lst.h Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.55 2020/08/29 10:06:23 rillig Exp $ */
+/* $NetBSD: lst.h,v 1.56 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,8 +92,7 @@
typedef void *LstCopyProc(void *);
typedef void LstFreeProc(void *);
-typedef int LstFindProc(const void *, const void *);
-typedef Boolean LstFindBProc(const void *, const void *);
+typedef Boolean LstFindProc(const void *, const void *);
typedef int LstActionProc(void *, void *);
/*
@@ -146,9 +145,9 @@
* Functions for entire lists
*/
/* Find an element in a list */
-LstNode Lst_FindB(Lst, LstFindBProc, const void *);
+LstNode Lst_Find(Lst, LstFindProc, const void *);
/* Find an element starting from somewhere */
-LstNode Lst_FindFromB(Lst, LstNode, LstFindBProc, const void *);
+LstNode Lst_FindFrom(Lst, LstNode, LstFindProc, const void *);
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/main.c
--- a/usr.bin/make/main.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/main.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.325 2020/08/29 09:30:10 rillig Exp $ */
+/* $NetBSD: main.c,v 1.326 2020/08/29 10:12:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.325 2020/08/29 09:30:10 rillig Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.326 2020/08/29 10:12:06 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.325 2020/08/29 09:30:10 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.326 2020/08/29 10:12:06 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -787,7 +787,7 @@
}
/* Read and parse the makefile.
- * Return TRUE if reading the makefile succeeded, for Lst_FindB. */
+ * Return TRUE if reading the makefile succeeded, for Lst_Find. */
static Boolean
ReadMakefileSucceeded(const void *fname, const void *unused)
{
@@ -795,7 +795,7 @@
}
/* Read and parse the makefile.
- * Return TRUE if reading the makefile failed, for Lst_FindB. */
+ * Return TRUE if reading the makefile failed, for Lst_Find. */
static Boolean
ReadMakefileFailed(const void *fname, const void *unused)
{
@@ -1335,7 +1335,7 @@
if (Lst_IsEmpty(sysMkPath))
Fatal("%s: no system rules (%s).", progname,
_PATH_DEFSYSMK);
- ln = Lst_FindB(sysMkPath, ReadMakefileSucceeded, NULL);
+ ln = Lst_Find(sysMkPath, ReadMakefileSucceeded, NULL);
if (ln == NULL)
Fatal("%s: cannot open %s.", progname,
(char *)Lst_Datum(Lst_First(sysMkPath)));
@@ -1344,7 +1344,7 @@
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
- ln = Lst_FindB(makefiles, ReadMakefileFailed, NULL);
+ ln = Lst_Find(makefiles, ReadMakefileFailed, NULL);
if (ln != NULL)
Fatal("%s: cannot open %s.", progname,
(char *)Lst_Datum(ln));
@@ -1353,7 +1353,7 @@
VAR_CMD, VARE_WANTRES);
if (p1) {
(void)str2Lst_Append(makefiles, p1, NULL);
- (void)Lst_FindB(makefiles, ReadMakefileSucceeded, NULL);
+ (void)Lst_Find(makefiles, ReadMakefileSucceeded, NULL);
free(p1);
}
}
diff -r ddfff8463cb6 -r c27990f3914e usr.bin/make/meta.c
--- a/usr.bin/make/meta.c Sat Aug 29 10:06:23 2020 +0000
+++ b/usr.bin/make/meta.c Sat Aug 29 10:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.108 2020/08/29 10:06:23 rillig Exp $ */
+/* $NetBSD: meta.c,v 1.109 2020/08/29 10:12:06 rillig Exp $ */
/*
* Implement 'meta' mode.
@@ -1318,13 +1318,13 @@
case 'D': /* unlink */
if (*p == '/' && !Lst_IsEmpty(missingFiles)) {
Home |
Main Index |
Thread Index |
Old Index