summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/lst.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-03-16 16:11:11 +0000
committerharti <harti@FreeBSD.org>2005-03-16 16:11:11 +0000
commit3d5967d36501793e41068bed0ef3fd32fa72411a (patch)
tree58f53d9bcf9b9081d674b794b286c2d59263feae /usr.bin/make/lst.c
parentdf4f9cb09a9b495d4414f941dd34e968e222b42f (diff)
downloadFreeBSD-src-3d5967d36501793e41068bed0ef3fd32fa72411a.zip
FreeBSD-src-3d5967d36501793e41068bed0ef3fd32fa72411a.tar.gz
Now that there are no users of Lst_ForEach and Lst_ForEachFrom are left
delete these two macros and all the associated stuff.
Diffstat (limited to 'usr.bin/make/lst.c')
-rw-r--r--usr.bin/make/lst.c65
1 files changed, 1 insertions, 64 deletions
diff --git a/usr.bin/make/lst.c b/usr.bin/make/lst.c
index db4d83c..c3e932b 100644
--- a/usr.bin/make/lst.c
+++ b/usr.bin/make/lst.c
@@ -69,7 +69,6 @@ Lst_Append(Lst *list, LstNode *ln, void *d)
nLNode = emalloc(sizeof(*nLNode));
nLNode->datum = d;
- nLNode->useCount = nLNode->flags = 0;
if (ln == NULL) {
nLNode->nextPtr = nLNode->prevPtr = NULL;
@@ -161,7 +160,6 @@ Lst_Concat(Lst *list1, Lst *list2, int flags)
list1->firstPtr = nln;
}
nln->prevPtr = last;
- nln->flags = nln->useCount = 0;
last = nln;
}
@@ -315,62 +313,6 @@ Lst_FindFrom(Lst *l, LstNode *ln, const void *d, CompareProc *cProc)
/*-
*-----------------------------------------------------------------------
- * Lst_ForEachFrom --
- * Apply the given function to each element of the given list. The
- * function should return 0 if traversal should continue and non-
- * zero if it should abort.
- *
- * Results:
- * None.
- *
- * Side Effects:
- * Only those created by the passed-in function.
- *
- *-----------------------------------------------------------------------
- */
-void
-Lst_ForEachFrom(Lst *list, LstNode *ln, DoProc *proc, void *d)
-{
- LstNode *next;
- Boolean done;
- int result;
-
- if (!Lst_Valid(list) || Lst_IsEmpty(list)) {
- return;
- }
-
- do {
- /*
- * Take care of having the current element deleted out from under
- * us.
- */
-
- next = ln->nextPtr;
-
- ln->useCount++;
- result = (*proc)(ln->datum, d);
- ln->useCount--;
-
- /*
- * We're done with the traversal if
- * - nothing's been added after the current node and
- * - the next node to examine is the first in the queue or
- * doesn't exist.
- */
- done = (next == ln->nextPtr &&
- (next == NULL || next == list->firstPtr));
-
- next = ln->nextPtr;
-
- if (ln->flags & LN_DELETED) {
- free(ln);
- }
- ln = next;
- } while (!result && !Lst_IsEmpty(list) && !done);
-}
-
-/*-
- *-----------------------------------------------------------------------
* Lst_Insert --
* Insert a new node with the given piece of data before the given
* node in the given list.
@@ -393,7 +335,6 @@ Lst_Insert(Lst *list, LstNode *ln, void *d)
nLNode = emalloc(sizeof(*nLNode));
nLNode->datum = d;
- nLNode->useCount = nLNode->flags = 0;
if (ln == NULL) {
nLNode->prevPtr = nLNode->nextPtr = NULL;
@@ -472,9 +413,5 @@ Lst_Remove(Lst *list, LstNode *ln)
* note that the datum is unmolested. The caller must free it as
* necessary and as expected.
*/
- if (ln->useCount == 0) {
- free(ln);
- } else {
- ln->flags |= LN_DELETED;
- }
+ free(ln);
}
OpenPOWER on IntegriCloud