Module Name:    src
Committed By:   rillig
Date:           Sun Nov  8 13:05:03 UTC 2020

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

Log Message:
make(1): move usage further to the top

This avoids a forward declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.449 -r1.450 src/usr.bin/make/main.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.449 src/usr.bin/make/main.c:1.450
--- src/usr.bin/make/main.c:1.449	Sun Nov  8 12:50:57 2020
+++ src/usr.bin/make/main.c	Sun Nov  8 13:05:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.449 2020/11/08 12:50:57 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.450 2020/11/08 13:05:03 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.449 2020/11/08 12:50:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.450 2020/11/08 13:05:03 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -135,7 +135,6 @@ Boolean			doing_depend;	/* Set while rea
 static Boolean		jobsRunning;	/* TRUE if the jobs might be running */
 static const char *	tracefile;
 static int		ReadMakefile(const char *);
-static void		usage(void) MAKE_ATTR_DEAD;
 static void		purge_cached_realpaths(void);
 
 static Boolean		ignorePWD;	/* if we use -C, PWD is meaningless */
@@ -181,6 +180,26 @@ explode(const char *flags)
     return st;
 }
 
+/*
+ * usage --
+ *	exit with usage message
+ */
+MAKE_ATTR_DEAD static void
+usage(void)
+{
+	char *p;
+	if ((p = strchr(progname, '[')) != NULL)
+		*p = '\0';
+
+	(void)fprintf(stderr,
+"usage: %s [-BeikNnqrstWwX] \n"
+"            [-C directory] [-D variable] [-d flags] [-f makefile]\n"
+"            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n"
+"            [-V variable] [-v variable] [variable=value] [target ...]\n",
+		      progname);
+	exit(2);
+}
+
 static void
 parse_debug_option_F(const char *modules)
 {
@@ -1993,26 +2012,6 @@ execDie(const char *af, const char *av)
 }
 
 /*
- * usage --
- *	exit with usage message
- */
-static void
-usage(void)
-{
-	char *p;
-	if ((p = strchr(progname, '[')) != NULL)
-		*p = '\0';
-
-	(void)fprintf(stderr,
-"usage: %s [-BeikNnqrstWwX] \n"
-"            [-C directory] [-D variable] [-d flags] [-f makefile]\n"
-"            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n"
-"            [-V variable] [-v variable] [variable=value] [target ...]\n",
-	    progname);
-	exit(2);
-}
-
-/*
  * realpath(3) can get expensive, cache results...
  */
 static GNode *cached_realpaths = NULL;

Reply via email to