summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-09-28 23:35:07 +0000
committerjmallett <jmallett@FreeBSD.org>2002-09-28 23:35:07 +0000
commit21a07813ecb6d52e631980a3874beb9070b358ec (patch)
tree10a7fe1fae5804f47e1e5cc182a0cc6dc1eb7138 /usr.bin/make
parentedeb25e503d73463726076b782d5243ae2ad3d53 (diff)
downloadFreeBSD-src-21a07813ecb6d52e631980a3874beb9070b358ec.zip
FreeBSD-src-21a07813ecb6d52e631980a3874beb9070b358ec.tar.gz
Make make(1) WARNS=6 clean except for const issues. This mostly involves
renaming variables to not shadow libc functions or greater scope locals. Kinda makes one wonder if the extern ones weren't meant in some of these places :) The only thing I'd still like to do WRT this is possibly combine rstat and status in compat.c -- that should be fine, as I do not think the codepaths will want both around at once. Sponsored by: Bright Path Solutions
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/compat.c10
-rw-r--r--usr.bin/make/main.c32
-rw-r--r--usr.bin/make/make.c6
-rw-r--r--usr.bin/make/parse.c22
-rw-r--r--usr.bin/make/suff.c30
-rw-r--r--usr.bin/make/targ.c6
-rw-r--r--usr.bin/make/var.c32
7 files changed, 69 insertions, 69 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 640adf4..c329760 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -188,7 +188,7 @@ CompatRunCommand (cmdp, gnp)
int reason; /* Reason for child's death */
int status; /* Description of child's death */
int cpid; /* Child actually found */
- ReturnStatus stat; /* Status of fork */
+ ReturnStatus rstat; /* Status of fork */
LstNode cmdNode; /* Node where current command is located */
char **av; /* Argument vector for thing to exec */
int argc; /* Number of arguments in av or 0 if not
@@ -347,13 +347,13 @@ CompatRunCommand (cmdp, gnp)
*/
while (1) {
- while ((stat = wait(&reason)) != cpid) {
- if (stat == -1 && errno != EINTR) {
+ while ((rstat = wait(&reason)) != cpid) {
+ if (rstat == -1 && errno != EINTR) {
break;
}
}
- if (stat > -1) {
+ if (rstat > -1) {
if (WIFSTOPPED(reason)) {
status = WSTOPSIG(reason); /* stopped */
} else if (WIFEXITED(reason)) {
@@ -388,7 +388,7 @@ CompatRunCommand (cmdp, gnp)
}
break;
} else {
- Fatal ("error in wait: %d", stat);
+ Fatal ("error in wait: %d", rstat);
/*NOTREACHED*/
}
}
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index df8778e..5b55fea8 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -778,7 +778,7 @@ main(argc, argv)
* <directory>:<directory>:<directory>...
*/
if (Var_Exists("VPATH", VAR_CMD)) {
- char *vpath, *path, *cp, savec;
+ char *vpath, *path1, *cp1, savec;
/*
* GCC stores string constants in read-only memory, but
* Var_Subst will want to write this thing, so store it
@@ -787,18 +787,18 @@ main(argc, argv)
static char VPATH[] = "${VPATH}";
vpath = Var_Subst(NULL, VPATH, VAR_CMD, FALSE);
- path = vpath;
+ path1 = vpath;
do {
/* skip to end of directory */
- for (cp = path; *cp != ':' && *cp != '\0'; cp++)
+ for (cp1 = path1; *cp != ':' && *cp != '\0'; cp++)
continue;
/* Save terminator character so know when to stop */
- savec = *cp;
- *cp = '\0';
+ savec = *cp1;
+ *cp1 = '\0';
/* Add directory to search path */
- Dir_AddDir(dirSearchPath, path);
- *cp = savec;
- path = cp + 1;
+ Dir_AddDir(dirSearchPath, path1);
+ *cp1 = savec;
+ path1 = cp1 + 1;
} while (savec == ':');
(void)free(vpath);
}
@@ -992,15 +992,15 @@ found:
*
* Results:
* A string containing the output of the command, or the empty string
- * If err is not NULL, it contains the reason for the command failure
+ * If error is not NULL, it contains the reason for the command failure
*
* Side Effects:
* The string must be freed by the caller.
*/
char *
-Cmd_Exec(cmd, err)
+Cmd_Exec(cmd, error)
char *cmd;
- char **err;
+ char **error;
{
char *args[4]; /* Args for invoking the shell */
int fds[2]; /* Pipe streams */
@@ -1013,7 +1013,7 @@ Cmd_Exec(cmd, err)
int cc;
- *err = NULL;
+ *error = NULL;
/*
* Set up arguments for shell
@@ -1027,7 +1027,7 @@ Cmd_Exec(cmd, err)
* Open a pipe for fetching its output
*/
if (pipe(fds) == -1) {
- *err = "Couldn't create pipe for \"%s\"";
+ *error = "Couldn't create pipe for \"%s\"";
goto bad;
}
@@ -1060,7 +1060,7 @@ Cmd_Exec(cmd, err)
/*NOTREACHED*/
case -1:
- *err = "Couldn't exec \"%s\"";
+ *error = "Couldn't exec \"%s\"";
goto bad;
default:
@@ -1091,13 +1091,13 @@ Cmd_Exec(cmd, err)
continue;
if (cc == -1)
- *err = "Error reading shell's output for \"%s\"";
+ *error = "Error reading shell's output for \"%s\"";
res = (char *)Buf_GetAll (buf, &cc);
Buf_Destroy (buf, FALSE);
if (status)
- *err = "\"%s\" returned non-zero status";
+ *error = "\"%s\" returned non-zero status";
/*
* Null-terminate the result, convert newlines to spaces and
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 50d48a7..a547d8f 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -511,8 +511,8 @@ Make_Update (cgn)
* of this node.
*/
if (Lst_Open (cgn->iParents) == SUCCESS) {
- char *p1;
- char *cpref = Var_Value(PREFIX, cgn, &p1);
+ char *ptr;
+ char *cpref = Var_Value(PREFIX, cgn, &ptr);
while ((ln = Lst_Next (cgn->iParents)) != NULL) {
pgn = (GNode *)Lst_Datum (ln);
@@ -521,7 +521,7 @@ Make_Update (cgn)
Var_Set (PREFIX, cpref, pgn);
}
}
- efree(p1);
+ efree(ptr);
Lst_Close (cgn->iParents);
}
}
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 80ec43e..d296fe9 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1131,11 +1131,11 @@ ParseDoDependency (line)
* If it was .NULL, the source is the suffix to use when a file
* has no valid suffix.
*/
- char savec;
+ char savech;
while (*cp && !isspace ((unsigned char) *cp)) {
cp++;
}
- savec = *cp;
+ savech = *cp;
*cp = '\0';
switch (specType) {
case Suffixes:
@@ -1156,8 +1156,8 @@ ParseDoDependency (line)
default:
break;
}
- *cp = savec;
- if (savec != '\0') {
+ *cp = savech;
+ if (savech != '\0') {
cp++;
}
while (*cp && isspace ((unsigned char) *cp)) {
@@ -1190,7 +1190,7 @@ ParseDoDependency (line)
}
if (*cp == '(') {
- GNode *gn;
+ GNode *gnp;
sources = Lst_Init (FALSE);
if (Arch_ParseArchive (&line, sources, VAR_CMD) != SUCCESS) {
@@ -1200,8 +1200,8 @@ ParseDoDependency (line)
}
while (!Lst_IsEmpty (sources)) {
- gn = (GNode *) Lst_DeQueue (sources);
- ParseDoSrc (tOp, gn->name, curSrcs);
+ gnp = (GNode *) Lst_DeQueue (sources);
+ ParseDoSrc (tOp, gnp->name, curSrcs);
}
Lst_Destroy (sources, NOFREE);
cp = line;
@@ -1479,7 +1479,7 @@ Parse_DoVar (line, ctxt)
} else if (type == VAR_SHELL) {
Boolean freeCmd = FALSE; /* TRUE if the command needs to be freed, i.e.
* if any variable expansion was performed */
- char *res, *err;
+ char *res, *error;
if (strchr(cp, '$') != NULL) {
/*
@@ -1491,12 +1491,12 @@ Parse_DoVar (line, ctxt)
freeCmd = TRUE;
}
- res = Cmd_Exec(cp, &err);
+ res = Cmd_Exec(cp, &error);
Var_Set(line, res, ctxt);
free(res);
- if (err)
- Parse_Error(PARSE_WARNING, err, cp);
+ if (error)
+ Parse_Error(PARSE_WARNING, error, cp);
if (freeCmd)
free(cp);
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 5594520..7cc1bbf 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1816,40 +1816,40 @@ SuffFindNormalDeps(gn, slst)
if (ln != NULL) {
int prefLen; /* Length of the prefix */
- Src *targ;
+ Src *target;
/*
* Allocate a Src structure to which things can be transformed
*/
- targ = (Src *)emalloc(sizeof (Src));
- targ->file = estrdup(gn->name);
- targ->suff = (Suff *)Lst_Datum(ln);
- targ->suff->refCount++;
- targ->node = gn;
- targ->parent = (Src *)NULL;
- targ->children = 0;
+ target = (Src *)emalloc(sizeof (Src));
+ target->file = estrdup(gn->name);
+ target->suff = (Suff *)Lst_Datum(ln);
+ target->suff->refCount++;
+ target->node = gn;
+ target->parent = (Src *)NULL;
+ target->children = 0;
#ifdef DEBUG_SRC
- targ->cp = Lst_Init(FALSE);
+ target->cp = Lst_Init(FALSE);
#endif
/*
* Allocate room for the prefix, whose end is found by subtracting
* the length of the suffix from the end of the name.
*/
- prefLen = (eoname - targ->suff->nameLen) - sopref;
- targ->pref = emalloc(prefLen + 1);
- memcpy(targ->pref, sopref, prefLen);
- targ->pref[prefLen] = '\0';
+ prefLen = (eoname - target->suff->nameLen) - sopref;
+ target->pref = emalloc(prefLen + 1);
+ memcpy(target->pref, sopref, prefLen);
+ target->pref[prefLen] = '\0';
/*
* Add nodes from which the target can be made
*/
- SuffAddLevel(srcs, targ);
+ SuffAddLevel(srcs, target);
/*
* Record the target so we can nuke it
*/
- (void)Lst_AtEnd(targs, (void *)targ);
+ (void)Lst_AtEnd(targs, (void *)target);
/*
* Search from this suffix's successor...
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c
index e1f68db..851b7a9 100644
--- a/usr.bin/make/targ.c
+++ b/usr.bin/make/targ.c
@@ -456,13 +456,13 @@ Targ_PrintCmd (cmd, dummy)
*-----------------------------------------------------------------------
*/
char *
-Targ_FmtTime (time)
- time_t time;
+Targ_FmtTime (modtime)
+ time_t modtime;
{
struct tm *parts;
static char buf[128];
- parts = localtime(&time);
+ parts = localtime(&modtime);
strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
buf[sizeof(buf) - 1] = '\0';
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 691dab2..3587a70 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1868,11 +1868,11 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
case 'S':
{
VarPattern pattern;
- char delim;
+ char del;
Buffer buf; /* Buffer for patterns */
pattern.flags = 0;
- delim = tstr[1];
+ del = tstr[1];
tstr += 2;
/*
@@ -1893,16 +1893,16 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
* the delimiter (expand the variable substitution).
* The result is left in the Buffer buf.
*/
- for (cp = tstr; *cp != '\0' && *cp != delim; cp++) {
+ for (cp = tstr; *cp != '\0' && *cp != del; cp++) {
if ((*cp == '\\') &&
- ((cp[1] == delim) ||
+ ((cp[1] == del) ||
(cp[1] == '$') ||
(cp[1] == '\\')))
{
Buf_AddByte(buf, (Byte)cp[1]);
cp++;
} else if (*cp == '$') {
- if (cp[1] != delim) {
+ if (cp[1] != del) {
/*
* If unescaped dollar sign not before the
* delimiter, assume it's a variable
@@ -1936,14 +1936,14 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
* If lhs didn't end with the delimiter, complain and
* return NULL
*/
- if (*cp != delim) {
+ if (*cp != del) {
*lengthPtr = cp - start + 1;
if (*freePtr) {
free(str);
}
Buf_Destroy(buf, TRUE);
Error("Unclosed substitution for %s (%c missing)",
- v->name, delim);
+ v->name, del);
return (var_Error);
}
@@ -1968,16 +1968,16 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
buf = Buf_Init(0);
tstr = cp + 1;
- for (cp = tstr; *cp != '\0' && *cp != delim; cp++) {
+ for (cp = tstr; *cp != '\0' && *cp != del; cp++) {
if ((*cp == '\\') &&
- ((cp[1] == delim) ||
+ ((cp[1] == del) ||
(cp[1] == '&') ||
(cp[1] == '\\') ||
(cp[1] == '$')))
{
Buf_AddByte(buf, (Byte)cp[1]);
cp++;
- } else if ((*cp == '$') && (cp[1] != delim)) {
+ } else if ((*cp == '$') && (cp[1] != del)) {
char *cp2;
int len;
Boolean freeIt;
@@ -2001,14 +2001,14 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
/*
* If didn't end in delimiter character, complain
*/
- if (*cp != delim) {
+ if (*cp != del) {
*lengthPtr = cp - start + 1;
if (*freePtr) {
free(str);
}
Buf_Destroy(buf, TRUE);
Error("Unclosed substitution for %s (%c missing)",
- v->name, delim);
+ v->name, del);
return (var_Error);
}
@@ -2157,10 +2157,10 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
#ifdef SUNSHCMD
case 's':
if (tstr[1] == 'h' && (tstr[2] == endc || tstr[2] == ':')) {
- char *err;
- newStr = Cmd_Exec (str, &err);
- if (err)
- Error (err, str);
+ char *error;
+ newStr = Cmd_Exec (str, &error);
+ if (error)
+ Error (error, str);
cp = tstr + 2;
termc = *cp;
break;
OpenPOWER on IntegriCloud