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): eliminate void pointer from MakeAddAllSrc



details:   https://anonhg.NetBSD.org/src/rev/cf1507ac1122
branches:  trunk
changeset: 956048:cf1507ac1122
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 19 19:45:50 2020 +0000

description:
make(1): eliminate void pointer from MakeAddAllSrc

diffstat:

 usr.bin/make/make.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r 320a0e2678c0 -r cf1507ac1122 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Mon Oct 19 19:34:18 2020 +0000
+++ b/usr.bin/make/make.c       Mon Oct 19 19:45:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.161 2020/10/18 14:58:45 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.161 2020/10/18 14:58:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.162 2020/10/19 19:45:50 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -763,16 +763,13 @@
  * modification times, the comparison is rather unfair...)..
  *
  * Input:
- *     cgnp            The child to add
- *     pgnp            The parent to whose ALLSRC variable it should
+ *     cgn             The child to add
+ *     pgn             The parent to whose ALLSRC variable it should
  *                     be added
  */
 static void
-MakeAddAllSrc(void *cgnp, void *pgnp)
+MakeAddAllSrc(GNode *cgn, GNode *pgn)
 {
-    GNode      *cgn = (GNode *)cgnp;
-    GNode      *pgn = (GNode *)pgnp;
-
     if (cgn->type & OP_MARK)
        return;
     cgn->type |= OP_MARK;
@@ -838,11 +835,14 @@
 void
 Make_DoAllVar(GNode *gn)
 {
+    GNodeListNode *ln;
+
     if (gn->flags & DONE_ALLSRC)
        return;
 
     UnmarkChildren(gn);
-    Lst_ForEach(gn->children, MakeAddAllSrc, gn);
+    for (ln = gn->children->first; ln != NULL; ln = ln->next)
+        MakeAddAllSrc(ln->datum, gn);
 
     if (!Var_Exists(OODATE, gn)) {
        Var_Set(OODATE, "", gn);



Home | Main Index | Thread Index | Old Index