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): remove Dir_InitDir



details:   https://anonhg.NetBSD.org/src/rev/3d6fb6d24915
branches:  trunk
changeset: 946572:3d6fb6d24915
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 01 19:28:32 2020 +0000

description:
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.

diffstat:

 usr.bin/make/dir.c  |  11 ++---------
 usr.bin/make/dir.h  |   3 +--
 usr.bin/make/main.c |   6 +++---
 3 files changed, 6 insertions(+), 14 deletions(-)

diffs (76 lines):

diff -r 62adf63b8f4e -r 3d6fb6d24915 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Tue Dec 01 17:50:04 2020 +0000
+++ b/usr.bin/make/dir.c        Tue Dec 01 19:28:32 2020 +0000
@@ -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 @@
        OpenDirs_Init(&openDirs);
        HashTable_Init(&mtimes);
        HashTable_Init(&lmtimes);
-}
-
-void
-Dir_InitDir(const char *cdname)
-{
-       Dir_InitCur(cdname);
-
        CachedDir_Assign(&dotLast, CachedDir_New(".DOTLAST"));
 }
 
diff -r 62adf63b8f4e -r 3d6fb6d24915 usr.bin/make/dir.h
--- a/usr.bin/make/dir.h        Tue Dec 01 17:50:04 2020 +0000
+++ b/usr.bin/make/dir.h        Tue Dec 01 19:28:32 2020 +0000
@@ -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);
diff -r 62adf63b8f4e -r 3d6fb6d24915 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Tue Dec 01 17:50:04 2020 +0000
+++ b/usr.bin/make/main.c       Tue Dec 01 19:28:32 2020 +0000
@@ -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 @@
 {
        Boolean writable;
 
-       Dir_InitDir(curdir);
+       Dir_InitCur(curdir);
        writable = GetBooleanVar("MAKE_OBJDIR_CHECK_WRITABLE", TRUE);
        (void)Main_SetObjdir(FALSE, "%s", curdir);
 



Home | Main Index | Thread Index | Old Index