Module Name:    src
Committed By:   rillig
Date:           Tue Dec  1 19:28:32 UTC 2020

Modified Files:
        src/usr.bin/make: dir.c dir.h main.c

Log Message:
make(1): remove Dir_InitDir

The function name had been too ambiguous since it didn't mention the
particular directory that was initialized.  Instead of that function,
Dir_InitCur is called directly from main_Init.

The pseudo CachedDir entry ".DOTLAST" is initialized at the very
beginning.  The observable behavior is unchanged since this a
memory-only object with no connection to the file system.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/usr.bin/make/dir.c
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/make/dir.h
cvs rdiff -u -r1.490 -r1.491 src/usr.bin/make/main.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/dir.c
diff -u src/usr.bin/make/dir.c:1.245 src/usr.bin/make/dir.c:1.246
--- src/usr.bin/make/dir.c:1.245	Mon Nov 30 20:25:37 2020
+++ src/usr.bin/make/dir.c	Tue Dec  1 19:28:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.245 2020/11/30 20:25:37 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.246 2020/12/01 19:28:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.245 2020/11/30 20:25:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.246 2020/12/01 19:28:32 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -475,13 +475,6 @@ Dir_Init(void)
 	OpenDirs_Init(&openDirs);
 	HashTable_Init(&mtimes);
 	HashTable_Init(&lmtimes);
-}
-
-void
-Dir_InitDir(const char *cdname)
-{
-	Dir_InitCur(cdname);
-
 	CachedDir_Assign(&dotLast, CachedDir_New(".DOTLAST"));
 }
 

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.39 src/usr.bin/make/dir.h:1.40
--- src/usr.bin/make/dir.h:1.39	Sun Nov 29 09:27:40 2020
+++ src/usr.bin/make/dir.h	Tue Dec  1 19:28:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.39 2020/11/29 09:27:40 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.40 2020/12/01 19:28:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -78,7 +78,6 @@
 typedef struct CachedDir CachedDir;
 
 void Dir_Init(void);
-void Dir_InitDir(const char *);
 void Dir_InitCur(const char *);
 void Dir_InitDot(void);
 void Dir_End(void);

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.490 src/usr.bin/make/main.c:1.491
--- src/usr.bin/make/main.c:1.490	Sun Nov 29 01:40:26 2020
+++ src/usr.bin/make/main.c	Tue Dec  1 19:28:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.490 2020/11/29 01:40:26 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.491 2020/12/01 19:28:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.490 2020/11/29 01:40:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.491 2020/12/01 19:28:32 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -1091,7 +1091,7 @@ InitObjdir(const char *machine, const ch
 {
 	Boolean writable;
 
-	Dir_InitDir(curdir);
+	Dir_InitCur(curdir);
 	writable = GetBooleanVar("MAKE_OBJDIR_CHECK_WRITABLE", TRUE);
 	(void)Main_SetObjdir(FALSE, "%s", curdir);
 

Reply via email to