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 Lst_Init to Lst_New



details:   https://anonhg.NetBSD.org/src/rev/41846fe26c7b
branches:  trunk
changeset: 944991:41846fe26c7b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 18 13:02:10 2020 +0000

description:
make(1): rename Lst_Init to Lst_New

For the other types such as HashTable and Buffer, the Init function does
not allocate the memory for the structure itself, it only fills it.

diffstat:

 usr.bin/make/arch.c               |   8 +++---
 usr.bin/make/dir.c                |  10 +++---
 usr.bin/make/job.c                |   6 ++--
 usr.bin/make/lst.c                |   8 +++---
 usr.bin/make/lst.h                |   4 +-
 usr.bin/make/main.c               |  12 ++++----
 usr.bin/make/make.c               |   8 +++---
 usr.bin/make/meta.c               |   8 +++---
 usr.bin/make/parse.c              |  26 ++++++++++----------
 usr.bin/make/suff.c               |  50 +++++++++++++++++++-------------------
 usr.bin/make/targ.c               |  24 +++++++++---------
 usr.bin/make/unit-tests/deptgt.mk |   4 +-
 12 files changed, 84 insertions(+), 84 deletions(-)

diffs (truncated from 621 to 300 lines):

diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/arch.c       Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.135 2020/10/18 12:36:43 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.136 2020/10/18 13:02:10 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include    "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.135 2020/10/18 12:36:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.136 2020/10/18 13:02:10 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -357,7 +357,7 @@
             */
            free(buf);
        } else if (Dir_HasWildcards(memName)) {
-           StringList *members = Lst_Init();
+           StringList *members = Lst_New();
            Dir_Expand(memName, dirSearchPath, members);
 
            while (!Lst_IsEmpty(members)) {
@@ -1126,7 +1126,7 @@
 void
 Arch_Init(void)
 {
-    archives = Lst_Init();
+    archives = Lst_New();
 }
 
 /* Clean up the archives module. */
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.166 2020/10/18 12:47:43 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.167 2020/10/18 13:02:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.166 2020/10/18 12:47:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.167 2020/10/18 13:02:10 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -227,7 +227,7 @@
 static void
 OpenDirs_Init(OpenDirs *odirs)
 {
-    odirs->list = Lst_Init();
+    odirs->list = Lst_New();
     Hash_InitTable(&odirs->table);
 }
 
@@ -392,7 +392,7 @@
 void
 Dir_Init(void)
 {
-    dirSearchPath = Lst_Init();
+    dirSearchPath = Lst_New();
     OpenDirs_Init(&openDirs);
     Hash_InitTable(&mtimes);
     Hash_InitTable(&lmtimes);
@@ -883,7 +883,7 @@
                        char *dp = &dirpath[strlen(dirpath) - 1];
                        if (*dp == '/')
                            *dp = '\0';
-                       path = Lst_Init();
+                       path = Lst_New();
                        (void)Dir_AddDir(path, dirpath);
                        DirExpandInt(cp + 1, path, expansions);
                        Lst_Free(path);
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/job.c        Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.264 2020/10/18 07:46:04 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.265 2020/10/18 13:02:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.264 2020/10/18 07:46:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.265 2020/10/18 13:02:10 rillig Exp $");
 
 # define STATIC static
 
@@ -1764,7 +1764,7 @@
      * Running these jobs in compat mode also guarantees that these
      * jobs do not overlap with other unrelated jobs.
      */
-    List *lst = Lst_Init();
+    List *lst = Lst_New();
     Lst_Append(lst, targ);
     (void)Make_Run(lst);
     Lst_Destroy(lst, NULL);
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/lst.c        Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.76 2020/10/18 08:58:29 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.77 2020/10/18 13:02:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -34,7 +34,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.76 2020/10/18 08:58:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.77 2020/10/18 13:02:10 rillig Exp $");
 
 /* Allocate and initialize a list node.
  *
@@ -58,7 +58,7 @@
 
 /* Create and initialize a new, empty list. */
 List *
-Lst_Init(void)
+Lst_New(void)
 {
     List *list = bmake_malloc(sizeof *list);
 
@@ -79,7 +79,7 @@
     List *newList;
     ListNode *node;
 
-    newList = Lst_Init();
+    newList = Lst_New();
 
     for (node = list->first; node != NULL; node = node->next) {
        void *datum = copyProc != NULL ? copyProc(node->datum) : node->datum;
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/lst.h        Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.70 2020/10/18 08:58:29 rillig Exp $  */
+/*     $NetBSD: lst.h,v 1.71 2020/10/18 13:02:10 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -133,7 +133,7 @@
 /* Create or destroy a list */
 
 /* Create a new list. */
-List *Lst_Init(void);
+List *Lst_New(void);
 /* Duplicate an existing list. */
 List *Lst_Copy(List *, LstCopyProc);
 /* Free the list, leaving the node data unmodified. */
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/main.c       Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.377 2020/10/18 12:47:43 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.378 2020/10/18 13:02:10 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.377 2020/10/18 12:47:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.378 2020/10/18 13:02:10 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -1128,11 +1128,11 @@
                VAR_GLOBAL);
        Var_Set(MAKE_DEPENDFILE, ".depend", VAR_GLOBAL);
 
-       create = Lst_Init();
-       makefiles = Lst_Init();
+       create = Lst_New();
+       makefiles = Lst_New();
        printVars = 0;
        debugVflag = FALSE;
-       variables = Lst_Init();
+       variables = Lst_New();
        beSilent = FALSE;               /* Print commands as executed */
        ignoreErrors = FALSE;           /* Pay attention to non-zero returns */
        noExecute = FALSE;              /* Execute all commands */
@@ -1360,7 +1360,7 @@
        if (!noBuiltins) {
                StringListNode *ln;
 
-               sysMkPath = Lst_Init();
+               sysMkPath = Lst_New();
                Dir_Expand(_PATH_DEFSYSMK,
                           Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath,
                           sysMkPath);
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/make.c       Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.159 2020/10/18 11:09:08 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.160 2020/10/18 13:02:10 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.159 2020/10/18 11:09:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.160 2020/10/18 13:02:10 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -1232,7 +1232,7 @@
     /* Start building with the 'dummy' .MAIN' node */
     MakeBuildChild(pgn, NULL);
 
-    examine = Lst_Init();
+    examine = Lst_New();
     Lst_Append(examine, pgn);
 
     while (!Lst_IsEmpty(examine)) {
@@ -1294,7 +1294,7 @@
     int errors;                        /* Number of errors the Job module reports */
 
     /* Start trying to make the current targets... */
-    toBeMade = Lst_Init();
+    toBeMade = Lst_New();
 
     Make_ExpandUse(targs);
     Make_ProcessWait(targs);
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/meta.c       Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.124 2020/10/18 11:54:43 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.125 2020/10/18 13:02:10 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -625,7 +625,7 @@
     /*
      * We consider ourselves master of all within ${.MAKE.META.BAILIWICK}
      */
-    metaBailiwick = Lst_Init();
+    metaBailiwick = Lst_New();
     (void)Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}",
                    VAR_GLOBAL, VARE_WANTRES, &metaBailiwickStr);
     /* TODO: handle errors */
@@ -633,7 +633,7 @@
     /*
      * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS}
      */
-    metaIgnorePaths = Lst_Init();
+    metaIgnorePaths = Lst_New();
     Var_Append(MAKE_META_IGNORE_PATHS,
               "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL);
     (void)Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}",
@@ -1096,7 +1096,7 @@
        goto oodate_out;
     dname = fname3;
 
-    missingFiles = Lst_Init();
+    missingFiles = Lst_New();
 
     /*
      * We need to check if the target is out-of-date. This includes
diff -r 9e90eee9bf34 -r 41846fe26c7b usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Oct 18 12:47:43 2020 +0000
+++ b/usr.bin/make/parse.c      Sun Oct 18 13:02:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.384 2020/10/18 08:58:29 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.385 2020/10/18 13:02:10 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.384 2020/10/18 08:58:29 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.385 2020/10/18 13:02:10 rillig Exp $");
 
 /* types and constants */
 
@@ -1126,7 +1126,7 @@
     switch (*inout_specType) {
     case ExPath:
        if (*inout_paths == NULL) {
-           *inout_paths = Lst_Init();
+           *inout_paths = Lst_New();



Home | Main Index | Thread Index | Old Index