Module Name:    src
Committed By:   rillig
Date:           Fri Oct 23 19:48:17 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c compat.c make.c make.h targ.c

Log Message:
make(1): rename GNode.cmgn to youngestChild

The name is longer than before but also clearer.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/make/arch.c
cvs rdiff -u -r1.166 -r1.167 src/usr.bin/make/compat.c
cvs rdiff -u -r1.177 -r1.178 src/usr.bin/make/make.c
cvs rdiff -u -r1.165 -r1.166 src/usr.bin/make/make.h
cvs rdiff -u -r1.121 -r1.122 src/usr.bin/make/targ.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/arch.c
diff -u src/usr.bin/make/arch.c:1.139 src/usr.bin/make/arch.c:1.140
--- src/usr.bin/make/arch.c:1.139	Fri Oct 23 18:36:09 2020
+++ src/usr.bin/make/arch.c	Fri Oct 23 19:48:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.139 2020/10/23 18:36:09 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.140 2020/10/23 19:48:17 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.139 2020/10/23 18:36:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.140 2020/10/23 19:48:17 rillig Exp $");
 
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
@@ -1060,7 +1060,7 @@ Arch_FindLib(GNode *gn, SearchPath *path
  * given that it is a target on a dependency line somewhere:
  *
  *	Its modification time is less than that of one of its sources
- *	(gn->mtime < gn->cmgn->mtime).
+ *	(gn->mtime < gn->youngestChild->mtime).
  *
  *	Its modification time is greater than the time at which the make
  *	began (i.e. it's been modified in the course of the make, probably
@@ -1088,9 +1088,10 @@ Arch_LibOODate(GNode *gn)
 	oodate = TRUE;
     } else if (!GNode_IsTarget(gn) && Lst_IsEmpty(gn->children)) {
 	oodate = FALSE;
-    } else if ((!Lst_IsEmpty(gn->children) && gn->cmgn == NULL) ||
+    } else if ((!Lst_IsEmpty(gn->children) && gn->youngestChild == NULL) ||
 	       (gn->mtime > now) ||
-	       (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime)) {
+	       (gn->youngestChild != NULL &&
+		gn->mtime < gn->youngestChild->mtime)) {
 	oodate = TRUE;
     } else {
 #ifdef RANLIBMAG
@@ -1105,7 +1106,7 @@ Arch_LibOODate(GNode *gn)
 	    if (DEBUG(ARCH) || DEBUG(MAKE)) {
 		debug_printf("%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC));
 	    }
-	    oodate = (gn->cmgn == NULL || gn->cmgn->mtime > modTimeTOC);
+	    oodate = (gn->youngestChild == NULL || gn->youngestChild->mtime > modTimeTOC);
 	} else {
 	    /*
 	     * A library w/o a table of contents is out-of-date

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.166 src/usr.bin/make/compat.c:1.167
--- src/usr.bin/make/compat.c:1.166	Sun Oct 18 07:46:04 2020
+++ src/usr.bin/make/compat.c	Fri Oct 23 19:48:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.166 2020/10/18 07:46:04 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.167 2020/10/23 19:48:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.166 2020/10/18 07:46:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.167 2020/10/23 19:48:17 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -512,7 +512,7 @@ Compat_Make(GNode *gn, GNode *pgn)
 	}
 
 	/*
-	 * All the children were made ok. Now cmgn->mtime contains the
+	 * All the children were made ok. Now youngestChild->mtime contains the
 	 * modification time of the newest child, we need to find out if we
 	 * exist and when we were modified last. The criteria for datedness
 	 * are defined by the Make_OODate function.

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.177 src/usr.bin/make/make.c:1.178
--- src/usr.bin/make/make.c:1.177	Fri Oct 23 18:36:09 2020
+++ src/usr.bin/make/make.c	Fri Oct 23 19:48:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.177 2020/10/23 18:36:09 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.178 2020/10/23 19:48:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -81,12 +81,12 @@
  *
  *	Make_Update	Update all parents of a given child. Performs
  *			various bookkeeping chores like the updating
- *			of the cmgn field of the parent, filling
+ *			of the youngestChild field of the parent, filling
  *			of the IMPSRC context variable, etc. It will
  *			place the parent on the toBeMade queue if it
  *			should be.
  *
- *	Make_TimeStamp	Function to set the parent's cmgn field
+ *	Make_TimeStamp	Function to set the parent's youngestChild field
  *			based on a child's modification time.
  *
  *	Make_DoAllVar	Set up the various local variables for a
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.177 2020/10/23 18:36:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.178 2020/10/23 19:48:17 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -187,8 +187,8 @@ NoExecute(GNode *gn)
 void
 Make_TimeStamp(GNode *pgn, GNode *cgn)
 {
-    if (pgn->cmgn == NULL || cgn->mtime > pgn->cmgn->mtime) {
-	pgn->cmgn = cgn;
+    if (pgn->youngestChild == NULL || cgn->mtime > pgn->youngestChild->mtime) {
+	pgn->youngestChild = cgn;
     }
 }
 
@@ -200,7 +200,7 @@ Make_TimeStamp(GNode *pgn, GNode *cgn)
  * must be considered out-of-date since at least one of its children
  * will have been recreated.
  *
- * The mtime field of the node and the cmgn field of its parents
+ * The mtime field of the node and the youngestChild field of its parents
  * may be changed.
  */
 Boolean
@@ -253,7 +253,7 @@ Make_OODate(GNode *gn)
 	 * or non-existent.
 	 */
 	oodate = (gn->mtime == 0 || Arch_LibOODate(gn) ||
-		  (gn->cmgn == NULL && (gn->type & OP_DOUBLEDEP)));
+		  (gn->youngestChild == NULL && (gn->type & OP_DOUBLEDEP)));
     } else if (gn->type & OP_JOIN) {
 	/*
 	 * A target with the .JOIN attribute is only considered
@@ -277,22 +277,25 @@ Make_OODate(GNode *gn)
 	    }
 	}
 	oodate = TRUE;
-    } else if ((gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) ||
-	       (gn->cmgn == NULL &&
+    } else if ((gn->youngestChild != NULL &&
+		gn->mtime < gn->youngestChild->mtime) ||
+	       (gn->youngestChild == NULL &&
 		((gn->mtime == 0 && !(gn->type & OP_OPTIONAL))
-		  || gn->type & OP_DOUBLEDEP)))
+		 || gn->type & OP_DOUBLEDEP)))
     {
 	/*
 	 * A node whose modification time is less than that of its
-	 * youngest child or that has no children (cmgn == NULL) and
+	 * youngest child or that has no children (youngestChild == NULL) and
 	 * either doesn't exist (mtime == 0) and it isn't optional
 	 * or was the object of a * :: operator is out-of-date.
 	 * Why? Because that's the way Make does it.
 	 */
 	if (DEBUG(MAKE)) {
-	    if (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) {
+	    if (gn->youngestChild != NULL &&
+		gn->mtime < gn->youngestChild->mtime) {
 		debug_printf("modified before source %s...",
-			     gn->cmgn->path ? gn->cmgn->path : gn->cmgn->name);
+			     gn->youngestChild->path ? gn->youngestChild->path
+						     : gn->youngestChild->name);
 	    } else if (gn->mtime == 0) {
 		debug_printf("non-existent and no sources...");
 	    } else {
@@ -354,7 +357,7 @@ MakeAddChild(void *gnp, void *lp)
 
 /* Find the pathname of a child that was already made.
  *
- * The path and mtime of the node and the cmgn of the parent are
+ * The path and mtime of the node and the youngestChild of the parent are
  * updated; the unmade children count of the parent is decremented.
  *
  * Input:
@@ -594,7 +597,7 @@ UpdateImplicitParentsVars(GNode *cgn, co
  * If the child is not up-to-date and still does not exist,
  * set the FORCE flag on the parents.
  *
- * If the child wasn't made, the cmgn field of the parent will be
+ * If the child wasn't made, the youngestChild field of the parent will be
  * altered if the child's mtime is big enough.
  *
  * Finally, if the child is the implied source for the parent, the
@@ -667,7 +670,7 @@ Make_Update(GNode *cgn)
 
 	/*
 	 * If the parent has the .MADE attribute, its timestamp got
-	 * updated to that of its newest child, and its unmake
+	 * updated to that of its newest child, and its unmade
 	 * child count got set to zero in Make_ExpandUse().
 	 * However other things might cause us to build one of its
 	 * children - and so we mustn't do any processing here when

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.165 src/usr.bin/make/make.h:1.166
--- src/usr.bin/make/make.h:1.165	Fri Oct 23 19:11:30 2020
+++ src/usr.bin/make/make.h	Fri Oct 23 19:48:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.165 2020/10/23 19:11:30 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.166 2020/10/23 19:48:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -321,7 +321,7 @@ typedef struct GNode {
     /* The modification time; 0 means the node does not have a corresponding
      * file; see Make_OODate. */
     time_t mtime;
-    struct GNode *cmgn;		/* The youngest child */
+    struct GNode *youngestChild;
 
     /* The GNodes for which this node is an implied source. May be empty.
      * For example, when there is an inference rule for .c.o, the node for

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.121 src/usr.bin/make/targ.c:1.122
--- src/usr.bin/make/targ.c:1.121	Fri Oct 23 18:36:10 2020
+++ src/usr.bin/make/targ.c	Fri Oct 23 19:48:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: targ.c,v 1.121 2020/10/23 18:36:10 rillig Exp $	*/
+/*	$NetBSD: targ.c,v 1.122 2020/10/23 19:48:17 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include "dir.h"
 
 /*	"@(#)targ.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: targ.c,v 1.121 2020/10/23 18:36:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.122 2020/10/23 19:48:17 rillig Exp $");
 
 static GNodeList *allTargets;	/* the list of all targets found so far */
 #ifdef CLEANUP
@@ -189,7 +189,7 @@ Targ_NewGN(const char *name)
     gn->flags = 0;
     gn->checked_seqno = 0;
     gn->mtime = 0;
-    gn->cmgn = NULL;
+    gn->youngestChild = NULL;
     gn->implicitParents = Lst_New();
     gn->cohorts = Lst_New();
     gn->parents = Lst_New();

Reply via email to