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): move usage further to the top



details:   https://anonhg.NetBSD.org/src/rev/0dab0b029846
branches:  trunk
changeset: 942464:0dab0b029846
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 13:05:03 2020 +0000

description:
make(1): move usage further to the top

This avoids a forward declaration.

diffstat:

 usr.bin/make/main.c |  45 ++++++++++++++++++++++-----------------------
 1 files changed, 22 insertions(+), 23 deletions(-)

diffs (80 lines):

diff -r 4e7c3ea22d05 -r 0dab0b029846 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Nov 08 12:50:57 2020 +0000
+++ b/usr.bin/make/main.c       Sun Nov 08 13:05:03 2020 +0000
@@ -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 @@
 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 @@
     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 @@
 }
 
 /*
- * 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;



Home | Main Index | Thread Index | Old Index