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): indent job.c with tabs instead of spaces



details:   https://anonhg.NetBSD.org/src/rev/3b1a792e5b80
branches:  trunk
changeset: 946765:3b1a792e5b80
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 07 23:48:04 2020 +0000

description:
make(1): indent job.c with tabs instead of spaces

diffstat:

 usr.bin/make/job.c |  3588 ++++++++++++++++++++++++++-------------------------
 1 files changed, 1843 insertions(+), 1745 deletions(-)

diffs (truncated from 4262 to 300 lines):

diff -r 92244af2b4de -r 3b1a792e5b80 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Mon Dec 07 22:55:01 2020 +0000
+++ b/usr.bin/make/job.c        Mon Dec 07 23:48:04 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.340 2020/12/07 22:55:01 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.341 2020/12/07 23:48:04 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,9 +143,10 @@
 #include "trace.h"
 
 /*     "@(#)job.c      8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.340 2020/12/07 22:55:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.341 2020/12/07 23:48:04 rillig Exp $");
 
-/* A shell defines how the commands are run.  All commands for a target are
+/*
+ * A shell defines how the commands are run.  All commands for a target are
  * written into a single file, which is then given to the shell to execute
  * the commands from it.  The commands are written to the file using a few
  * templates for echo control and error control.
@@ -180,36 +181,42 @@
  */
 typedef struct Shell {
 
-    /* The name of the shell. For Bourne and C shells, this is used only to
-     * find the shell description when used as the single source of a .SHELL
-     * target. For user-defined shells, this is the full path of the shell. */
-    const char *name;
+       /*
+        * The name of the shell. For Bourne and C shells, this is used only
+        * to find the shell description when used as the single source of a
+        * .SHELL target. For user-defined shells, this is the full path of
+        * the shell.
+        */
+       const char *name;
 
-    Boolean hasEchoCtl;                /* True if both echoOff and echoOn defined */
-    const char *echoOff;       /* command to turn off echo */
-    const char *echoOn;                /* command to turn it back on again */
-    const char *noPrint;       /* text to skip when printing output from
+       Boolean hasEchoCtl;     /* True if both echoOff and echoOn defined */
+       const char *echoOff;    /* command to turn off echo */
+       const char *echoOn;     /* command to turn it back on again */
+       const char *noPrint;    /* text to skip when printing output from
                                 * shell. This is usually the same as echoOff */
-    size_t noPrintLen;         /* length of noPrint command */
+       size_t noPrintLen;      /* length of noPrint command */
 
-    Boolean hasErrCtl;         /* set if can control error checking for
+       Boolean hasErrCtl;      /* set if can control error checking for
                                 * individual commands */
-    /* XXX: split into errOn and echoCmd */
-    const char *errOnOrEcho;   /* template to turn on error checking */
-    /* XXX: split into errOff and execIgnore */
-    const char *errOffOrExecIgnore; /* template to turn off error checking */
-    const char *errExit;       /* template to use for testing exit code */
+       /* XXX: split into errOn and echoCmd */
+       const char *errOnOrEcho; /* template to turn on error checking */
+       /*
+        * template to turn off error checking
+        * XXX: split into errOff and execIgnore
+        */
+       const char *errOffOrExecIgnore;
+       const char *errExit;    /* template to use for testing exit code */
 
-    /* string literal that results in a newline character when it appears
-     * outside of any 'quote' or "quote" characters */
-    const char *newline;
-    char commentChar;          /* character used by shell for comment lines */
+       /* string literal that results in a newline character when it appears
+        * outside of any 'quote' or "quote" characters */
+       const char *newline;
+       char commentChar;       /* character used by shell for comment lines */
 
-    /*
-     * command-line flags
-     */
-    const char *echo;          /* echo commands */
-    const char *exit;          /* exit on error */
+       /*
+        * command-line flags
+        */
+       const char *echo;       /* echo commands */
+       const char *exit;       /* exit on error */
 } Shell;
 
 /*
@@ -217,13 +224,13 @@
  */
 static int job_errors = 0;     /* number of errors reported */
 typedef enum AbortReason {     /* why is the make aborting? */
-    ABORT_NONE,
-    ABORT_ERROR,               /* Because of an error */
-    ABORT_INTERRUPT,           /* Because it was interrupted */
-    ABORT_WAIT                 /* Waiting for jobs to finish */
+       ABORT_NONE,
+       ABORT_ERROR,            /* Because of an error */
+       ABORT_INTERRUPT,        /* Because it was interrupted */
+       ABORT_WAIT              /* Waiting for jobs to finish */
 } AbortReason;
 static AbortReason aborting = ABORT_NONE;
