Module Name:    src
Committed By:   rillig
Date:           Fri Jan  7 21:00:50 UTC 2022

Modified Files:
        src/usr.bin/make: main.c parse.c

Log Message:
make: have as few statements as possible between va_start and va_end

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.566 -r1.567 src/usr.bin/make/main.c
cvs rdiff -u -r1.632 -r1.633 src/usr.bin/make/parse.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/main.c
diff -u src/usr.bin/make/main.c:1.566 src/usr.bin/make/main.c:1.567
--- src/usr.bin/make/main.c:1.566	Fri Jan  7 20:37:25 2022
+++ src/usr.bin/make/main.c	Fri Jan  7 21:00:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.566 2022/01/07 20:37:25 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.567 2022/01/07 21:00:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.566 2022/01/07 20:37:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.567 2022/01/07 21:00:49 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -1805,9 +1805,10 @@ Error(const char *fmt, ...)
 	if (f == stdout)
 		f = stderr;
 	(void)fflush(stdout);
+
 	for (;;) {
-		va_start(ap, fmt);
 		fprintf(f, "%s: ", progname);
+		va_start(ap, fmt);
 		(void)vfprintf(f, fmt, ap);
 		va_end(ap);
 		(void)fprintf(f, "\n");
@@ -1858,9 +1859,9 @@ Punt(const char *fmt, ...)
 {
 	va_list ap;
 
-	va_start(ap, fmt);
 	(void)fflush(stdout);
 	(void)fprintf(stderr, "%s: ", progname);
+	va_start(ap, fmt);
 	(void)vfprintf(stderr, fmt, ap);
 	va_end(ap);
 	(void)fprintf(stderr, "\n");

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.632 src/usr.bin/make/parse.c:1.633
--- src/usr.bin/make/parse.c:1.632	Fri Jan  7 20:54:45 2022
+++ src/usr.bin/make/parse.c	Fri Jan  7 21:00:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.632 2022/01/07 20:54:45 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.633 2022/01/07 21:00:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.632 2022/01/07 20:54:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.633 2022/01/07 21:00:49 rillig Exp $");
 
 /*
  * A file being read.
@@ -526,8 +526,8 @@ Parse_Error(ParseErrorLevel type, const 
 		lineno = (size_t)curFile->readLines;
 	}
 
-	va_start(ap, fmt);
 	(void)fflush(stdout);
+	va_start(ap, fmt);
 	ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap);
 	va_end(ap);
 
@@ -1612,6 +1612,7 @@ VarAssign_EvalSubst(GNode *scope, const 
 	 *
 	 * TODO: Add a test that demonstrates why this code is needed,
 	 *  apart from making the debug log longer.
+	 *
 	 * XXX: The variable name is expanded up to 3 times.
 	 */
 	if (!Var_ExistsExpand(scope, name))

Reply via email to