Module Name:    src
Committed By:   rillig
Date:           Fri Sep 25 23:35:25 UTC 2020

Modified Files:
        src/usr.bin/make: parse.c
        src/usr.bin/make/unit-tests: deptgt.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 src/usr.bin/make/parse.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/deptgt.mk

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/parse.c
diff -u src/usr.bin/make/parse.c:1.328 src/usr.bin/make/parse.c:1.329
--- src/usr.bin/make/parse.c:1.328	Fri Sep 25 23:30:16 2020
+++ src/usr.bin/make/parse.c	Fri Sep 25 23:35:25 2020
@@ -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 @@ SuffEndTransform(void *target, void *unu
     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 @@ Parse_File(const char *name, int fd)
 	    }
 #endif
 	    if (Parse_IsVar(line)) {
-		ParseFinishLine();
+		FinishDependencyGroup();
 		Parse_DoVar(line, VAR_GLOBAL);
 		continue;
 	    }
@@ -3033,7 +3020,7 @@ Parse_File(const char *name, int fd)
 		}
 	    }
 #endif
-	    ParseFinishLine();
+	    FinishDependencyGroup();
 
 	    /*
 	     * For some reason - probably to make the parser impossible -
@@ -3129,7 +3116,7 @@ Parse_File(const char *name, int fd)
 	 */
     } while (ParseEOF() == CONTINUE);
 
-    ParseFinishLine();
+    FinishDependencyGroup();
 
     if (fatals) {
 	(void)fflush(stdout);

Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.5 src/usr.bin/make/unit-tests/deptgt.mk:1.6
--- src/usr.bin/make/unit-tests/deptgt.mk:1.5	Mon Sep 14 18:27:15 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk	Fri Sep 25 23:35:25 2020
@@ -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"

Reply via email to