Module Name:    src
Committed By:   rillig
Date:           Sat Oct 17 21:32:31 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c dir.c job.c nonints.h parse.c suff.c targ.c
            var.c

Log Message:
make(1): normalize initialization and cleanup of the modules


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/usr.bin/make/arch.c
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/make/dir.c
cvs rdiff -u -r1.262 -r1.263 src/usr.bin/make/job.c
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.382 -r1.383 src/usr.bin/make/parse.c
cvs rdiff -u -r1.178 -r1.179 src/usr.bin/make/suff.c
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/make/targ.c
cvs rdiff -u -r1.571 -r1.572 src/usr.bin/make/var.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/arch.c
diff -u src/usr.bin/make/arch.c:1.132 src/usr.bin/make/arch.c:1.133
--- src/usr.bin/make/arch.c:1.132	Mon Oct  5 19:27:47 2020
+++ src/usr.bin/make/arch.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.132 2020/10/05 19:27:47 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.133 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
  *
  *	Arch_Init	Initialize this module.
  *
- *	Arch_End	Cleanup this module.
+ *	Arch_End	Clean up this module.
  */
 
 #include    <sys/types.h>
@@ -130,7 +130,7 @@
 #include    "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.132 2020/10/05 19:27:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.133 2020/10/17 21:32:30 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -1123,14 +1123,14 @@ Arch_LibOODate(GNode *gn)
     return oodate;
 }
 
-/* Initialize things for this module. */
+/* Initialize the archives module. */
 void
 Arch_Init(void)
 {
     archives = Lst_Init();
 }
 
