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 Dir_AddDir, reorder parameters ...



details:   https://anonhg.NetBSD.org/src/rev/c8b93db9b4f8
branches:  trunk
changeset: 958850:c8b93db9b4f8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 23 11:34:41 2021 +0000

description:
make(1): rename Dir_AddDir, reorder parameters of SearchPath_ToFlags

diffstat:

 usr.bin/make/dir.c   |  22 +++++++++++-----------
 usr.bin/make/dir.h   |   6 +++---
 usr.bin/make/main.c  |  14 +++++++-------
 usr.bin/make/parse.c |   8 ++++----
 usr.bin/make/suff.c  |   8 ++++----
 5 files changed, 29 insertions(+), 29 deletions(-)

diffs (236 lines):

diff -r 4e12782d4308 -r c8b93db9b4f8 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sat Jan 23 11:14:59 2021 +0000
+++ b/usr.bin/make/dir.c        Sat Jan 23 11:34:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.259 2021/01/23 11:14:59 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.260 2021/01/23 11:34:41 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -106,7 +106,7 @@
  *                     Update the modification time and path of a node with
  *                     data from the file corresponding to the node.
  *
- *     Dir_AddDir      Add a directory to a search path.
+ *     SearchPath_Add  Add a directory to a search path.
  *
  *     SearchPath_ToFlags
  *                     Given a search path and a command flag, create
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.259 2021/01/23 11:14:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.260 2021/01/23 11:34:41 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -485,18 +485,18 @@
  * Called by Dir_InitDir and whenever .CURDIR is assigned to.
  */
 void
