diff options
author | will <will@FreeBSD.org> | 2000-12-02 18:58:01 +0000 |
---|---|---|
committer | will <will@FreeBSD.org> | 2000-12-02 18:58:01 +0000 |
commit | 797262c9e92824a19005f56e85cd3f19b8273f9b (patch) | |
tree | 7680565ed1402e4003087d01cf0b545aee3b625e /usr.bin/make/lst.lib | |
parent | d04b66b7bc8243e8d0f41b0ec49287b046f7896c (diff) | |
download | FreeBSD-src-797262c9e92824a19005f56e85cd3f19b8273f9b.zip FreeBSD-src-797262c9e92824a19005f56e85cd3f19b8273f9b.tar.gz |
There's no reason to use fancy forms of NULL. Replace all instances
of NIL, NILLST, NILLGNODE, etc. with NULL.
Obtained from: OpenBSD
Diffstat (limited to 'usr.bin/make/lst.lib')
-rw-r--r-- | usr.bin/make/lst.lib/lstAppend.c | 10 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstConcat.c | 28 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstDatum.c | 6 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstDeQueue.c | 8 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstDestroy.c | 12 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstDupl.c | 16 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstFind.c | 2 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstFindFrom.c | 8 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstFirst.c | 4 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstForEachFrom.c | 2 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstInit.c | 4 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstInsert.c | 8 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstInt.h | 12 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstIsEmpty.c | 4 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstLast.c | 4 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstMember.c | 8 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstNext.c | 12 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstOpen.c | 4 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstRemove.c | 12 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstReplace.c | 2 | ||||
-rw-r--r-- | usr.bin/make/lst.lib/lstSucc.c | 4 |
21 files changed, 83 insertions, 87 deletions
diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c index 6b73f46..155addc 100644 --- a/usr.bin/make/lst.lib/lstAppend.c +++ b/usr.bin/make/lst.lib/lstAppend.c @@ -60,7 +60,7 @@ __RCSID("$FreeBSD$"); * A new ListNode is created and linked in to the List. The lastPtr * field of the List will be altered if ln is the last node in the * list. lastPtr and firstPtr will alter if the list was empty and - * ln was NILLNODE. + * ln was NULL. * *----------------------------------------------------------------------- */ @@ -74,7 +74,7 @@ Lst_Append (l, ln, d) register ListNode lNode; register ListNode nLNode; - if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) { + if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) { goto ok; } @@ -90,11 +90,11 @@ Lst_Append (l, ln, d) nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - if (lNode == NilListNode) { + if (lNode == NULL) { if (list->isCirc) { nLNode->nextPtr = nLNode->prevPtr = nLNode; } else { - nLNode->nextPtr = nLNode->prevPtr = NilListNode; + nLNode->nextPtr = nLNode->prevPtr = NULL; } list->firstPtr = list->lastPtr = nLNode; } else { @@ -102,7 +102,7 @@ Lst_Append (l, ln, d) nLNode->nextPtr = lNode->nextPtr; lNode->nextPtr = nLNode; - if (nLNode->nextPtr != NilListNode) { + if (nLNode->nextPtr != NULL) { nLNode->nextPtr->prevPtr = nLNode; } diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index 707cbd0..6f0b207 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -84,16 +84,16 @@ Lst_Concat (l1, l2, flags) } if (flags == LST_CONCLINK) { - if (list2->firstPtr != NilListNode) { + if (list2->firstPtr != NULL) { /* * We set the nextPtr of the - * last element of list two to be NIL to make the loop easier and + * last element of list two to be NULL to make the loop easier and * so we don't need an extra case should the first list turn * out to be non-circular -- the final element will already point - * to NIL space and the first element will be untouched if it - * existed before and will also point to NIL space if it didn't. + * to NULL space and the first element will be untouched if it + * existed before and will also point to NULL space if it didn't. */ - list2->lastPtr->nextPtr = NilListNode; + list2->lastPtr->nextPtr = NULL; /* * So long as the second list isn't empty, we just link the * first element of the second list to the last element of the @@ -103,14 +103,14 @@ Lst_Concat (l1, l2, flags) * the last element of the first list. */ list2->firstPtr->prevPtr = list1->lastPtr; - if (list1->lastPtr != NilListNode) { + if (list1->lastPtr != NULL) { list1->lastPtr->nextPtr = list2->firstPtr; } else { list1->firstPtr = list2->firstPtr; } list1->lastPtr = list2->lastPtr; } - if (list1->isCirc && list1->firstPtr != NilListNode) { + if (list1->isCirc && list1->firstPtr != NULL) { /* * If the first list is supposed to be circular and it is (now) * non-empty, we must make sure it's circular by linking the @@ -120,27 +120,27 @@ Lst_Concat (l1, l2, flags) list1->lastPtr->nextPtr = list1->firstPtr; } free ((Address)l2); - } else if (list2->firstPtr != NilListNode) { + } else if (list2->firstPtr != NULL) { /* - * We set the nextPtr of the last element of list 2 to be nil to make + * We set the nextPtr of the last element of list 2 to be NULL to make * the loop less difficult. The loop simply goes through the entire * second list creating new LstNodes and filling in the nextPtr, and * prevPtr to fit into l1 and its datum field from the * datum field of the corresponding element in l2. The 'last' node * follows the last of the new nodes along until the entire l2 has * been appended. Only then does the bookkeeping catch up with the - * changes. During the first iteration of the loop, if 'last' is nil, + * changes. During the first iteration of the loop, if 'last' is NULL, * the first list must have been empty so the newly-created node is * made the first node of the list. */ - list2->lastPtr->nextPtr = NilListNode; + list2->lastPtr->nextPtr = NULL; for (last = list1->lastPtr, ln = list2->firstPtr; - ln != NilListNode; + ln != NULL; ln = ln->nextPtr) { PAlloc (nln, ListNode); nln->datum = ln->datum; - if (last != NilListNode) { + if (last != NULL) { last->nextPtr = nln; } else { list1->firstPtr = nln; @@ -166,7 +166,7 @@ Lst_Concat (l1, l2, flags) list1->lastPtr->nextPtr = list1->firstPtr; list1->firstPtr->prevPtr = list1->lastPtr; } else { - last->nextPtr = NilListNode; + last->nextPtr = NULL; } if (list2->isCirc) { diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c index 1391928..3d2b0cf 100644 --- a/usr.bin/make/lst.lib/lstDatum.c +++ b/usr.bin/make/lst.lib/lstDatum.c @@ -54,7 +54,7 @@ __RCSID("$FreeBSD$"); * Return the datum stored in the given node. * * Results: - * The datum or (ick!) NIL if the node is invalid. + * The datum or (ick!) NULL if the node is invalid. * * Side Effects: * None. @@ -65,10 +65,10 @@ ClientData Lst_Datum (ln) LstNode ln; { - if (ln != NILLNODE) { + if (ln != NULL) { return (((ListNode)ln)->datum); } else { - return ((ClientData) NIL); + return ((ClientData) NULL); } } diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index 9db3aca..b004dee 100644 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr.bin/make/lst.lib/lstDeQueue.c @@ -54,7 +54,7 @@ __RCSID("$FreeBSD$"); * Remove and return the datum at the head of the given list. * * Results: - * The datum in the node at the head or (ick) NIL if the list + * The datum in the node at the head or (ick) NULL if the list * is empty. * * Side Effects: @@ -70,13 +70,13 @@ Lst_DeQueue (l) register ListNode tln; tln = (ListNode) Lst_First (l); - if (tln == NilListNode) { - return ((ClientData) NIL); + if (tln == NULL) { + return ((ClientData) NULL); } rd = tln->datum; if (Lst_Remove (l, (LstNode)tln) == FAILURE) { - return ((ClientData) NIL); + return ((ClientData) NULL); } else { return (rd); } diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index e6db457..32f79f4 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -69,10 +69,10 @@ Lst_Destroy (l, freeProc) register void (*freeProc) __P((ClientData)); { register ListNode ln; - register ListNode tln = NilListNode; + register ListNode tln = NULL; register List list = (List)l; - if (l == NILLST || ! l) { + if (l == NULL || ! l) { /* * Note the check for l == (Lst)0 to catch uninitialized static Lst's. * Gross, but useful. @@ -81,21 +81,21 @@ Lst_Destroy (l, freeProc) } /* To ease scanning */ - if (list->lastPtr != NilListNode) - list->lastPtr->nextPtr = NilListNode; + if (list->lastPtr != NULL) + list->lastPtr->nextPtr = NULL; else { free ((Address)l); return; } if (freeProc) { - for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + for (ln = list->firstPtr; ln != NULL; ln = tln) { tln = ln->nextPtr; (*freeProc) (ln->datum); free ((Address)ln); } } else { - for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + for (ln = list->firstPtr; ln != NULL; ln = tln) { tln = ln->nextPtr; free ((Address)ln); } diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c index 4c5ee04..6d0665bb 100644 --- a/usr.bin/make/lst.lib/lstDupl.c +++ b/usr.bin/make/lst.lib/lstDupl.c @@ -56,7 +56,7 @@ __RCSID("$FreeBSD$"); * given, the individual client elements will be duplicated as well. * * Results: - * The new Lst structure or NILLST if failure. + * The new Lst structure or NULL if failure. * * Side Effects: * A new list is created. @@ -73,26 +73,26 @@ Lst_Duplicate (l, copyProc) register List list = (List)l; if (!LstValid (l)) { - return (NILLST); + return (NULL); } nl = Lst_Init (list->isCirc); - if (nl == NILLST) { - return (NILLST); + if (nl == NULL) { + return (NULL); } ln = list->firstPtr; - while (ln != NilListNode) { + while (ln != NULL) { if (copyProc != NOCOPY) { if (Lst_AtEnd (nl, (*copyProc) (ln->datum)) == FAILURE) { - return (NILLST); + return (NULL); } } else if (Lst_AtEnd (nl, ln->datum) == FAILURE) { - return (NILLST); + return (NULL); } if (list->isCirc && ln == list->lastPtr) { - ln = NilListNode; + ln = NULL; } else { ln = ln->nextPtr; } diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c index cdb9190..acc0386 100644 --- a/usr.bin/make/lst.lib/lstFind.c +++ b/usr.bin/make/lst.lib/lstFind.c @@ -55,7 +55,7 @@ __RCSID("$FreeBSD$"); * and the given datum. * * Results: - * The found node or NILLNODE if none matches. + * The found node or NULL if none matches. * * Side Effects: * None. diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index a59956c..2249115 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -56,7 +56,7 @@ __RCSID("$FreeBSD$"); * determine when it has been found. * * Results: - * The found node or NILLNODE + * The found node or NULL * * Side Effects: * None. @@ -74,7 +74,7 @@ Lst_FindFrom (l, ln, d, cProc) Boolean found = FALSE; if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return (NILLNODE); + return (NULL); } tln = (ListNode)ln; @@ -86,12 +86,12 @@ Lst_FindFrom (l, ln, d, cProc) } else { tln = tln->nextPtr; } - } while (tln != (ListNode)ln && tln != NilListNode); + } while (tln != (ListNode)ln && tln != NULL); if (found) { return ((LstNode)tln); } else { - return (NILLNODE); + return (NULL); } } diff --git a/usr.bin/make/lst.lib/lstFirst.c b/usr.bin/make/lst.lib/lstFirst.c index 96d6e1b..560a4b1 100644 --- a/usr.bin/make/lst.lib/lstFirst.c +++ b/usr.bin/make/lst.lib/lstFirst.c @@ -54,7 +54,7 @@ __RCSID("$FreeBSD$"); * Return the first node on the given list. * * Results: - * The first node or NILLNODE if the list is empty. + * The first node or NULL if the list is empty. * * Side Effects: * None. @@ -66,7 +66,7 @@ Lst_First (l) Lst l; { if (!LstValid (l) || LstIsEmpty (l)) { - return (NILLNODE); + return (NULL); } else { return ((LstNode)((List)l)->firstPtr); } diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c index 7d647c3..579a640 100644 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr.bin/make/lst.lib/lstForEachFrom.c @@ -101,7 +101,7 @@ Lst_ForEachFrom (l, ln, proc, d) * doesn't exist. */ done = (next == tln->nextPtr && - (next == NilListNode || next == list->firstPtr)); + (next == NULL || next == list->firstPtr)); next = tln->nextPtr; diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c index d04a6c3..0aa4c69 100644 --- a/usr.bin/make/lst.lib/lstInit.c +++ b/usr.bin/make/lst.lib/lstInit.c @@ -69,8 +69,8 @@ Lst_Init(circ) PAlloc (nList, List); - nList->firstPtr = NilListNode; - nList->lastPtr = NilListNode; + nList->firstPtr = NULL; + nList->lastPtr = NULL; nList->isOpen = FALSE; nList->isCirc = circ; nList->atEnd = Unknown; diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index dd64dd6..fca1e41 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -77,7 +77,7 @@ Lst_Insert (l, ln, d) /* * check validity of arguments */ - if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE)) + if (LstValid (l) && (LstIsEmpty (l) && ln == NULL)) goto ok; if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { @@ -90,18 +90,18 @@ Lst_Insert (l, ln, d) nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - if (ln == NILLNODE) { + if (ln == NULL) { if (list->isCirc) { nLNode->prevPtr = nLNode->nextPtr = nLNode; } else { - nLNode->prevPtr = nLNode->nextPtr = NilListNode; + nLNode->prevPtr = nLNode->nextPtr = NULL; } list->firstPtr = list->lastPtr = nLNode; } else { nLNode->prevPtr = lNode->prevPtr; nLNode->nextPtr = lNode; - if (nLNode->prevPtr != NilListNode) { + if (nLNode->prevPtr != NULL) { nLNode->prevPtr->nextPtr = nLNode; } lNode->prevPtr = nLNode; diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h index 0e28740..6bbc240 100644 --- a/usr.bin/make/lst.lib/lstInt.h +++ b/usr.bin/make/lst.lib/lstInt.h @@ -61,8 +61,6 @@ typedef struct ListNode { */ #define LN_DELETED 0x0001 /* List node should be removed when done */ -#define NilListNode ((ListNode)-1) - typedef enum { Head, Middle, Tail, Unknown } Where; @@ -77,14 +75,12 @@ typedef struct { */ Where atEnd; /* Where in the list the last access was */ Boolean isOpen; /* true if list has been Lst_Open'ed */ - ListNode curPtr; /* current node, if open. NilListNode if + ListNode curPtr; /* current node, if open. NULL if * *just* opened */ ListNode prevPtr; /* Previous node, if open. Used by * Lst_Remove */ } *List; -#define NilList ((List)-1) - /* * PAlloc (var, ptype) -- * Allocate a pointer-typedef structure 'ptype' into the variable 'var' @@ -95,18 +91,18 @@ typedef struct { * LstValid (l) -- * Return TRUE if the list l is valid */ -#define LstValid(l) (((Lst)l == NILLST) ? FALSE : TRUE) +#define LstValid(l) (((Lst)l == NULL) ? FALSE : TRUE) /* * LstNodeValid (ln, l) -- * Return TRUE if the LstNode ln is valid with respect to l */ -#define LstNodeValid(ln, l) ((((LstNode)ln) == NILLNODE) ? FALSE : TRUE) +#define LstNodeValid(ln, l) ((((LstNode)ln) == NULL) ? FALSE : TRUE) /* * LstIsEmpty (l) -- * TRUE if the list l is empty. */ -#define LstIsEmpty(l) (((List)l)->firstPtr == NilListNode) +#define LstIsEmpty(l) (((List)l)->firstPtr == NULL) #endif /* _LSTINT_H_ */ diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c index a73005b..8017ac0 100644 --- a/usr.bin/make/lst.lib/lstIsEmpty.c +++ b/usr.bin/make/lst.lib/lstIsEmpty.c @@ -59,8 +59,8 @@ __RCSID("$FreeBSD$"); * Side Effects: * None. * - * A list is considered empty if its firstPtr == NilListNode (or if - * the list itself is NILLIST). + * A list is considered empty if its firstPtr == NULL (or if + * the list itself is NULLLIST). *----------------------------------------------------------------------- */ Boolean diff --git a/usr.bin/make/lst.lib/lstLast.c b/usr.bin/make/lst.lib/lstLast.c index 0915dea..cf42237 100644 --- a/usr.bin/make/lst.lib/lstLast.c +++ b/usr.bin/make/lst.lib/lstLast.c @@ -54,7 +54,7 @@ __RCSID("$FreeBSD$"); * Return the last node on the list l. * * Results: - * The requested node or NILLNODE if the list is empty. + * The requested node or NULL if the list is empty. * * Side Effects: * None. @@ -66,7 +66,7 @@ Lst_Last (l) Lst l; { if (!LstValid(l) || LstIsEmpty (l)) { - return (NILLNODE); + return (NULL); } else { return ((LstNode)((List)l)->lastPtr); } diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c index 6428ec7..f12a1fc 100644 --- a/usr.bin/make/lst.lib/lstMember.c +++ b/usr.bin/make/lst.lib/lstMember.c @@ -57,8 +57,8 @@ Lst_Member (l, d) register ListNode lNode; lNode = list->firstPtr; - if (lNode == NilListNode) { - return NILLNODE; + if (lNode == NULL) { + return NULL; } do { @@ -66,7 +66,7 @@ Lst_Member (l, d) return (LstNode)lNode; } lNode = lNode->nextPtr; - } while (lNode != NilListNode && lNode != list->firstPtr); + } while (lNode != NULL && lNode != list->firstPtr); - return NILLNODE; + return NULL; } diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c index 105928c..f27e4ea 100644 --- a/usr.bin/make/lst.lib/lstNext.c +++ b/usr.bin/make/lst.lib/lstNext.c @@ -59,8 +59,8 @@ __RCSID("$FreeBSD$"); * Return the next node for the given list. * * Results: - * The next node or NILLNODE if the list has yet to be opened. Also - * if the list is non-circular and the end has been reached, NILLNODE + * The next node or NULL if the list has yet to be opened. Also + * if the list is non-circular and the end has been reached, NULL * is returned. * * Side Effects: @@ -77,12 +77,12 @@ Lst_Next (l) if ((LstValid (l) == FALSE) || (list->isOpen == FALSE)) { - return (NILLNODE); + return (NULL); } list->prevPtr = list->curPtr; - if (list->curPtr == NilListNode) { + if (list->curPtr == NULL) { if (list->atEnd == Unknown) { /* * If we're just starting out, atEnd will be Unknown. @@ -92,14 +92,14 @@ Lst_Next (l) list->curPtr = tln = list->firstPtr; list->atEnd = Middle; } else { - tln = NilListNode; + tln = NULL; list->atEnd = Tail; } } else { tln = list->curPtr->nextPtr; list->curPtr = tln; - if (tln == list->firstPtr || tln == NilListNode) { + if (tln == list->firstPtr || tln == NULL) { /* * If back at the front, then we've hit the end... */ diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c index 3e8bbc7..3aa1861 100644 --- a/usr.bin/make/lst.lib/lstOpen.c +++ b/usr.bin/make/lst.lib/lstOpen.c @@ -62,7 +62,7 @@ __RCSID("$FreeBSD$"); * SUCCESS or FAILURE. * * Side Effects: - * isOpen is set TRUE and curPtr is set to NilListNode so the + * isOpen is set TRUE and curPtr is set to NULL so the * other sequential functions no it was just opened and can choose * the first element accessed based on this. * @@ -77,7 +77,7 @@ Lst_Open (l) } ((List) l)->isOpen = TRUE; ((List) l)->atEnd = LstIsEmpty (l) ? Head : Unknown; - ((List) l)->curPtr = NilListNode; + ((List) l)->curPtr = NULL; return (SUCCESS); } diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c index 283b03f..6460c9b 100644 --- a/usr.bin/make/lst.lib/lstRemove.c +++ b/usr.bin/make/lst.lib/lstRemove.c @@ -57,7 +57,7 @@ __RCSID("$FreeBSD$"); * SUCCESS or FAILURE. * * Side Effects: - * The list's firstPtr will be set to NilListNode if ln is the last + * The list's firstPtr will be set to NULL if ln is the last * node on the list. firsPtr and lastPtr will be altered if ln is * either the first or last node, respectively, on the list. * @@ -79,10 +79,10 @@ Lst_Remove (l, ln) /* * unlink it from the list */ - if (lNode->nextPtr != NilListNode) { + if (lNode->nextPtr != NULL) { lNode->nextPtr->prevPtr = lNode->prevPtr; } - if (lNode->prevPtr != NilListNode) { + if (lNode->prevPtr != NULL) { lNode->prevPtr->nextPtr = lNode->nextPtr; } @@ -100,12 +100,12 @@ Lst_Remove (l, ln) /* * Sequential access stuff. If the node we're removing is the current * node in the list, reset the current node to the previous one. If the - * previous one was non-existent (prevPtr == NilListNode), we set the + * previous one was non-existent (prevPtr == NULL), we set the * end to be Unknown, since it is. */ if (list->isOpen && (list->curPtr == lNode)) { list->curPtr = list->prevPtr; - if (list->curPtr == NilListNode) { + if (list->curPtr == NULL) { list->atEnd = Unknown; } } @@ -116,7 +116,7 @@ Lst_Remove (l, ln) * this case). The list is, therefore, empty and is marked as such */ if (list->firstPtr == lNode) { - list->firstPtr = NilListNode; + list->firstPtr = NULL; } /* diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c index 82e8031..d8a1f21 100644 --- a/usr.bin/make/lst.lib/lstReplace.c +++ b/usr.bin/make/lst.lib/lstReplace.c @@ -66,7 +66,7 @@ Lst_Replace (ln, d) register LstNode ln; ClientData d; { - if (ln == NILLNODE) { + if (ln == NULL) { return (FAILURE); } else { ((ListNode) ln)->datum = d; diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c index 461fe9a..493e287 100644 --- a/usr.bin/make/lst.lib/lstSucc.c +++ b/usr.bin/make/lst.lib/lstSucc.c @@ -67,8 +67,8 @@ LstNode Lst_Succ (ln) LstNode ln; { - if (ln == NILLNODE) { - return (NILLNODE); + if (ln == NULL) { + return (NULL); } else { return ((LstNode) ((ListNode) ln)->nextPtr); } |