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): replace a few Lst_ForEachUntil with si...



details:   https://anonhg.NetBSD.org/src/rev/c1656289cde1
branches:  trunk
changeset: 944296:c1656289cde1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 26 00:03:29 2020 +0000

description:
make(1): replace a few Lst_ForEachUntil with simpler Lst_ForEach

diffstat:

 usr.bin/make/parse.c |  55 +++++++++++----------------------------------------
 1 files changed, 12 insertions(+), 43 deletions(-)

diffs (141 lines):

diff -r 354e740ecd4c -r c1656289cde1 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Sep 25 23:42:43 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Sep 26 00:03:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.330 2020/09/25 23:39:51 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.331 2020/09/26 00:03:29 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.330 2020/09/25 23:39:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.331 2020/09/26 00:03:29 rillig Exp $");
 
 /* types and constants */
 
@@ -793,7 +793,7 @@
  * Add the parent to the child's parents, but only if the target is not
  * special.  An example for such a special target is .END, which does not
  * need to be informed once the child target has been made. */
-static int
+static void
 ParseLinkSrc(void *pgnp, void *data)
 {
     const struct ParseLinkSrcArgs *args = data;
@@ -815,8 +815,6 @@
        Targ_PrintNode(pgn, 0);
        Targ_PrintNode(cgn, 0);
     }
-
-    return 0;
 }
 
 /*-
@@ -954,7 +952,7 @@
                gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN;
                if (targets != NULL) {
                    struct ParseLinkSrcArgs args = { gn, specType };
-                   Lst_ForEachUntil(targets, ParseLinkSrc, &args);
+                   Lst_ForEach(targets, ParseLinkSrc, &args);
                }
                return;
            }
@@ -1025,7 +1023,7 @@
        } else {
            if (targets != NULL) {
                struct ParseLinkSrcArgs args = { gn, specType };
-               Lst_ForEachUntil(targets, ParseLinkSrc, &args);
+               Lst_ForEach(targets, ParseLinkSrc, &args);
            }
        }
        break;
@@ -1063,44 +1061,16 @@
     }
 }
 
-/*-
- *-----------------------------------------------------------------------
- * ParseAddDir --
- *     Front-end for Dir_AddDir to make sure Lst_ForEachUntil keeps going
- *
- * Results:
- *     === 0
- *
- * Side Effects:
- *     See Dir_AddDir.
- *
- *-----------------------------------------------------------------------
- */
-static int
+static void
 ParseAddDir(void *path, void *name)
 {
     (void)Dir_AddDir(path, name);
-    return 0;
 }
 
-/*-
- *-----------------------------------------------------------------------
- * ParseClearPath --
- *     Front-end for Dir_ClearPath to make sure Lst_ForEachUntil keeps going
- *
- * Results:
- *     === 0
- *
- * Side Effects:
- *     See Dir_ClearPath
- *
- *-----------------------------------------------------------------------
- */
-static int
-ParseClearPath(void *path, void *dummy MAKE_ATTR_UNUSED)
+static void
+ParseClearPath(void *path, void *unused MAKE_ATTR_UNUSED)
 {
     Dir_ClearPath(path);
-    return 0;
 }
 
 /*
@@ -1561,7 +1531,7 @@
                break;
            case ExPath:
                if (paths != NULL)
-                   Lst_ForEachUntil(paths, ParseClearPath, NULL);
+                   Lst_ForEach(paths, ParseClearPath, NULL);
                Dir_SetPATH();
                break;
 #ifdef POSIX
@@ -1637,7 +1607,7 @@
                    break;
                case ExPath:
                    if (paths != NULL)
-                       Lst_ForEachUntil(paths, ParseAddDir, line);
+                       Lst_ForEach(paths, ParseAddDir, line);
                    break;
                case Includes:
                    Suff_AddInclude(line);
@@ -2836,18 +2806,17 @@
     }
 }
 
-static int
+static void
 SuffEndTransform(void *target, void *unused MAKE_ATTR_UNUSED)
 {
     Suff_EndTransform(target);
-    return 0;
 }
 
 static void
 FinishDependencyGroup(void)
 {
     if (targets != NULL) {
-       Lst_ForEachUntil(targets, SuffEndTransform, NULL);
+       Lst_ForEach(targets, SuffEndTransform, NULL);
        Lst_Destroy(targets, ParseHasCommands);
     }
     targets = NULL;



Home | Main Index | Thread Index | Old Index