-/* Clean up things for this module. */
+/* Clean up the archives module. */
 void
 Arch_End(void)
 {

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.162 src/usr.bin/make/dir.c:1.163
--- src/usr.bin/make/dir.c:1.162	Sat Oct 17 17:47:14 2020
+++ src/usr.bin/make/dir.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.162 2020/10/17 17:47:14 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.163 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -82,7 +82,7 @@
  *
  *	Dir_InitDot	Set the dot CachedDir.
  *
- *	Dir_End		Cleanup the module.
+ *	Dir_End		Clean up the module.
  *
  *	Dir_SetPATH	Set ${.PATH} to reflect state of dirSearchPath.
  *
@@ -135,7 +135,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.162 2020/10/17 17:47:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.163 2020/10/17 21:32:30 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -388,7 +388,7 @@ cached_lstat(const char *pathname, struc
     return cached_stats(&lmtimes, pathname, st, CST_LSTAT);
 }
 
-/* Initialize things for this module. */
+/* Initialize the directories module. */
 void
 Dir_Init(void)
 {
@@ -427,7 +427,7 @@ Dir_InitCur(const char *cdname)
 	    dir->refCount++;
 	    if (cur && cur != dir) {
 		/*
-		 * We've been here before, cleanup.
+		 * We've been here before, clean up.
 		 */
 		cur->refCount--;
 		Dir_Destroy(cur);
@@ -462,7 +462,7 @@ Dir_InitDot(void)
     Dir_SetPATH();		/* initialize */
 }
 
-/* Clean up things for this module. */
+/* Clean up the directories module. */
 void
 Dir_End(void)
 {

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.262 src/usr.bin/make/job.c:1.263
--- src/usr.bin/make/job.c:1.262	Tue Oct  6 16:39:23 2020
+++ src/usr.bin/make/job.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.262 2020/10/06 16:39:23 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.263 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -97,7 +97,7 @@
  *			Hence, the makefile must have been parsed
  *			before this function is called.
  *
- *	Job_End		Cleanup any memory used.
+ *	Job_End		Clean up any memory used.
  *
  *	Job_ParseShell	Given the line following a .SHELL target, parse
  *			the line as a shell specification. Returns
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.262 2020/10/06 16:39:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.263 2020/10/17 21:32:30 rillig Exp $");
 
 # define STATIC static
 

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.140 src/usr.bin/make/nonints.h:1.141
--- src/usr.bin/make/nonints.h:1.140	Mon Oct  5 19:27:47 2020
+++ src/usr.bin/make/nonints.h	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.140 2020/10/05 19:27:47 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.141 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -73,6 +73,9 @@
  */
 
 /* arch.c */
+void Arch_Init(void);
+void Arch_End(void);
+
 Boolean Arch_ParseArchive(char **, GNodeList *, GNode *);
 void Arch_Touch(GNode *);
 void Arch_TouchLib(GNode *);
@@ -80,8 +83,6 @@ time_t Arch_MTime(GNode *);
 time_t Arch_MemMTime(GNode *);
 void Arch_FindLib(GNode *, SearchPath *);
 Boolean Arch_LibOODate(GNode *);
-void Arch_Init(void);
-void Arch_End(void);
 Boolean Arch_IsLib(GNode *);
 
 /* compat.c */
@@ -120,6 +121,8 @@ Boolean getBoolean(const char *, Boolean
 char *cached_realpath(const char *, char *);
 
 /* parse.c */
+void Parse_Init(void);
+void Parse_End(void);
 
 typedef enum VarAssignOp {
     VAR_NORMAL,			/* = */
@@ -143,8 +146,6 @@ Boolean Parse_IsVar(const char *, VarAss
 void Parse_DoVar(VarAssign *, GNode *);
 void Parse_AddIncludeDir(const char *);
 void Parse_File(const char *, int);
-void Parse_Init(void);
-void Parse_End(void);
 void Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *);
 GNodeList *Parse_MainName(void);
 
@@ -168,6 +169,9 @@ char *str_concat4(const char *, const ch
 Boolean Str_Match(const char *, const char *);
 
 /* suff.c */
+void Suff_Init(void);
+void Suff_End(void);
+
 void Suff_ClearSuffixes(void);
 Boolean Suff_IsTransform(const char *);
 GNode *Suff_AddTransform(const char *);
@@ -180,13 +184,12 @@ void Suff_AddLib(const char *);
 void Suff_FindDeps(GNode *);
 SearchPath *Suff_FindPath(GNode *);
 void Suff_SetNull(const char *);
-void Suff_Init(void);
-void Suff_End(void);
 void Suff_PrintAll(void);
 
 /* targ.c */
 void Targ_Init(void);
 void Targ_End(void);
+
 void Targ_Stats(void);
 GNodeList *Targ_List(void);
 GNode *Targ_NewGN(const char *);
@@ -208,6 +211,8 @@ void Targ_PrintGraph(int);
 void Targ_Propagate(void);
 
 /* var.c */
+void Var_Init(void);
+void Var_End(void);
 
 typedef enum {
     VARE_NONE		= 0,
@@ -291,8 +296,6 @@ const char *Var_Value(const char *, GNod
 VarParseResult Var_Parse(const char **, GNode *, VarEvalFlags,
 			 const char **, void **);
 VarParseResult Var_Subst(const char *, GNode *, VarEvalFlags, char **);
-void Var_Init(void);
-void Var_End(void);
 void Var_Stats(void);
 void Var_Dump(GNode *);
 void Var_ExportVars(void);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.382 src/usr.bin/make/parse.c:1.383
--- src/usr.bin/make/parse.c:1.382	Sat Oct 17 21:21:37 2020
+++ src/usr.bin/make/parse.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.382 2020/10/17 21:21:37 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.383 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -91,7 +91,7 @@
  *			called before anything else in this module
  *			is used.
  *
- *	Parse_End	Cleanup the module
+ *	Parse_End	Clean up the module
  *
  *	Parse_File	Function used to parse a makefile. It must
  *			be given the name of the file, which should
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.382 2020/10/17 21:21:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.383 2020/10/17 21:32:30 rillig Exp $");
 
 /* types and constants */
 
@@ -3119,18 +3119,7 @@ Parse_File(const char *name, int fd)
     }
 }
 
-/*-
- *---------------------------------------------------------------------
- * Parse_Init --
- *	initialize the parsing module
- *
- * Results:
- *	none
- *
- * Side Effects:
- *	the parseIncPath list is initialized...
- *---------------------------------------------------------------------
- */
+/* Initialize the parsing module. */
 void
 Parse_Init(void)
 {
@@ -3144,6 +3133,7 @@ Parse_Init(void)
 #endif
 }
 
+/* Clean up the parsing module. */
 void
 Parse_End(void)
 {

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.178 src/usr.bin/make/suff.c:1.179
--- src/usr.bin/make/suff.c:1.178	Sat Oct 17 17:47:14 2020
+++ src/usr.bin/make/suff.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.178 2020/10/17 17:47:14 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.179 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -76,7 +76,7 @@
  * Interface:
  *	Suff_Init	Initialize all things to do with suffixes.
  *
- *	Suff_End	Cleanup the module
+ *	Suff_End	Clean up the module
  *
  *	Suff_DoPaths	This function is used to make life easier
  *			when searching for a file according to its
@@ -129,7 +129,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.178 2020/10/17 17:47:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.179 2020/10/17 21:32:30 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.112 src/usr.bin/make/targ.c:1.113
--- src/usr.bin/make/targ.c:1.112	Mon Oct  5 22:15:45 2020
+++ src/usr.bin/make/targ.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.112 2020/10/05 22:15:45 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.113 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -76,7 +76,7 @@
  * Interface:
  *	Targ_Init	Initialization procedure.
  *
- *	Targ_End	Cleanup the module
+ *	Targ_End	Clean up the module
  *
  *	Targ_List	Return the list of all targets so far.
  *
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.112 2020/10/05 22:15:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.113 2020/10/17 21:32:30 rillig Exp $");
 
 static GNodeList *allTargets;	/* the list of all targets found so far */
 #ifdef CLEANUP

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.571 src/usr.bin/make/var.c:1.572
--- src/usr.bin/make/var.c:1.571	Sat Oct 17 17:47:14 2020
+++ src/usr.bin/make/var.c	Sat Oct 17 21:32:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.571 2020/10/17 17:47:14 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.572 2020/10/17 21:32:30 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include    "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.571 2020/10/17 17:47:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.572 2020/10/17 21:32:30 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3830,7 +3830,7 @@ Var_Subst(const char *str, GNode *ctxt, 
     return VPR_OK;
 }
 
-/* Initialize the module. */
+/* Initialize the variables module. */
 void
 Var_Init(void)
 {
@@ -3839,7 +3839,7 @@ Var_Init(void)
     VAR_CMD = Targ_NewGN("Command");
 }
 
-
+/* Clean up the variables module. */
 void
 Var_End(void)
 {

Reply via email to