-#define JOB_TOKENS     "+EI+"  /* Token to requeue for each abort state */
+#define JOB_TOKENS "+EI+"      /* Token to requeue for each abort state */
 
 /*
  * this tracks the number of tokens currently "out" to build jobs.
@@ -235,9 +242,9 @@
 static int numCommands;
 
 typedef enum JobStartResult {
-    JOB_RUNNING,               /* Job is running */
-    JOB_ERROR,                 /* Error in starting the job */
-    JOB_FINISHED               /* The job is already finished */
+       JOB_RUNNING,            /* Job is running */
+       JOB_ERROR,              /* Error in starting the job */
+       JOB_FINISHED            /* The job is already finished */
 } JobStartResult;
 
 /*
@@ -270,7 +277,7 @@
 #define DEFSHELL_INDEX 0       /* DEFSHELL_INDEX_CUSTOM or DEFSHELL_INDEX_SH */
 #endif /* !DEFSHELL_INDEX */
 
-static Shell    shells[] = {
+static Shell shells[] = {
 #ifdef DEFSHELL_CUSTOM
     /*
      * An sh-compatible shell with a non-standard name.
@@ -279,88 +286,88 @@
      * non-portable features that might not be supplied by all
      * sh-compatible shells.
      */
-{
-    DEFSHELL_CUSTOM,           /* .name */
-    FALSE,                     /* .hasEchoCtl */
-    "",                                /* .echoOff */
-    "",                                /* .echoOn */
-    "",                                /* .noPrint */
-    0,                         /* .noPrintLen */
-    FALSE,                     /* .hasErrCtl */
-    "echo \"%s\"\n",           /* .errOnOrEcho */
-    "%s\n",                    /* .errOffOrExecIgnore */
-    "{ %s \n} || exit $?\n",   /* .errExit */
-    "'\n'",                    /* .newline */
-    '#',                       /* .commentChar */
-    "",                                /* .echo */
-    "",                                /* .exit */
-},
+    {
+       DEFSHELL_CUSTOM,        /* .name */
+       FALSE,                  /* .hasEchoCtl */
+       "",                     /* .echoOff */
+       "",                     /* .echoOn */
+       "",                     /* .noPrint */
+       0,                      /* .noPrintLen */
+       FALSE,                  /* .hasErrCtl */
+       "echo \"%s\"\n",        /* .errOnOrEcho */
+       "%s\n",                 /* .errOffOrExecIgnore */
+       "{ %s \n} || exit $?\n", /* .errExit */
+       "'\n'",                 /* .newline */
+       '#',                    /* .commentChar */
+       "",                     /* .echo */
+       "",                     /* .exit */
+    },
 #endif /* DEFSHELL_CUSTOM */
     /*
      * SH description. Echo control is also possible and, under
      * sun UNIX anyway, one can even control error checking.
      */
-{
-    "sh",                      /* .name */
-    FALSE,                     /* .hasEchoCtl */
-    "",                                /* .echoOff */
-    "",                                /* .echoOn */
-    "",                                /* .noPrint */
-    0,                         /* .noPrintLen */
-    FALSE,                     /* .hasErrCtl */
-    "echo \"%s\"\n",           /* .errOnOrEcho */
-    "%s\n",                    /* .errOffOrExecIgnore */
-    "{ %s \n} || exit $?\n",   /* .errExit */
-    "'\n'",                    /* .newline */
-    '#',                       /* .commentChar*/
+    {
+       "sh",                   /* .name */
+       FALSE,                  /* .hasEchoCtl */
+       "",                     /* .echoOff */
+       "",                     /* .echoOn */
+       "",                     /* .noPrint */
+       0,                      /* .noPrintLen */
+       FALSE,                  /* .hasErrCtl */
+       "echo \"%s\"\n",        /* .errOnOrEcho */
+       "%s\n",                 /* .errOffOrExecIgnore */
+       "{ %s \n} || exit $?\n", /* .errExit */
+       "'\n'",                 /* .newline */
+       '#',                    /* .commentChar*/
 #if defined(MAKE_NATIVE) && defined(__NetBSD__)
-    "q",                       /* .echo */
+       "q",                    /* .echo */
 #else
-    "",                                /* .echo */
+       "",                     /* .echo */
 #endif
-    "",                                /* .exit */
-},
+       "",                     /* .exit */
+    },
     /*
      * KSH description.
      */
-{
-    "ksh",                     /* .name */
-    TRUE,                      /* .hasEchoCtl */
-    "set +v",                  /* .echoOff */
-    "set -v",                  /* .echoOn */
-    "set +v",                  /* .noPrint */
-    6,                         /* .noPrintLen */
-    FALSE,                     /* .hasErrCtl */
-    "echo \"%s\"\n",           /* .errOnOrEcho */
-    "%s\n",                    /* .errOffOrExecIgnore */
-    "{ %s \n} || exit $?\n",   /* .errExit */
-    "'\n'",                    /* .newline */
-    '#',                       /* .commentChar */
-    "v",                       /* .echo */
-    "",                                /* .exit */
-},
+    {
+       "ksh",                  /* .name */
+       TRUE,                   /* .hasEchoCtl */
+       "set +v",               /* .echoOff */
+       "set -v",               /* .echoOn */
+       "set +v",               /* .noPrint */
+       6,                      /* .noPrintLen */
+       FALSE,                  /* .hasErrCtl */
+       "echo \"%s\"\n",        /* .errOnOrEcho */
+       "%s\n",                 /* .errOffOrExecIgnore */
+       "{ %s \n} || exit $?\n", /* .errExit */
+       "'\n'",                 /* .newline */
+       '#',                    /* .commentChar */
+       "v",                    /* .echo */
+       "",                     /* .exit */
+    },
     /*
      * CSH description. The csh can do echo control by playing
      * with the setting of the 'echo' shell variable. Sadly,
      * however, it is unable to do error control nicely.
      */
-{
-    "csh",                     /* .name */
-    TRUE,                      /* .hasEchoCtl */
-    "unset verbose",           /* .echoOff */
-    "set verbose",             /* .echoOn */
-    "unset verbose",           /* .noPrint */
-    13,                                /* .noPrintLen */
-    FALSE,                     /* .hasErrCtl */
-    "echo \"%s\"\n",           /* .errOnOrEcho */
-    /* XXX: Mismatch between errOn and execIgnore */
-    "csh -c \"%s || exit 0\"\n", /* .errOffOrExecIgnore */
-    "",                        /* .errExit */
-    "'\\\n'",                  /* .newline */
-    '#',                       /* .commentChar */
-    "v",                       /* .echo */
-    "e",                       /* .exit */
-}
+    {
+       "csh",                  /* .name */
+       TRUE,                   /* .hasEchoCtl */
+       "unset verbose",        /* .echoOff */
+       "set verbose",          /* .echoOn */
+       "unset verbose",        /* .noPrint */
+       13,                     /* .noPrintLen */
+       FALSE,                  /* .hasErrCtl */
+       "echo \"%s\"\n",        /* .errOnOrEcho */
+       /* XXX: Mismatch between errOn and execIgnore */
+       "csh -c \"%s || exit 0\"\n", /* .errOffOrExecIgnore */
+       "",                     /* .errExit */
+       "'\\\n'",               /* .newline */
+       '#',                    /* .commentChar */
+       "v",                    /* .echo */
+       "e",                    /* .exit */
+    }
 };
 
 /* This is the shell to which we pass all commands in the Makefile.
@@ -376,7 +383,7 @@
 static Job *job_table_end;     /* job_table + maxJobs */
 static unsigned int wantToken; /* we want a token */
 static Boolean lurking_children = FALSE;
-static Boolean make_suspended = FALSE; /* Whether we've seen a SIGTSTP (etc) */
+static Boolean make_suspended = FALSE; /* Whether we've seen a SIGTSTP (etc) */
 
 /*
  * Set of descriptors of pipes connected to
@@ -393,10 +400,12 @@
 static Job tokenWaitJob;       /* token wait pseudo-job */
 
 static Job childExitJob;       /* child exit pseudo-job */
-#define CHILD_EXIT     "."
-#define DO_JOB_RESUME  "R"



Home | Main Index | Thread Index | Old Index