upgraded to the latest NetBSD version
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sat, 29 Apr 1995 08:22:00 +0000 (00:22 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sat, 29 Apr 1995 08:22:00 +0000 (00:22 -0800)
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

26 files changed:
usr/src/usr.bin/make/lst.lib/lstAppend.c
usr/src/usr.bin/make/lst.lib/lstAtEnd.c
usr/src/usr.bin/make/lst.lib/lstAtFront.c
usr/src/usr.bin/make/lst.lib/lstClose.c
usr/src/usr.bin/make/lst.lib/lstConcat.c
usr/src/usr.bin/make/lst.lib/lstDatum.c
usr/src/usr.bin/make/lst.lib/lstDeQueue.c
usr/src/usr.bin/make/lst.lib/lstDestroy.c
usr/src/usr.bin/make/lst.lib/lstDupl.c
usr/src/usr.bin/make/lst.lib/lstEnQueue.c
usr/src/usr.bin/make/lst.lib/lstFind.c
usr/src/usr.bin/make/lst.lib/lstFindFrom.c
usr/src/usr.bin/make/lst.lib/lstFirst.c
usr/src/usr.bin/make/lst.lib/lstForEach.c
usr/src/usr.bin/make/lst.lib/lstForEachFrom.c
usr/src/usr.bin/make/lst.lib/lstInit.c
usr/src/usr.bin/make/lst.lib/lstInsert.c
usr/src/usr.bin/make/lst.lib/lstIsAtEnd.c
usr/src/usr.bin/make/lst.lib/lstIsEmpty.c
usr/src/usr.bin/make/lst.lib/lstLast.c
usr/src/usr.bin/make/lst.lib/lstMember.c
usr/src/usr.bin/make/lst.lib/lstNext.c
usr/src/usr.bin/make/lst.lib/lstOpen.c
usr/src/usr.bin/make/lst.lib/lstRemove.c
usr/src/usr.bin/make/lst.lib/lstReplace.c
usr/src/usr.bin/make/lst.lib/lstSucc.c

index 23e9835..cb9175f 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstAppend.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAppend.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 1ffe40a..2110771 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAtEnd.c 8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 5f93f27..7b05d63 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstAtFront.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAtFront.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index ad84619..3d4eabb 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstClose.c 8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index d66daa8..5e97576 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstConcat.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstConcat.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #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;
            list2->firstPtr->prevPtr = list1->lastPtr;
            if (list1->lastPtr != NilListNode) {
                list1->lastPtr->nextPtr = list2->firstPtr;
+           } else {
+               list1->firstPtr = list2->firstPtr;
            }
            list1->lastPtr = list2->lastPtr;
        }
            }
            list1->lastPtr = list2->lastPtr;
        }
index 2dee041..9e2e9c7 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDatum.c 8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index ce66887..3870c8f 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstDeQueue.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDeQueue.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 58d73af..8f00696 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstDestroy.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDestroy.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -37,7 +37,7 @@ static char sccsid[] = "@(#)lstDestroy.c      8.1 (Berkeley) %G%";
 void
 Lst_Destroy (l, freeProc)
     Lst                        l;
 void
 Lst_Destroy (l, freeProc)
     Lst                        l;
-    register void      (*freeProc)();
+    register void      (*freeProc) __P((ClientData));
 {
     register ListNode  ln;
     register ListNode  tln = NilListNode;
 {
     register ListNode  ln;
     register ListNode  tln = NilListNode;
@@ -50,21 +50,25 @@ Lst_Destroy (l, freeProc)
         */
        return;
     }
         */
        return;
     }
-    
+
+    /* To ease scanning */
+    if (list->lastPtr != NilListNode)
+       list->lastPtr->nextPtr = NilListNode;
+    else {
+       free ((Address)l);
+       return;
+    }
+
     if (freeProc) {
     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 {
        }
     } 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);
        }
     }
     
        }
     }
     
index f90f2f4..fa612a7 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstDupl.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDupl.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #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 */
 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;
 {
     register Lst       nl;
     register ListNode          ln;
index 7e68296..c007ff1 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstEnQueue.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstEnQueue.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 2542f26..a27eeb9 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstFind.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFind.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -37,7 +37,7 @@ LstNode
 Lst_Find (l, d, cProc)
     Lst                l;
     ClientData d;
 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));
 }
 {
     return (Lst_FindFrom (l, Lst_First(l), d, cProc));
 }
index 050966e..dd9755d 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstFindFrom.c      8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFindFrom.c      8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -39,7 +39,7 @@ Lst_FindFrom (l, ln, d, cProc)
     Lst                        l;
     register LstNode    ln;
     register ClientData d;
     Lst                        l;
     register LstNode    ln;
     register ClientData d;
-    register int       (*cProc)();
+    register int       (*cProc) __P((ClientData, ClientData));
 {
     register ListNode  tln;
     Boolean            found = FALSE;
 {
     register ListNode  tln;
     Boolean            found = FALSE;
index 72156ba..25869c9 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFirst.c 8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 544e2ce..72dc1f7 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstForEach.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstForEach.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)lstForEach.c      8.1 (Berkeley) %G%";
 void
 Lst_ForEach (l, proc, d)
     Lst                        l;
 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);
     register ClientData        d;
 {
     Lst_ForEachFrom(l, Lst_First(l), proc, d);
index 7f79d63..3daac4f 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstForEachFrom.c   8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstForEachFrom.c   8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index e255529..b99f0f6 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstInit.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstInit.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index e6ecdad..42af1a8 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstInsert.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstInsert.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index f2c6def..c955b5c 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstIsAtEnd.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstIsAtEnd.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 153511c..1d1bfbd 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstIsEmpty.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstIsEmpty.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index e71efbf..bca8d9f 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstLast.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstLast.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 2662bf6..8b1cee5 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstMember.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstMember.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index 1403d9c..43f68c2 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstNext.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstNext.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index d02cad1..49a1214 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstOpen.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstOpen.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index f790bfa..1fda11b 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstRemove.c        8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstRemove.c        8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index b3d1872..36d3030 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstReplace.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstReplace.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-
index a9d2d35..a31d1e8 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lstSucc.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstSucc.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*-
 #endif /* not lint */
 
 /*-