Move some comments around to where they belong and remove some unneccessary

gcc magic.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.229)
This commit is contained in:
Hartmut Brandt 2005-05-12 11:16:04 +00:00
parent f7a01b8dcc
commit d8549718a9
2 changed files with 34 additions and 48 deletions

View File

@ -96,6 +96,17 @@ __FBSDID("$FreeBSD$");
* Job_Touch Update a target without really updating it.
*
* Job_Wait Wait for all currently-running jobs to finish.
*
* compat.c --
* The routines in this file implement the full-compatibility
* mode of PMake. Most of the special functionality of PMake
* is available in this mode. Things not supported:
* - different shells.
* - friendly variable substitution.
*
* Interface:
* Compat_Run Initialize things for this module and recreate
* thems as need creatin'
*/
#include <sys/queue.h>
@ -487,6 +498,24 @@ static void JobInterrupt(int, int);
static void JobRestartJobs(void);
static void ProcExec(const ProcStuff *) __dead2;
/*
* The following array is used to make a fast determination of which
* commands and characters are interpreted specially by the shell.
* If a command is one of these or contains any of these characters,
* it is executed by the shell, not directly by us.
* XXX Both of these arrays should be configurable via .SHELL
*/
static const char const* sh_builtin[] = {
"alias", "cd", "eval", "exec",
"exit", "read", "set", "ulimit",
"unalias", "umask", "unset", "wait",
":", NULL
};
static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n";
static GNode *curTarg = NULL;
static GNode *ENDNode;
/**
* Replace the current process.
*/
@ -3083,36 +3112,6 @@ Cmd_Exec(const char *cmd, const char **error)
}
/*-
* compat.c --
* The routines in this file implement the full-compatibility
* mode of PMake. Most of the special functionality of PMake
* is available in this mode. Things not supported:
* - different shells.
* - friendly variable substitution.
*
* Interface:
* Compat_Run Initialize things for this module and recreate
* thems as need creatin'
*/
/*
* The following array is used to make a fast determination of which
* characters are interpreted specially by the shell. If a command
* contains any of these characters, it is executed by the shell, not
* directly by us.
*/
static const char const* sh_builtin[] = {
"alias", "cd", "eval", "exec",
"exit", "read", "set", "ulimit",
"unalias", "umask", "unset", "wait",
":", NULL
};
static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n";
static GNode *curTarg = NULL;
static GNode *ENDNode;
/*
* Interrupt handler - set flag and defer handling to the main code
*/
@ -3241,14 +3240,6 @@ Compat_RunCommand(char *cmd, GNode *gn)
char *cmd_save; /* saved cmd */
ProcStuff ps;
/*
* Avoid clobbered variable warnings by forcing the compiler
* to ``unregister'' variables
*/
#if __GNUC__
(void)&av;
(void)&errCheck;
#endif
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
doit = FALSE;
@ -3377,11 +3368,15 @@ Compat_RunCommand(char *cmd, GNode *gn)
* The child is off and running. Now all we can do is wait...
*/
reason = ProcWait(&ps);
if (interrupted)
CompatInterrupt(interrupted);
/*
* Decode and report the reason child exited, then
* indicate how we handled it.
*/
if (WIFEXITED(reason)) {
/* exited */
status = WEXITSTATUS(reason);
if (status == 0) {
return (0);

View File

@ -1384,15 +1384,6 @@ Parse_DoVar(char *line, GNode *ctxt)
char *opc; /* ptr to operator character to
* null-terminate the variable name */
/*
* Avoid clobbered variable warnings by forcing the compiler
* to ``unregister'' variables
*/
#if __GNUC__
(void)&cp;
(void)&line;
#endif
/*
* Skip to variable name
*/