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(1): rename Lst_Memeber to Lst_FindDatum



details:   https://anonhg.NetBSD.org/src/rev/e1274fb32a32
branches:  trunk
changeset: 943299:e1274fb32a32
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 30 11:12:05 2020 +0000

description:
make(1): rename Lst_Memeber to Lst_FindDatum

The new name nicely aligns with Lst_Find and Lst_FindFrom.

diffstat:

 usr.bin/make/compat.c |  12 ++++++------
 usr.bin/make/dir.c    |  14 +++++++-------
 usr.bin/make/job.c    |   8 ++++----
 usr.bin/make/lst.c    |   8 ++++----
 usr.bin/make/lst.h    |   9 +++------
 usr.bin/make/make.c   |   8 ++++----
 usr.bin/make/suff.c   |  20 ++++++++++----------
 7 files changed, 38 insertions(+), 41 deletions(-)

diffs (truncated from 329 to 300 lines):

diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/compat.c
--- a/usr.bin/make/compat.c     Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/compat.c     Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.135 2020/08/29 14:47:26 rillig Exp $      */
+/*     $NetBSD: compat.c,v 1.136 2020/08/30 11:12:05 rillig Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.135 2020/08/29 14:47:26 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.136 2020/08/30 11:12:05 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c   8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.135 2020/08/29 14:47:26 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.136 2020/08/30 11:12:05 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -220,7 +220,7 @@
     errCheck = !(gn->type & OP_IGNORE);
     doIt = FALSE;
 
-    cmdNode = Lst_Member(gn->commands, cmd);
+    cmdNode = Lst_FindDatum(gn->commands, cmd);
     cmdStart = Var_Subst(cmd, gn, VARE_WANTRES);
 
     /*
@@ -529,7 +529,7 @@
            goto cohorts;
        }
 
-       if (Lst_Member(gn->iParents, pgn) != NULL) {
+       if (Lst_FindDatum(gn->iParents, pgn) != NULL) {
            char *p1;
            Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn);
            bmake_free(p1);
@@ -633,7 +633,7 @@
         */
        pgn->flags &= ~(unsigned)REMAKE;
     } else {
-       if (Lst_Member(gn->iParents, pgn) != NULL) {
+       if (Lst_FindDatum(gn->iParents, pgn) != NULL) {
            char *p1;
            const char *target = Var_Value(TARGET, gn, &p1);
            Var_Set(IMPSRC, target != NULL ? target : "", pgn);
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.124 2020/08/29 12:39:32 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.125 2020/08/30 11:12:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.124 2020/08/29 12:39:32 rillig Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.125 2020/08/30 11:12:05 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c      8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.124 2020/08/29 12:39:32 rillig Exp $");
+__RCSID("$NetBSD: dir.c,v 1.125 2020/08/30 11:12:05 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -406,7 +406,7 @@
        LstNode ln;
 
        /* Remove old entry from openDirectories, but do not destroy. */
-       ln = Lst_Member(openDirectories, dot);
+       ln = Lst_FindDatum(openDirectories, dot);
        Lst_Remove(openDirectories, ln);
     }
 
@@ -1533,7 +1533,7 @@
        ln = Lst_Find(openDirectories, DirFindName, name);
     if (ln != NULL) {
        p = Lst_Datum(ln);
-       if (Lst_Member(path, p) == NULL) {
+       if (Lst_FindDatum(path, p) == NULL) {
            p->refCount += 1;
            Lst_Append(path, p);
        }
@@ -1659,7 +1659,7 @@
     if (p->refCount == 0) {
        LstNode ln;
 
-       ln = Lst_Member(openDirectories, p);
+       ln = Lst_FindDatum(openDirectories, p);
        Lst_Remove(openDirectories, ln);
 
        Hash_DeleteTable(&p->files);
@@ -1721,7 +1721,7 @@
 
     for (ln = Lst_First(path2); ln != NULL; ln = LstNode_Next(ln)) {
        p = Lst_Datum(ln);
-       if (Lst_Member(path1, p) == NULL) {
+       if (Lst_FindDatum(path1, p) == NULL) {
            p->refCount += 1;
            Lst_Append(path1, p);
        }
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/job.c        Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.224 2020/08/29 12:20:17 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.225 2020/08/30 11:12:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.224 2020/08/29 12:20:17 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.225 2020/08/30 11:12:05 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.224 2020/08/29 12:20:17 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.225 2020/08/30 11:12:05 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -708,7 +708,7 @@
     if (strcmp(cmd, "...") == 0) {
        job->node->type |= OP_SAVE_CMDS;
        if ((job->flags & JOB_IGNDOTS) == 0) {
-           LstNode dotsNode = Lst_Member(job->node->commands, cmd);
+           LstNode dotsNode = Lst_FindDatum(job->node->commands, cmd);
            job->tailCmds = dotsNode != NULL ? LstNode_Next(dotsNode) : NULL;
            return 1;
        }
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/lst.c        Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.57 2020/08/30 11:12:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -37,11 +37,11 @@
 #include "make.h"
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.57 2020/08/30 11:12:05 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.56 2020/08/29 10:41:12 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.57 2020/08/30 11:12:05 rillig Exp $");
 #endif /* not lint */
 #endif
 
@@ -406,7 +406,7 @@
 
 /* Return the first node that contains the given datum, or NULL. */
 LstNode
-Lst_Member(Lst list, void *datum)
+Lst_FindDatum(Lst list, const void *datum)
 {
     LstNode node;
 
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/lst.h        Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.57 2020/08/29 10:41:12 rillig Exp $  */
+/*     $NetBSD: lst.h,v 1.58 2020/08/30 11:12:06 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -148,11 +148,8 @@
 LstNode                Lst_Find(Lst, LstFindProc, const void *);
 /* Find an element starting from somewhere */
 LstNode                Lst_FindFrom(Lst, LstNode, LstFindProc, const void *);
-/*
- * See if the given datum is on the list. Returns the LstNode containing
- * the datum
- */
-LstNode                Lst_Member(Lst, void *);
+/* Return the first node that contains the given datum, or NULL. */
+LstNode                Lst_FindDatum(Lst, const void *);
 /* Apply a function to all elements of a lst */
 int            Lst_ForEach(Lst, LstActionProc, void *);
 /* Apply a function to all elements of a lst starting from a certain point. */
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/make.c       Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.130 2020/08/29 13:16:54 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.131 2020/08/30 11:12:06 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.130 2020/08/29 13:16:54 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.131 2020/08/30 11:12:06 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)make.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: make.c,v 1.130 2020/08/29 13:16:54 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.131 2020/08/30 11:12:06 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -561,7 +561,7 @@
      * children the parent has. This is used by Make_Run to decide
      * whether to queue the parent or examine its children...
      */
-    if ((ln = Lst_Member(pgn->children, cgn)) != NULL) {
+    if ((ln = Lst_FindDatum(pgn->children, cgn)) != NULL) {
        Lst_Remove(pgn->children, ln);
        pgn->unmade--;
     }
diff -r d8f7acc837f3 -r e1274fb32a32 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sun Aug 30 07:09:02 2020 +0000
+++ b/usr.bin/make/suff.c       Sun Aug 30 11:12:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.136 2020/08/29 13:38:48 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.137 2020/08/30 11:12:06 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.136 2020/08/29 13:38:48 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.137 2020/08/30 11:12:06 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c     8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.136 2020/08/29 13:38:48 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.137 2020/08/30 11:12:06 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -330,7 +330,7 @@
 {
     Lst l = (Lst) lp;
 
-    LstNode ln = Lst_Member(l, sp);
+    LstNode ln = Lst_FindDatum(l, sp);
     if (ln != NULL) {
        Lst_Remove(l, ln);
        ((Suff *)sp)->refCount--;
@@ -1052,7 +1052,7 @@
                free(s->pref);
            else {
 #ifdef DEBUG_SRC
-               LstNode ln2 = Lst_Member(s->parent->cp, s);
+               LstNode ln2 = Lst_FindDatum(s->parent->cp, s);
                if (ln2 != NULL)
                    Lst_Remove(s->parent->cp, ln2);
 #endif
@@ -1209,7 +1209,7 @@
 
        /* XXX: Can targ->suff be NULL here? */
        if (targ->suff != NULL &&
-           Lst_Member(suff->parents, targ->suff) != NULL)
+           Lst_FindDatum(suff->parents, targ->suff) != NULL)
            break;
     }
 
@@ -1395,7 +1395,7 @@
      */
     pgn->unmade--;
     Lst_Remove(pgn->children, cln);
-    Lst_Remove(cgn->parents, Lst_Member(cgn->parents, pgn));
+    Lst_Remove(cgn->parents, Lst_FindDatum(cgn->parents, pgn));
 }



Home | Main Index | Thread Index | Old Index