-Dir_InitCur(const char *cdname)
+Dir_InitCur(const char *newCurdir)
 {
        CachedDir *dir;
 
-       if (cdname == NULL)
+       if (newCurdir == NULL)
                return;
 
        /*
         * Our build directory is not the same as our source directory.
         * Keep this one around too.
         */
-       dir = Dir_AddDir(NULL, cdname);
+       dir = SearchPath_Add(NULL, newCurdir);
        if (dir == NULL)
                return;
 
@@ -512,7 +512,7 @@
 {
        CachedDir *dir;
 
-       dir = Dir_AddDir(NULL, ".");
+       dir = SearchPath_Add(NULL, ".");
        if (dir == NULL) {
                Error("Cannot open `.' (%s)", strerror(errno));
                exit(2);        /* Not 1 so -q can distinguish error */
@@ -877,7 +877,7 @@
                *end = '\0';
 
        partPath = SearchPath_New();
-       (void)Dir_AddDir(partPath, dirpath);
+       (void)SearchPath_Add(partPath, dirpath);
        DirExpandPath(wildcardComponent + 1, partPath, expansions);
        SearchPath_Free(partPath);
 }
@@ -1291,7 +1291,7 @@
                        base++;
                }
                prefix = bmake_strsedup(name, base - 1);
-               (void)Dir_AddDir(path, prefix);
+               (void)SearchPath_Add(path, prefix);
                free(prefix);
 
                bigmisses++;
@@ -1546,7 +1546,7 @@
  *                     Lst_Append and CachedDir_Ref.
  */
 CachedDir *
-Dir_AddDir(SearchPath *path, const char *name)
+SearchPath_Add(SearchPath *path, const char *name)
 {
 
        if (path != NULL && strcmp(name, ".DOTLAST") == 0) {
@@ -1606,7 +1606,7 @@
  *     don't go well.
  */
 char *
-SearchPath_ToFlags(const char *flag, SearchPath *path)
+SearchPath_ToFlags(SearchPath *path, const char *flag)
 {
        Buffer buf;
        SearchPathNode *ln;
diff -r 4e12782d4308 -r c8b93db9b4f8 usr.bin/make/dir.h
--- a/usr.bin/make/dir.h        Sat Jan 23 11:14:59 2021 +0000
+++ b/usr.bin/make/dir.h        Sat Jan 23 11:34:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.h,v 1.41 2021/01/23 10:48:49 rillig Exp $  */
+/*     $NetBSD: dir.h,v 1.42 2021/01/23 11:34:41 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -87,8 +87,8 @@
 char *Dir_FindFile(const char *, SearchPath *);
 char *Dir_FindHereOrAbove(const char *, const char *);
 void Dir_UpdateMTime(GNode *, Boolean);
-CachedDir *Dir_AddDir(SearchPath *, const char *);
-char *SearchPath_ToFlags(const char *, SearchPath *);
+CachedDir *SearchPath_Add(SearchPath *, const char *);
+char *SearchPath_ToFlags(SearchPath *, const char *);
 void SearchPath_Clear(SearchPath *);
 void SearchPath_AddAll(SearchPath *, SearchPath *);
 void Dir_PrintDirectories(void);
diff -r 4e12782d4308 -r c8b93db9b4f8 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Jan 23 11:14:59 2021 +0000
+++ b/usr.bin/make/main.c       Sat Jan 23 11:34:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.515 2021/01/23 10:48:49 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.516 2021/01/23 11:34:41 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.515 2021/01/23 10:48:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.516 2021/01/23 11:34:41 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -442,10 +442,10 @@
                char *found_path = Dir_FindHereOrAbove(curdir, argvalue + 4);
                if (found_path == NULL)
                        return;
-               (void)Dir_AddDir(sysIncPath, found_path);
+               (void)SearchPath_Add(sysIncPath, found_path);
                free(found_path);
        } else {
-               (void)Dir_AddDir(sysIncPath, argvalue);
+               (void)SearchPath_Add(sysIncPath, argvalue);
        }
        Var_Append(MAKEFLAGS, "-m", VAR_GLOBAL);
        Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
@@ -1196,11 +1196,11 @@
                if (strncmp(start, ".../", 4) == 0) {
                        char *dir = Dir_FindHereOrAbove(curdir, start + 4);
                        if (dir != NULL) {
-                               (void)Dir_AddDir(defSysIncPath, dir);
+                               (void)SearchPath_Add(defSysIncPath, dir);
                                free(dir);
                        }
                } else {
-                       (void)Dir_AddDir(defSysIncPath, start);
+                       (void)SearchPath_Add(defSysIncPath, start);
                }
        }
 
@@ -1291,7 +1291,7 @@
                savec = *cp;
                *cp = '\0';
                /* Add directory to search path */
-               (void)Dir_AddDir(&dirSearchPath, path);
+               (void)SearchPath_Add(&dirSearchPath, path);
                *cp = savec;
                path = cp + 1;
        } while (savec == ':');
diff -r 4e12782d4308 -r c8b93db9b4f8 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Jan 23 11:14:59 2021 +0000
+++ b/usr.bin/make/parse.c      Sat Jan 23 11:34:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.528 2021/01/23 10:48:49 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.529 2021/01/23 11:34:41 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.528 2021/01/23 10:48:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.529 2021/01/23 11:34:41 rillig Exp $");
 
 /* types and constants */
 
@@ -1322,7 +1322,7 @@
        if (paths != NULL) {
                SearchPathListNode *ln;
                for (ln = paths->first; ln != NULL; ln = ln->next)
-                       (void)Dir_AddDir(ln->datum, dir);
+                       (void)SearchPath_Add(ln->datum, dir);
        }
 }
 
@@ -2071,7 +2071,7 @@
 void
 Parse_AddIncludeDir(const char *dir)
 {
-       (void)Dir_AddDir(parseIncPath, dir);
+       (void)SearchPath_Add(parseIncPath, dir);
 }
 
 /*
diff -r 4e12782d4308 -r c8b93db9b4f8 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Jan 23 11:14:59 2021 +0000
+++ b/usr.bin/make/suff.c       Sat Jan 23 11:34:41 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.336 2021/01/23 10:48:49 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.337 2021/01/23 11:34:41 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.336 2021/01/23 10:48:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.337 2021/01/23 11:34:41 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -902,11 +902,11 @@
                }
        }
 
-       flags = SearchPath_ToFlags("-I", includesPath);
+       flags = SearchPath_ToFlags(includesPath, "-I");
        Var_Set(".INCLUDES", flags, VAR_GLOBAL);
        free(flags);
 
-       flags = SearchPath_ToFlags("-L", libsPath);
+       flags = SearchPath_ToFlags(libsPath, "-L");
        Var_Set(".LIBS", flags, VAR_GLOBAL);
        free(flags);
 



Home | Main Index | Thread Index | Old Index