Module Name:    src
Committed By:   rillig
Date:           Sun Nov  8 08:26:22 UTC 2020

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

Log Message:
make(1): rename Make_TimeStamp to GNode_UpdateYoungestChild


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/make/compat.c
cvs rdiff -u -r1.188 -r1.189 src/usr.bin/make/make.c
cvs rdiff -u -r1.198 -r1.199 src/usr.bin/make/make.h

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/compat.c
diff -u src/usr.bin/make/compat.c:1.179 src/usr.bin/make/compat.c:1.180
--- src/usr.bin/make/compat.c:1.179	Sat Nov  7 14:32:12 2020
+++ src/usr.bin/make/compat.c	Sun Nov  8 08:26:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.179 2020/11/07 14:32:12 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.180 2020/11/08 08:26:22 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.179 2020/11/07 14:32:12 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.180 2020/11/08 08:26:22 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -570,7 +570,7 @@ Compat_Make(GNode *gn, GNode *pgn)
 		pgn->flags |= FORCE;
 	    if (!(gn->type & OP_EXEC)) {
 		pgn->flags |= CHILDMADE;
-		Make_TimeStamp(pgn, gn);
+		GNode_UpdateYoungestChild(pgn, gn);
 	    }
 	} else if (opts.keepgoing) {
 	    pgn->flags &= ~(unsigned)REMAKE;
@@ -595,12 +595,12 @@ Compat_Make(GNode *gn, GNode *pgn)
 	    case MADE:
 		if (!(gn->type & OP_EXEC)) {
 		    pgn->flags |= CHILDMADE;
-		    Make_TimeStamp(pgn, gn);
+		    GNode_UpdateYoungestChild(pgn, gn);
 		}
 		break;
 	    case UPTODATE:
 		if (!(gn->type & OP_EXEC))
-		    Make_TimeStamp(pgn, gn);
+		    GNode_UpdateYoungestChild(pgn, gn);
 		break;
 	    default:
 		break;

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.188 src/usr.bin/make/make.c:1.189
--- src/usr.bin/make/make.c:1.188	Sat Nov  7 21:22:37 2020
+++ src/usr.bin/make/make.c	Sun Nov  8 08:26:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.c,v 1.188 2020/11/07 21:22:37 rillig Exp $	*/
+/*	$NetBSD: make.c,v 1.189 2020/11/08 08:26:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -86,8 +86,9 @@
  *			place the parent on the toBeMade queue if it
  *			should be.
  *
- *	Make_TimeStamp	Function to set the parent's youngestChild field
- *			based on a child's modification time.
+ *	GNode_UpdateYoungestChild
+ *			Update the node's youngestChild field based on the
+ *			child's modification time.
  *
  *	Make_DoAllVar	Set up the various local variables for a
  *			target, including the .ALLSRC variable, making
@@ -107,7 +108,7 @@
 #include "job.h"
 
 /*	"@(#)make.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: make.c,v 1.188 2020/11/07 21:22:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.189 2020/11/08 08:26:22 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -185,11 +186,10 @@ GNode_ShouldExecute(GNode *gn)
 
 /* Update the youngest child of the node, according to the given child. */
 void
-Make_TimeStamp(GNode *pgn, GNode *cgn)
+GNode_UpdateYoungestChild(GNode *gn, GNode *cgn)
 {
-    if (pgn->youngestChild == NULL || cgn->mtime > pgn->youngestChild->mtime) {
-	pgn->youngestChild = cgn;
-    }
+    if (gn->youngestChild == NULL || cgn->mtime > gn->youngestChild->mtime)
+	gn->youngestChild = cgn;
 }
 
 /* See if the node is out of date with respect to its sources.
@@ -331,7 +331,7 @@ Make_OODate(GNode *gn)
     if (!oodate) {
 	GNodeListNode *ln;
 	for (ln = gn->parents->first; ln != NULL; ln = ln->next)
-	    Make_TimeStamp(ln->datum, gn);
+	    GNode_UpdateYoungestChild(ln->datum, gn);
     }
 
     return oodate;
@@ -367,7 +367,7 @@ MakeFindChild(void *gnp, void *pgnp)
     GNode *pgn = pgnp;
 
     (void)Dir_MTime(gn, 0);
-    Make_TimeStamp(pgn, gn);
+    GNode_UpdateYoungestChild(pgn, gn);
     pgn->unmade--;
 
     return 0;
@@ -672,10 +672,10 @@ Make_Update(GNode *cgn)
 	    continue;
 	}
 
-	if ( ! (cgn->type & (OP_EXEC|OP_USE|OP_USEBEFORE))) {
+	if (!(cgn->type & (OP_EXEC | OP_USE | OP_USEBEFORE))) {
 	    if (cgn->made == MADE)
 		pgn->flags |= CHILDMADE;
-	    (void)Make_TimeStamp(pgn, cgn);
+	    GNode_UpdateYoungestChild(pgn, cgn);
 	}
 
 	/*

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.198 src/usr.bin/make/make.h:1.199
--- src/usr.bin/make/make.h:1.198	Sun Nov  8 01:39:24 2020
+++ src/usr.bin/make/make.h	Sun Nov  8 08:26:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.198 2020/11/08 01:39:24 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.199 2020/11/08 08:26:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -636,7 +636,7 @@ extern CmdOpts opts;
 
 #include "nonints.h"
 
-void Make_TimeStamp(GNode *, GNode *);
+void GNode_UpdateYoungestChild(GNode *, GNode *);
 Boolean Make_OODate(GNode *);
 void Make_ExpandUse(GNodeList *);
 time_t Make_Recheck(GNode *);

Reply via email to