Module Name: src Committed By: rillig Date: Thu Sep 24 07:34:35 UTC 2020
Modified Files: src/usr.bin/make: make.c Log Message: make(1): migrate MakeAddAllSrc to Lst_ForEach To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/make.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/make.c diff -u src/usr.bin/make/make.c:1.141 src/usr.bin/make/make.c:1.142 --- src/usr.bin/make/make.c:1.141 Thu Sep 24 07:32:03 2020 +++ src/usr.bin/make/make.c Thu Sep 24 07:34:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.141 2020/09/24 07:32:03 rillig Exp $ */ +/* $NetBSD: make.c,v 1.142 2020/09/24 07:34:35 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.141 2020/09/24 07:32:03 rillig Exp $"); +MAKE_RCSID("$NetBSD: make.c,v 1.142 2020/09/24 07:34:35 rillig Exp $"); static unsigned int checked = 1;/* Sequence # to detect recursion */ static GNodeList *toBeMade; /* The current fringe of the graph. These @@ -119,7 +119,6 @@ static GNodeList *toBeMade; /* The curre static int MakeAddChild(void *, void *); static int MakeFindChild(void *, void *); static int MakeUnmark(void *, void *); -static int MakeAddAllSrc(void *, void *); static int MakeTimeStamp(void *, void *); static int MakeHandleUse(void *, void *); static Boolean MakeStartJobs(void); @@ -871,21 +870,18 @@ MakeUnmark(void *cgnp, void *pgnp MAKE_A * pgnp The parent to whose ALLSRC variable it should * be added * - * Results: - * Always returns 0 - * * Side Effects: * The ALLSRC variable for the given node is extended. *----------------------------------------------------------------------- */ -static int +static void MakeAddAllSrc(void *cgnp, void *pgnp) { GNode *cgn = (GNode *)cgnp; GNode *pgn = (GNode *)pgnp; if (cgn->type & OP_MARK) - return 0; + return; cgn->type |= OP_MARK; if ((cgn->type & (OP_EXEC|OP_USE|OP_USEBEFORE|OP_INVISIBLE)) == 0) { @@ -931,7 +927,6 @@ MakeAddAllSrc(void *cgnp, void *pgnp) } bmake_free(p1); } - return 0; } /*- @@ -963,7 +958,7 @@ Make_DoAllVar(GNode *gn) return; Lst_ForEachUntil(gn->children, MakeUnmark, gn); - Lst_ForEachUntil(gn->children, MakeAddAllSrc, gn); + Lst_ForEach(gn->children, MakeAddAllSrc, gn); if (!Var_Exists (OODATE, gn)) { Var_Set(OODATE, "", gn); @@ -1043,7 +1038,7 @@ MakeBuildChild(void *v_cn, void *toBeMad Lst_ForEachUntil(cn->cohorts, MakeBuildChild, toBeMade_next); /* - * If this node is a .WAIT node with unmade chlidren + * If this node is a .WAIT node with unmade children * then don't add the next sibling. */ return cn->type & OP_WAIT && cn->unmade > 0;