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 ParseFinishLine to FinishDepend...



details:   https://anonhg.NetBSD.org/src/rev/4f09011b9126
branches:  trunk
changeset: 944293:4f09011b9126
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 25 23:35:25 2020 +0000

description:
make(1): rename ParseFinishLine to FinishDependencyGroup

Even after 27 or more years, it's not too late to fix bad function
names.  This one for example does not finish a line but a dependency
group.

diffstat:

 usr.bin/make/parse.c              |  25 ++++++-------------------
 usr.bin/make/unit-tests/deptgt.mk |   4 ++--
 2 files changed, 8 insertions(+), 21 deletions(-)

diffs (86 lines):

diff -r 81a40a238a4c -r 4f09011b9126 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Sep 25 23:30:16 2020 +0000
+++ b/usr.bin/make/parse.c      Fri Sep 25 23:35:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.328 2020/09/25 23:30:16 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.329 2020/09/25 23:35:25 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.328 2020/09/25 23:30:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.329 2020/09/25 23:35:25 rillig Exp $");
 
 /* types and constants */
 
@@ -2846,21 +2846,8 @@
     return 0;
 }
 
-/*-
- *-----------------------------------------------------------------------
- * ParseFinishLine --
- *     Handle the end of a dependency group.
- *
- * Results:
- *     Nothing.
- *
- * Side Effects:
- *     inLine set FALSE. 'targets' list destroyed.
- *
- *-----------------------------------------------------------------------
- */
 static void
-ParseFinishLine(void)
+FinishDependencyGroup(void)
 {
     if (inLine) {
        if (targets != NULL) {
@@ -3003,7 +2990,7 @@
            }
 #endif
            if (Parse_IsVar(line)) {
-               ParseFinishLine();
+               FinishDependencyGroup();
                Parse_DoVar(line, VAR_GLOBAL);
                continue;
            }
@@ -3033,7 +3020,7 @@
                }
            }
 #endif
-           ParseFinishLine();
+           FinishDependencyGroup();
 
            /*
             * For some reason - probably to make the parser impossible -
@@ -3129,7 +3116,7 @@
         */
     } while (ParseEOF() == CONTINUE);
 
-    ParseFinishLine();
+    FinishDependencyGroup();
 
     if (fatals) {
        (void)fflush(stdout);
diff -r 81a40a238a4c -r 4f09011b9126 usr.bin/make/unit-tests/deptgt.mk
--- a/usr.bin/make/unit-tests/deptgt.mk Fri Sep 25 23:30:16 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt.mk Fri Sep 25 23:35:25 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.5 2020/09/14 18:27:15 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.6 2020/09/25 23:35:25 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
@@ -13,7 +13,7 @@
 # parsing of dependencies.  To see it in action, set breakpoints in:
 #
 #      ParseDoDependency       at the beginning
-#      ParseFinishLine         at "targets = NULL"
+#      FinishDependencyGroup   at "targets = NULL"
 #      Parse_File              at "Lst_Free(targets)"
 #      Parse_File              at "targets = Lst_Init()"
 #      Parse_File              at "!inLine"



Home | Main Index | Thread Index | Old Index