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: remove unused Lst_Destroy



details:   https://anonhg.NetBSD.org/src/rev/ec8382910dbf
branches:  trunk
changeset: 959126:ec8382910dbf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 01 18:55:15 2021 +0000

description:
make: remove unused Lst_Destroy

The code in job.c that seemed to use it is inside an '#if 0' block.

diffstat:

 usr.bin/make/job.c |  14 +++++++-------
 usr.bin/make/lst.c |  15 ++-------------
 usr.bin/make/lst.h |   4 +---
 3 files changed, 10 insertions(+), 23 deletions(-)

diffs (89 lines):

diff -r 5b81c9712e28 -r ec8382910dbf usr.bin/make/job.c
--- a/usr.bin/make/job.c        Mon Feb 01 18:46:38 2021 +0000
+++ b/usr.bin/make/job.c        Mon Feb 01 18:55:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.409 2021/02/01 18:46:38 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.410 2021/02/01 18:55:15 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.409 2021/02/01 18:46:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.410 2021/02/01 18:55:15 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -1934,11 +1934,11 @@
         * Running these jobs in compat mode also guarantees that these
         * jobs do not overlap with other unrelated jobs.
         */
-       List *lst = Lst_New();
-       Lst_Append(lst, targ);
-       (void)Make_Run(lst);
-       Lst_Destroy(lst, NULL);
-       JobStart(targ, JOB_SPECIAL);
+       GNodeList lst = LST_INIT;
+       Lst_Append(&lst, targ);
+       (void)Make_Run(&lst);
+       Lst_Done(&lst);
+       JobStart(targ, TRUE);
        while (jobTokensRunning != 0) {
                Job_CatchOutput();
        }
diff -r 5b81c9712e28 -r ec8382910dbf usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Mon Feb 01 18:46:38 2021 +0000
+++ b/usr.bin/make/lst.c        Mon Feb 01 18:55:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.102 2020/12/30 10:03:16 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.103 2021/02/01 18:55:15 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.102 2020/12/30 10:03:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.103 2021/02/01 18:55:15 rillig Exp $");
 
 static ListNode *
 LstNodeNew(ListNode *prev, ListNode *next, void *datum)
@@ -89,17 +89,6 @@
        free(list);
 }
 
-/*
- * Destroy a list and free all its resources. The freeProc is called with the
- * datum from each node in turn before the node is freed.
- */
-void
-Lst_Destroy(List *list, LstFreeProc freeProc)
-{
-       Lst_DoneCall(list, freeProc);
-       free(list);
-}
-
 /* Insert a new node with the datum before the given node. */
 void
 Lst_InsertBefore(List *list, ListNode *ln, void *datum)
diff -r 5b81c9712e28 -r ec8382910dbf usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Mon Feb 01 18:46:38 2021 +0000
+++ b/usr.bin/make/lst.h        Mon Feb 01 18:55:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.95 2021/01/03 21:12:03 rillig Exp $  */
+/*     $NetBSD: lst.h,v 1.96 2021/02/01 18:55:15 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -111,8 +111,6 @@
 void Lst_DoneCall(List *, LstFreeProc);
 /* Free the list, leaving the node data unmodified. */
 void Lst_Free(List *);
-/* Free the list, freeing the node data using the given function. */
-void Lst_Destroy(List *, LstFreeProc);
 
 #define LST_INIT { NULL, NULL }
 



Home | Main Index | Thread Index | Old Index