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 Targ_NewGN to GNode_New



details:   https://anonhg.NetBSD.org/src/rev/91ced556ad79
branches:  trunk
changeset: 946110:91ced556ad79
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 16 21:39:22 2020 +0000

description:
make(1): rename Targ_NewGN to GNode_New

This function is a classical constructor function, and if it weren't for
CLEANUP mode, it would have no dependencies on anything else besides the
memory allocator.  Therefore it doesn't really matter which module
defines this function, and there is no need for the "Targ" to be part of
the function name.

diffstat:

 usr.bin/make/make.c    |   6 +++---
 usr.bin/make/nonints.h |   4 ++--
 usr.bin/make/parse.c   |   6 +++---
 usr.bin/make/suff.c    |   6 +++---
 usr.bin/make/targ.c    |  10 +++++-----
 usr.bin/make/var.c     |  10 +++++-----
 6 files changed, 21 insertions(+), 21 deletions(-)

diffs (175 lines):

diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/make.c       Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.207 2020/11/15 10:11:26 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.208 2020/11/16 21:39:22 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.207 2020/11/15 10:11:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.208 2020/11/16 21:39:22 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -1207,7 +1207,7 @@
      * Perhaps this should be done earlier...
      */
 
-    pgn = Targ_NewGN(".MAIN");
+    pgn = GNode_New(".MAIN");
     pgn->flags = REMAKE;
     pgn->type = OP_PHONY | OP_DEPENDS;
     /* Get it displayed in the diag dumps */
diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/nonints.h    Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.160 2020/11/10 00:32:12 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.161 2020/11/16 21:39:22 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -191,7 +191,7 @@
 
 void Targ_Stats(void);
 GNodeList *Targ_List(void);
-GNode *Targ_NewGN(const char *);
+GNode *GNode_New(const char *);
 GNode *Targ_FindNode(const char *);
 GNode *Targ_GetNode(const char *);
 GNode *Targ_NewInternalNode(const char *);
diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/parse.c      Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.442 2020/11/15 22:31:03 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.443 2020/11/16 21:39:22 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.442 2020/11/15 22:31:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.443 2020/11/16 21:39:22 rillig Exp $");
 
 /* types and constants */
 
@@ -1110,7 +1110,7 @@
         * the node is a transformation rule to make life easier later,
         * when we'll use Make_HandleUse to actually apply the .DEFAULT
         * commands. */
-       GNode *gn = Targ_NewGN(".DEFAULT");
+       GNode *gn = GNode_New(".DEFAULT");
        gn->type |= OP_NOTMAIN|OP_TRANSFORM;
        Lst_Append(targets, gn);
        defaultNode = gn;
diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/suff.c       Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.243 2020/11/16 18:49:54 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.244 2020/11/16 21:39:22 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.243 2020/11/16 18:49:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.244 2020/11/16 21:39:22 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -486,7 +486,7 @@
         * Make a new graph node for the transformation. It will be filled in
         * by the Parse module.
         */
-       gn = Targ_NewGN(name);
+       gn = GNode_New(name);
        Lst_Append(transforms, gn);
     } else {
        /*
diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/targ.c       Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.127 2020/11/05 17:27:16 rillig Exp $        */
+/*     $NetBSD: targ.c,v 1.128 2020/11/16 21:39:22 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -80,7 +80,7 @@
  *
  *     Targ_List       Return the list of all targets so far.
  *
- *     Targ_NewGN      Create a new GNode for the passed target
+ *     GNode_New       Create a new GNode for the passed target
  *                     (string). The node is *not* placed in the
  *                     hash table, though all its fields are
  *                     initialized.
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*     "@(#)targ.c     8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.127 2020/11/05 17:27:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.128 2020/11/16 21:39:22 rillig Exp $");
 
 static GNodeList *allTargets;  /* the list of all targets found so far */
 #ifdef CLEANUP
@@ -172,7 +172,7 @@
  *     name            the name of the node, such as "clean", "src.c", ".END"
  */
 GNode *
-Targ_NewGN(const char *name)
+GNode_New(const char *name)
 {
     GNode *gn;
 
@@ -266,7 +266,7 @@
 GNode *
 Targ_NewInternalNode(const char *name)
 {
-    GNode *gn = Targ_NewGN(name);
+    GNode *gn = GNode_New(name);
     Var_Append(".ALLTARGETS", name, VAR_GLOBAL);
     Lst_Append(allTargets, gn);
     if (doing_depend)
diff -r 8fd62524dda4 -r 91ced556ad79 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Nov 16 18:49:54 2020 +0000
+++ b/usr.bin/make/var.c        Mon Nov 16 21:39:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.687 2020/11/15 18:33:41 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.688 2020/11/16 21:39:22 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.687 2020/11/15 18:33:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.688 2020/11/16 21:39:22 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -4065,9 +4065,9 @@
 void
 Var_Init(void)
 {
-    VAR_INTERNAL = Targ_NewGN("Internal");
-    VAR_GLOBAL = Targ_NewGN("Global");
-    VAR_CMDLINE = Targ_NewGN("Command");
+    VAR_INTERNAL = GNode_New("Internal");
+    VAR_GLOBAL = GNode_New("Global");
+    VAR_CMDLINE = GNode_New("Command");
 }
 
 /* Clean up the variables module. */



Home | Main Index | Thread Index | Old Index