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): migrate MakeTimeStamp and MakeUnmark t...



details:   https://anonhg.NetBSD.org/src/rev/fd7c7ce58bba
branches:  trunk
changeset: 955224:fd7c7ce58bba
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Sep 24 07:37:42 2020 +0000

description:
make(1): migrate MakeTimeStamp and MakeUnmark to Lst_ForEach

diffstat:

 usr.bin/make/make.c |  25 +++++++++----------------
 usr.bin/make/make.h |   4 ++--
 2 files changed, 11 insertions(+), 18 deletions(-)

diffs (123 lines):

diff -r 4373cf075d59 -r fd7c7ce58bba usr.bin/make/make.c
--- a/usr.bin/make/make.c       Thu Sep 24 07:34:35 2020 +0000
+++ b/usr.bin/make/make.c       Thu Sep 24 07:37:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.142 2020/09/24 07:34:35 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.143 2020/09/24 07:37:42 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.142 2020/09/24 07:34:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.143 2020/09/24 07:37:42 rillig Exp $");
 
 static unsigned int checked = 1;/* Sequence # to detect recursion */
 static GNodeList *toBeMade;    /* The current fringe of the graph. These
@@ -118,8 +118,6 @@
 
 static int MakeAddChild(void *, void *);
 static int MakeFindChild(void *, void *);
-static int MakeUnmark(void *, void *);
-static int MakeTimeStamp(void *, void *);
 static int MakeHandleUse(void *, void *);
 static Boolean MakeStartJobs(void);
 static int MakePrintStatus(void *, void *);
@@ -184,21 +182,17 @@
  *     pgn             the current parent
  *     cgn             the child we've just examined
  *
- * Results:
- *     Always returns 0.
- *
  * Side Effects:
  *     The cmgn of the parent node will be changed if the mtime
  *     field of the child is greater than it.
  *-----------------------------------------------------------------------
  */
-int
+void
 Make_TimeStamp(GNode *pgn, GNode *cgn)
 {
     if (pgn->cmgn == NULL || cgn->mtime > pgn->cmgn->mtime) {
        pgn->cmgn = cgn;
     }
-    return 0;
 }
 
 /*
@@ -207,10 +201,10 @@
  *     cgn             the child we've just examined
  *
  */
-static int
+static void
 MakeTimeStamp(void *pgn, void *cgn)
 {
-    return Make_TimeStamp((GNode *)pgn, (GNode *)cgn);
+    Make_TimeStamp(pgn, cgn);
 }
 
 /*-
@@ -368,7 +362,7 @@
      * thinking they're out-of-date.
      */
     if (!oodate) {
-       Lst_ForEachUntil(gn->parents, MakeTimeStamp, gn);
+       Lst_ForEach(gn->parents, MakeTimeStamp, gn);
     }
 
     return oodate;
@@ -841,13 +835,12 @@
     }
 }
 
-static int
+static void
 MakeUnmark(void *cgnp, void *pgnp MAKE_ATTR_UNUSED)
 {
     GNode      *cgn = (GNode *)cgnp;
 
     cgn->type &= ~OP_MARK;
-    return 0;
 }
 
 /*-
@@ -957,7 +950,7 @@
     if (gn->flags & DONE_ALLSRC)
        return;
 
-    Lst_ForEachUntil(gn->children, MakeUnmark, gn);
+    Lst_ForEach(gn->children, MakeUnmark, gn);
     Lst_ForEach(gn->children, MakeAddAllSrc, gn);
 
     if (!Var_Exists (OODATE, gn)) {
@@ -1322,7 +1315,7 @@
 
        (void)Dir_MTime(gn, 0);
        Var_Set(TARGET, gn->path ? gn->path : gn->name, gn);
-       Lst_ForEachUntil(gn->children, MakeUnmark, gn);
+       Lst_ForEach(gn->children, MakeUnmark, gn);
        Lst_ForEachUntil(gn->children, MakeHandleUse, gn);
 
        if ((gn->type & OP_MADE) == 0)
diff -r 4373cf075d59 -r fd7c7ce58bba usr.bin/make/make.h
--- a/usr.bin/make/make.h       Thu Sep 24 07:34:35 2020 +0000
+++ b/usr.bin/make/make.h       Thu Sep 24 07:37:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.145 2020/09/23 03:06:38 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.146 2020/09/24 07:37:42 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -535,7 +535,7 @@
 
 #include "nonints.h"
 
-int Make_TimeStamp(GNode *, GNode *);
+void Make_TimeStamp(GNode *, GNode *);
 Boolean Make_OODate(GNode *);
 void Make_ExpandUse(GNodeList *);
 time_t Make_Recheck(GNode *);



Home | Main Index | Thread Index | Old Index