From bfdbffbb39cc765f403dee37a7921bd50170a2fc Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sat, 29 Apr 1995 00:22:00 -0800 Subject: [PATCH 1/1] upgraded to the latest NetBSD version SCCS-vsn: usr.bin/make/lst.lib/lstAppend.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstAtEnd.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstAtFront.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstClose.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstConcat.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstDatum.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstDeQueue.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstDestroy.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstDupl.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstEnQueue.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstFind.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstFindFrom.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstFirst.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstForEach.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstForEachFrom.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstInit.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstInsert.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstIsAtEnd.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstIsEmpty.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstLast.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstMember.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstNext.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstOpen.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstRemove.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstReplace.c 8.2 SCCS-vsn: usr.bin/make/lst.lib/lstSucc.c 8.2 --- usr/src/usr.bin/make/lst.lib/lstAppend.c | 2 +- usr/src/usr.bin/make/lst.lib/lstAtEnd.c | 2 +- usr/src/usr.bin/make/lst.lib/lstAtFront.c | 2 +- usr/src/usr.bin/make/lst.lib/lstClose.c | 2 +- usr/src/usr.bin/make/lst.lib/lstConcat.c | 4 ++- usr/src/usr.bin/make/lst.lib/lstDatum.c | 2 +- usr/src/usr.bin/make/lst.lib/lstDeQueue.c | 2 +- usr/src/usr.bin/make/lst.lib/lstDestroy.c | 32 +++++++++++-------- usr/src/usr.bin/make/lst.lib/lstDupl.c | 5 +-- usr/src/usr.bin/make/lst.lib/lstEnQueue.c | 2 +- usr/src/usr.bin/make/lst.lib/lstFind.c | 4 +-- usr/src/usr.bin/make/lst.lib/lstFindFrom.c | 4 +-- usr/src/usr.bin/make/lst.lib/lstFirst.c | 2 +- usr/src/usr.bin/make/lst.lib/lstForEach.c | 4 +-- usr/src/usr.bin/make/lst.lib/lstForEachFrom.c | 2 +- usr/src/usr.bin/make/lst.lib/lstInit.c | 2 +- usr/src/usr.bin/make/lst.lib/lstInsert.c | 2 +- usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c | 2 +- usr/src/usr.bin/make/lst.lib/lstIsEmpty.c | 2 +- usr/src/usr.bin/make/lst.lib/lstLast.c | 2 +- usr/src/usr.bin/make/lst.lib/lstMember.c | 2 +- usr/src/usr.bin/make/lst.lib/lstNext.c | 2 +- usr/src/usr.bin/make/lst.lib/lstOpen.c | 2 +- usr/src/usr.bin/make/lst.lib/lstRemove.c | 2 +- usr/src/usr.bin/make/lst.lib/lstReplace.c | 2 +- usr/src/usr.bin/make/lst.lib/lstSucc.c | 2 +- 26 files changed, 50 insertions(+), 43 deletions(-) diff --git a/usr/src/usr.bin/make/lst.lib/lstAppend.c b/usr/src/usr.bin/make/lst.lib/lstAppend.c index 23e98353d3..cb9175f197 100644 --- a/usr/src/usr.bin/make/lst.lib/lstAppend.c +++ b/usr/src/usr.bin/make/lst.lib/lstAppend.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstAppend.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstAtEnd.c b/usr/src/usr.bin/make/lst.lib/lstAtEnd.c index 1ffe40ac2a..2110771f5c 100644 --- a/usr/src/usr.bin/make/lst.lib/lstAtEnd.c +++ b/usr/src/usr.bin/make/lst.lib/lstAtEnd.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstAtEnd.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstAtFront.c b/usr/src/usr.bin/make/lst.lib/lstAtFront.c index 5f93f27b80..7b05d63a81 100644 --- a/usr/src/usr.bin/make/lst.lib/lstAtFront.c +++ b/usr/src/usr.bin/make/lst.lib/lstAtFront.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstAtFront.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstClose.c b/usr/src/usr.bin/make/lst.lib/lstClose.c index ad84619e1f..3d4eabb1c9 100644 --- a/usr/src/usr.bin/make/lst.lib/lstClose.c +++ b/usr/src/usr.bin/make/lst.lib/lstClose.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstClose.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstConcat.c b/usr/src/usr.bin/make/lst.lib/lstConcat.c index d66daa8e00..5e975769b0 100644 --- a/usr/src/usr.bin/make/lst.lib/lstConcat.c +++ b/usr/src/usr.bin/make/lst.lib/lstConcat.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstConcat.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -76,6 +76,8 @@ Lst_Concat (l1, l2, flags) list2->firstPtr->prevPtr = list1->lastPtr; if (list1->lastPtr != NilListNode) { list1->lastPtr->nextPtr = list2->firstPtr; + } else { + list1->firstPtr = list2->firstPtr; } list1->lastPtr = list2->lastPtr; } diff --git a/usr/src/usr.bin/make/lst.lib/lstDatum.c b/usr/src/usr.bin/make/lst.lib/lstDatum.c index 2dee041d87..9e2e9c71c9 100644 --- a/usr/src/usr.bin/make/lst.lib/lstDatum.c +++ b/usr/src/usr.bin/make/lst.lib/lstDatum.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstDatum.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstDeQueue.c b/usr/src/usr.bin/make/lst.lib/lstDeQueue.c index ce66887f8b..3870c8fa84 100644 --- a/usr/src/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr/src/usr.bin/make/lst.lib/lstDeQueue.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstDeQueue.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstDestroy.c b/usr/src/usr.bin/make/lst.lib/lstDestroy.c index 58d73af181..8f00696ea2 100644 --- a/usr/src/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr/src/usr.bin/make/lst.lib/lstDestroy.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstDestroy.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -37,7 +37,7 @@ static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) %G%"; void Lst_Destroy (l, freeProc) Lst l; - register void (*freeProc)(); + register void (*freeProc) __P((ClientData)); { register ListNode ln; register ListNode tln = NilListNode; @@ -50,21 +50,25 @@ Lst_Destroy (l, freeProc) */ return; } - + + /* To ease scanning */ + if (list->lastPtr != NilListNode) + list->lastPtr->nextPtr = NilListNode; + else { + free ((Address)l); + return; + } + if (freeProc) { - for (ln = list->firstPtr; - ln != NilListNode && tln != list->firstPtr; - ln = tln) { - tln = ln->nextPtr; - (*freeProc) (ln->datum); - free ((Address)ln); + for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + tln = ln->nextPtr; + (*freeProc) (ln->datum); + free ((Address)ln); } } else { - for (ln = list->firstPtr; - ln != NilListNode && tln != list->firstPtr; - ln = tln) { - tln = ln->nextPtr; - free ((Address)ln); + for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + tln = ln->nextPtr; + free ((Address)ln); } } diff --git a/usr/src/usr.bin/make/lst.lib/lstDupl.c b/usr/src/usr.bin/make/lst.lib/lstDupl.c index f90f2f4cef..fa612a72be 100644 --- a/usr/src/usr.bin/make/lst.lib/lstDupl.c +++ b/usr/src/usr.bin/make/lst.lib/lstDupl.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstDupl.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -36,7 +36,8 @@ static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) %G%"; Lst Lst_Duplicate (l, copyProc) Lst l; /* the list to duplicate */ - ClientData (*copyProc)(); /* A function to duplicate each ClientData */ + /* A function to duplicate each ClientData */ + ClientData (*copyProc) __P((ClientData)); { register Lst nl; register ListNode ln; diff --git a/usr/src/usr.bin/make/lst.lib/lstEnQueue.c b/usr/src/usr.bin/make/lst.lib/lstEnQueue.c index 7e682967b8..c007ff1ab2 100644 --- a/usr/src/usr.bin/make/lst.lib/lstEnQueue.c +++ b/usr/src/usr.bin/make/lst.lib/lstEnQueue.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstEnQueue.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstFind.c b/usr/src/usr.bin/make/lst.lib/lstFind.c index 2542f265ce..a27eeb9d98 100644 --- a/usr/src/usr.bin/make/lst.lib/lstFind.c +++ b/usr/src/usr.bin/make/lst.lib/lstFind.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstFind.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -37,7 +37,7 @@ LstNode Lst_Find (l, d, cProc) Lst l; ClientData d; - int (*cProc)(); + int (*cProc) __P((ClientData, ClientData)); { return (Lst_FindFrom (l, Lst_First(l), d, cProc)); } diff --git a/usr/src/usr.bin/make/lst.lib/lstFindFrom.c b/usr/src/usr.bin/make/lst.lib/lstFindFrom.c index 050966e1ee..dd9755d750 100644 --- a/usr/src/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr/src/usr.bin/make/lst.lib/lstFindFrom.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstFindFrom.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -39,7 +39,7 @@ Lst_FindFrom (l, ln, d, cProc) Lst l; register LstNode ln; register ClientData d; - register int (*cProc)(); + register int (*cProc) __P((ClientData, ClientData)); { register ListNode tln; Boolean found = FALSE; diff --git a/usr/src/usr.bin/make/lst.lib/lstFirst.c b/usr/src/usr.bin/make/lst.lib/lstFirst.c index 72156ba947..25869c9ad0 100644 --- a/usr/src/usr.bin/make/lst.lib/lstFirst.c +++ b/usr/src/usr.bin/make/lst.lib/lstFirst.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstFirst.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstForEach.c b/usr/src/usr.bin/make/lst.lib/lstForEach.c index 544e2ce636..72dc1f7643 100644 --- a/usr/src/usr.bin/make/lst.lib/lstForEach.c +++ b/usr/src/usr.bin/make/lst.lib/lstForEach.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstForEach.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) %G%"; void Lst_ForEach (l, proc, d) Lst l; - register int (*proc)(); + register int (*proc) __P((ClientData, ClientData)); register ClientData d; { Lst_ForEachFrom(l, Lst_First(l), proc, d); diff --git a/usr/src/usr.bin/make/lst.lib/lstForEachFrom.c b/usr/src/usr.bin/make/lst.lib/lstForEachFrom.c index 7f79d6377c..3daac4f519 100644 --- a/usr/src/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr/src/usr.bin/make/lst.lib/lstForEachFrom.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstForEachFrom.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstInit.c b/usr/src/usr.bin/make/lst.lib/lstInit.c index e25552995d..b99f0f6bc6 100644 --- a/usr/src/usr.bin/make/lst.lib/lstInit.c +++ b/usr/src/usr.bin/make/lst.lib/lstInit.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstInit.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstInsert.c b/usr/src/usr.bin/make/lst.lib/lstInsert.c index e6ecdad4dd..42af1a82b4 100644 --- a/usr/src/usr.bin/make/lst.lib/lstInsert.c +++ b/usr/src/usr.bin/make/lst.lib/lstInsert.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstInsert.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c b/usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c index f2c6defced..c955b5ca1b 100644 --- a/usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c +++ b/usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstIsAtEnd.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstIsEmpty.c b/usr/src/usr.bin/make/lst.lib/lstIsEmpty.c index 153511cf92..1d1bfbde81 100644 --- a/usr/src/usr.bin/make/lst.lib/lstIsEmpty.c +++ b/usr/src/usr.bin/make/lst.lib/lstIsEmpty.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstIsEmpty.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstLast.c b/usr/src/usr.bin/make/lst.lib/lstLast.c index e71efbf521..bca8d9f8ab 100644 --- a/usr/src/usr.bin/make/lst.lib/lstLast.c +++ b/usr/src/usr.bin/make/lst.lib/lstLast.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstLast.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstMember.c b/usr/src/usr.bin/make/lst.lib/lstMember.c index 2662bf6099..8b1cee57a6 100644 --- a/usr/src/usr.bin/make/lst.lib/lstMember.c +++ b/usr/src/usr.bin/make/lst.lib/lstMember.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstMember.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstNext.c b/usr/src/usr.bin/make/lst.lib/lstNext.c index 1403d9c207..43f68c21bc 100644 --- a/usr/src/usr.bin/make/lst.lib/lstNext.c +++ b/usr/src/usr.bin/make/lst.lib/lstNext.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstNext.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstOpen.c b/usr/src/usr.bin/make/lst.lib/lstOpen.c index d02cad1834..49a1214198 100644 --- a/usr/src/usr.bin/make/lst.lib/lstOpen.c +++ b/usr/src/usr.bin/make/lst.lib/lstOpen.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstOpen.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstRemove.c b/usr/src/usr.bin/make/lst.lib/lstRemove.c index f790bfab99..1fda11b9f7 100644 --- a/usr/src/usr.bin/make/lst.lib/lstRemove.c +++ b/usr/src/usr.bin/make/lst.lib/lstRemove.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstRemove.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstReplace.c b/usr/src/usr.bin/make/lst.lib/lstReplace.c index b3d187254b..36d3030d40 100644 --- a/usr/src/usr.bin/make/lst.lib/lstReplace.c +++ b/usr/src/usr.bin/make/lst.lib/lstReplace.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstReplace.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- diff --git a/usr/src/usr.bin/make/lst.lib/lstSucc.c b/usr/src/usr.bin/make/lst.lib/lstSucc.c index a9d2d35b3e..a31d1e807d 100644 --- a/usr/src/usr.bin/make/lst.lib/lstSucc.c +++ b/usr/src/usr.bin/make/lst.lib/lstSucc.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)lstSucc.c 8.2 (Berkeley) %G%"; #endif /* not lint */ /*- -- 2.20.1