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): remove unused Lst_Find and Lst_FindFrom



details:   https://anonhg.NetBSD.org/src/rev/c2e284028a21
branches:  trunk
changeset: 941579:c2e284028a21
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 24 10:36:23 2020 +0000

description:
make(1): remove unused Lst_Find and Lst_FindFrom

diffstat:

 usr.bin/make/lst.c  |  33 ++-------------------------------
 usr.bin/make/lst.h  |   9 +--------
 usr.bin/make/main.c |   6 +++---
 usr.bin/make/suff.c |   5 ++---
 4 files changed, 8 insertions(+), 45 deletions(-)

diffs (141 lines):

diff -r 664d341a46c6 -r c2e284028a21 usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Sat Oct 24 10:32:25 2020 +0000
+++ b/usr.bin/make/lst.c        Sat Oct 24 10:36:23 2020 +0000
@@ -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 @@
     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)
diff -r 664d341a46c6 -r c2e284028a21 usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Sat Oct 24 10:32:25 2020 +0000
+++ b/usr.bin/make/lst.h        Sat Oct 24 10:36:23 2020 +0000
@@ -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 @@
 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 @@
 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 *);
 
diff -r 664d341a46c6 -r c2e284028a21 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Oct 24 10:32:25 2020 +0000
+++ b/usr.bin/make/main.c       Sat Oct 24 10:36:23 2020 +0000
@@ -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 @@
 }
 
 /* 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)
 {
diff -r 664d341a46c6 -r c2e284028a21 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Oct 24 10:32:25 2020 +0000
+++ b/usr.bin/make/suff.c       Sat Oct 24 10:36:23 2020 +0000
@@ -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 @@
     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)
 {



Home | Main Index | Thread Index | Old Index