Module Name: src
Committed By: rillig
Date: Sat Oct 24 10:36:23 UTC 2020
Modified Files:
src/usr.bin/make: lst.c lst.h main.c suff.c
Log Message:
make(1): remove unused Lst_Find and Lst_FindFrom
To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/make/lst.c
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/lst.h
cvs rdiff -u -r1.386 -r1.387 src/usr.bin/make/main.c
cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/suff.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/lst.c
diff -u src/usr.bin/make/lst.c:1.86 src/usr.bin/make/lst.c:1.87
--- src/usr.bin/make/lst.c:1.86 Sat Oct 24 10:18:29 2020
+++ src/usr.bin/make/lst.c Sat Oct 24 10:36:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.87 2020/10/24 10:36:23 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
#include "make.h"
-MAKE_RCSID("$NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.87 2020/10/24 10:36:23 rillig Exp $");
static ListNode *
LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@@ -204,39 +204,10 @@ LstNode_SetNull(ListNode *node)
node->datum = NULL;
}
-
/*
* Functions for entire lists
*/
-/* Return the first node from the list for which the match function returns
- * TRUE, or NULL if none of the nodes matched. */
-ListNode *
-Lst_Find(List *list, LstFindProc match, const void *matchArgs)
-{
- return Lst_FindFrom(list, list->first, match, matchArgs);
-}
-
-/* Return the first node from the list, starting at the given node, for which
- * the match function returns TRUE, or NULL if none of the nodes matches.
- *
- * The start node may be NULL, in which case nothing is found. */
-ListNode *
-Lst_FindFrom(List *list, ListNode *node,
- LstFindProc match, const void *matchArgs)
-{
- ListNode *tln;
-
- assert(list != NULL);
- assert(match != NULL);
-
- for (tln = node; tln != NULL; tln = tln->next)
- if (match(tln->datum, matchArgs))
- return tln;
-
- return NULL;
-}
-
/* Return the first node that contains the given datum, or NULL. */
ListNode *
Lst_FindDatum(List *list, const void *datum)
Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.78 src/usr.bin/make/lst.h:1.79
--- src/usr.bin/make/lst.h:1.78 Fri Oct 23 04:58:33 2020
+++ src/usr.bin/make/lst.h Sat Oct 24 10:36:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.78 2020/10/23 04:58:33 rillig Exp $ */
+/* $NetBSD: lst.h,v 1.79 2020/10/24 10:36:23 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -108,8 +108,6 @@ struct List {
typedef void *LstCopyProc(void *);
/* Free the datum of a node, called before freeing the node itself. */
typedef void LstFreeProc(void *);
-/* Return TRUE if the datum matches the args, for Lst_Find. */
-typedef Boolean LstFindProc(const void *datum, const void *args);
/* An action for Lst_ForEachUntil and Lst_ForEachUntilConcurrent. */
typedef int LstActionUntilProc(void *datum, void *args);
@@ -129,11 +127,6 @@ void Lst_Destroy(List *, LstFreeProc);
static inline MAKE_ATTR_UNUSED Boolean
Lst_IsEmpty(List *list) { return list->first == NULL; }
-/* Find the first node for which the function returns TRUE, or NULL. */
-ListNode *Lst_Find(List *, LstFindProc, const void *);
-/* Find the first node for which the function returns TRUE, or NULL.
- * The search starts at the given node, towards the end of the list. */
-ListNode *Lst_FindFrom(List *, ListNode *, LstFindProc, const void *);
/* Find the first node that contains the given datum, or NULL. */
ListNode *Lst_FindDatum(List *, const void *);
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.386 src/usr.bin/make/main.c:1.387
--- src/usr.bin/make/main.c:1.386 Sat Oct 24 09:28:50 2020
+++ src/usr.bin/make/main.c Sat Oct 24 10:36:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $ */
+/* $NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -791,7 +791,7 @@ Main_SetVarObjdir(const char *var, const
}
/* Read and parse the makefile.
- * Return TRUE if reading the makefile succeeded, for Lst_Find. */
+ * Return TRUE if reading the makefile succeeded. */
static int
ReadMakefileSucceeded(void *fname, void *unused)
{
Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.221 src/usr.bin/make/suff.c:1.222
--- src/usr.bin/make/suff.c:1.221 Sat Oct 24 03:30:25 2020
+++ src/usr.bin/make/suff.c Sat Oct 24 10:36:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.221 2020/10/24 03:30:25 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.222 2020/10/24 10:36:23 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
#include "dir.h"
/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.221 2020/10/24 03:30:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.222 2020/10/24 10:36:23 rillig Exp $");
#define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
#define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -265,7 +265,6 @@ SuffSuffGetSuffix(const Suff *s, size_t
return p1 == s->name - 1 ? p2 + 1 : NULL;
}
-/* Predicate form of SuffSuffGetSuffix, for Lst_Find. */
static Boolean
SuffSuffIsSuffix(const Suff *suff, size_t nameLen, char *nameEnd)
{