Subject: Re: usr.bin/make
To: None <tech-toolchain@netbsd.org>
From: Max Okumoto <okumoto@ucsd.edu>
List: tech-toolchain
Date: 02/01/2005 14:48:57
This is a multi-part message in MIME format.
--------------090607050603080104090407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
James Chacon wrote:
[stuff deleted]
> Standardizing the whitespace'ing sounds fine so please send that back.
>
[stuff deleted]
Here is the patch and the modified script.
Max
--------------090607050603080104090407
Content-Type: text/plain;
name="fix_style.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="fix_style.sh"
#!/bin/sh
#
# Abstract: Fix some problems in 'C' src files.
# o remove space between function name and parameters.
# o remove (void) cast [commented out]
#
# Output from nm of the final binary executable is used to generate
# a /bin/ed script, which fixes the problems. The final executable
# is used because it should have most of the symbols. CPP macros of
# course are not found in the executable, thus they are not handled.
#
# fix_style.sh binary [srcfiles]
#
OBJECT_FILE=obj/make
OBJECT_FILE=$1
shift;
nm $OBJECT_FILE | sort -u | awk '
END { printf "w\nq\n"; }
{
if (($2 == "T") || ($2 == "t")) {
# "[tab|space]funcname (" -> "[tab|space]funcname("
printf "g/\\([\t ]\\)%s (/s//\\1%s(/g\n", $3, $3;
# "^funcname (" -> "funcname("
printf "g/^%s (/s//%s(/g\n", $3, $3;
# "(funcname (" -> "(funcname("
printf "g/(%s (/s//(%s(/g\n", $3, $3;
# "(void)[tab|space]funcname(" -> "funcname("
#printf "g/(void)\\([\t ]\\)%s(/s//%s(/g\n", $3, $3;
# "(void)funcname(" -> "funcname("
#printf "g/(void)%s(/s//%s(/g\n", $3, $3;
}
}' > /tmp/$USER.editscript.$$
for file in "$@"; do
echo -n "$file "
ed -s $file < /tmp/$USER.editscript.$$
done
echo
rm /tmp/$USER.editscript.$$
--------------090607050603080104090407
Content-Type: text/plain;
name="p1.2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="p1.2"
Index: arch.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/arch.c,v
retrieving revision 1.43
diff -u -r1.43 arch.c
--- arch.c 30 Oct 2004 20:49:05 -0000 1.43
+++ arch.c 1 Feb 2005 22:40:56 -0000
@@ -411,7 +411,7 @@
snprintf(nameBuf, sz, "%s(%s)", libName, member);
free(member);
- gn = Targ_FindNode (nameBuf, TARG_CREATE);
+ gn = Targ_FindNode(nameBuf, TARG_CREATE);
if (gn == NILGNODE) {
free(nameBuf);
return (FAILURE);
@@ -424,7 +424,7 @@
* end of the provided list.
*/
gn->type |= OP_ARCHV;
- (void) Lst_AtEnd (nodeLst, (ClientData)gn);
+ (void) Lst_AtEnd(nodeLst, (ClientData)gn);
}
}
Lst_Destroy(members, NOFREE);
@@ -433,7 +433,7 @@
size_t sz = strlen(libName) + strlen(memName) + 3;
nameBuf = emalloc(sz);
snprintf(nameBuf, sz, "%s(%s)", libName, memName);
- gn = Targ_FindNode (nameBuf, TARG_CREATE);
+ gn = Targ_FindNode(nameBuf, TARG_CREATE);
free(nameBuf);
if (gn == NILGNODE) {
return (FAILURE);
@@ -446,7 +446,7 @@
* provided list.
*/
gn->type |= OP_ARCHV;
- (void) Lst_AtEnd (nodeLst, (ClientData)gn);
+ (void) Lst_AtEnd(nodeLst, (ClientData)gn);
}
}
if (doSubst) {
@@ -549,11 +549,11 @@
member = cp + 1;
}
- ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive);
+ ln = Lst_Find(archives, (ClientData) archive, ArchFindArchive);
if (ln != NILLNODE) {
- ar = (Arch *) Lst_Datum (ln);
+ ar = (Arch *) Lst_Datum(ln);
- he = Hash_FindEntry (&ar->members, member);
+ he = Hash_FindEntry(&ar->members, member);
if (he != (Hash_Entry *) NULL) {
return ((struct ar_hdr *) Hash_GetValue (he));
@@ -567,7 +567,7 @@
strncpy(copy, member, AR_MAX_NAME_LEN);
copy[AR_MAX_NAME_LEN] = '\0';
}
- if ((he = Hash_FindEntry (&ar->members, copy)) != NULL)
+ if ((he = Hash_FindEntry(&ar->members, copy)) != NULL)
return ((struct ar_hdr *) Hash_GetValue (he));
return ((struct ar_hdr *) NULL);
}
@@ -613,10 +613,10 @@
}
ar = (Arch *)emalloc (sizeof (Arch));
- ar->name = estrdup (archive);
+ ar->name = estrdup(archive);
ar->fnametab = NULL;
ar->fnamesize = 0;
- Hash_InitTable (&ar->members, -1);
+ Hash_InitTable(&ar->members, -1);
memName[AR_MAX_NAME_LEN] = '\0';
while (fread ((char *)&arh, sizeof (struct ar_hdr), 1, arch) == 1) {
@@ -687,7 +687,7 @@
}
#endif
- he = Hash_CreateEntry (&ar->members, memName, (Boolean *)NULL);
+ he = Hash_CreateEntry(&ar->members, memName, (Boolean *)NULL);
Hash_SetValue (he, (ClientData)emalloc (sizeof (struct ar_hdr)));
memcpy ((Address)Hash_GetValue (he), (Address)&arh,
sizeof (struct ar_hdr));
@@ -697,13 +697,13 @@
fclose (arch);
- (void) Lst_AtEnd (archives, (ClientData) ar);
+ (void) Lst_AtEnd(archives, (ClientData) ar);
/*
* Now that the archive has been read and cached, we can look into
* the hash table to find the desired member's header.
*/
- he = Hash_FindEntry (&ar->members, member);
+ he = Hash_FindEntry(&ar->members, member);
if (he != (Hash_Entry *) NULL) {
return ((struct ar_hdr *) Hash_GetValue (he));
@@ -713,7 +713,7 @@
badarch:
fclose (arch);
- Hash_DeleteTable (&ar->members);
+ Hash_DeleteTable(&ar->members);
if (ar->fnametab)
free(ar->fnametab);
free ((Address)ar);
@@ -997,8 +997,8 @@
struct ar_hdr arh; /* Current header describing member */
char *p1, *p2;
- arch = ArchFindMember(Var_Value (ARCHIVE, gn, &p1),
- Var_Value (MEMBER, gn, &p2),
+ arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1),
+ Var_Value(MEMBER, gn, &p2),
&arh, "r+");
if (p1)
free(p1);
@@ -1042,7 +1042,7 @@
struct ar_hdr arh; /* Header describing table of contents */
struct utimbuf times; /* Times for utime() call */
- arch = ArchFindMember (gn->path, UNCONST(RANLIBMAG), &arh, "r+");
+ arch = ArchFindMember(gn->path, UNCONST(RANLIBMAG), &arh, "r+");
snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
if (arch != (FILE *) NULL) {
@@ -1079,8 +1079,8 @@
time_t modTime; /* Modification time as an integer */
char *p1, *p2;
- arhPtr = ArchStatMember (Var_Value (ARCHIVE, gn, &p1),
- Var_Value (MEMBER, gn, &p2),
+ arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1),
+ Var_Value(MEMBER, gn, &p2),
TRUE);
if (p1)
free(p1);
@@ -1119,12 +1119,12 @@
char *nameStart,
*nameEnd;
- if (Lst_Open (gn->parents) != SUCCESS) {
+ if (Lst_Open(gn->parents) != SUCCESS) {
gn->mtime = 0;
return (0);
}
- while ((ln = Lst_Next (gn->parents)) != NILLNODE) {
- pgn = (GNode *) Lst_Datum (ln);
+ while ((ln = Lst_Next(gn->parents)) != NILLNODE) {
+ pgn = (GNode *) Lst_Datum(ln);
if (pgn->type & OP_ARCHV) {
/*
@@ -1151,7 +1151,7 @@
}
}
- Lst_Close (gn->parents);
+ Lst_Close(gn->parents);
return (gn->mtime);
}
@@ -1189,14 +1189,14 @@
libName = (char *)emalloc(sz);
snprintf(libName, sz, "lib%s.a", &gn->name[2]);
- gn->path = Dir_FindFile (libName, path);
+ gn->path = Dir_FindFile(libName, path);
free (libName);
#ifdef LIBRARIES
- Var_Set (TARGET, gn->name, gn, 0);
+ Var_Set(TARGET, gn->name, gn, 0);
#else
- Var_Set (TARGET, gn->path == (char *) NULL ? gn->name : gn->path, gn, 0);
+ Var_Set(TARGET, gn->path == (char *) NULL ? gn->name : gn->path, gn, 0);
#endif /* LIBRARIES */
}
@@ -1256,7 +1256,7 @@
struct ar_hdr *arhPtr; /* Header for __.SYMDEF */
int modTimeTOC; /* The table-of-contents's mod time */
- arhPtr = ArchStatMember (gn->path, UNCONST(RANLIBMAG), FALSE);
+ arhPtr = ArchStatMember(gn->path, UNCONST(RANLIBMAG), FALSE);
if (arhPtr != (struct ar_hdr *)NULL) {
modTimeTOC = (int) strtol(arhPtr->ar_date, NULL, 10);
@@ -1297,7 +1297,7 @@
void
Arch_Init(void)
{
- archives = Lst_Init (FALSE);
+ archives = Lst_Init(FALSE);
}
Index: compat.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/compat.c,v
retrieving revision 1.55
diff -u -r1.55 compat.c
--- compat.c 1 Jul 2004 04:39:30 -0000 1.55
+++ compat.c 1 Feb 2005 22:40:57 -0000
@@ -162,7 +162,7 @@
if ((curTarg != NILGNODE) && !Targ_Precious (curTarg)) {
char *p1;
- char *file = Var_Value (TARGET, curTarg, &p1);
+ char *file = Var_Value(TARGET, curTarg, &p1);
if (!noExecute && eunlink(file) != -1) {
Error("*** %s removed", file);
@@ -236,8 +236,8 @@
errCheck = !(gn->type & OP_IGNORE);
doIt = FALSE;
- cmdNode = Lst_Member (gn->commands, (ClientData)cmd);
- cmdStart = Var_Subst (NULL, cmd, gn, FALSE);
+ cmdNode = Lst_Member(gn->commands, (ClientData)cmd);
+ cmdStart = Var_Subst(NULL, cmd, gn, FALSE);
/*
* brk_string will return an argv with a NULL in av[0], thus causing
@@ -253,7 +253,7 @@
} else {
cmd = cmdStart;
}
- Lst_Replace (cmdNode, (ClientData)cmdStart);
+ Lst_Replace(cmdNode, (ClientData)cmdStart);
if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
(void)Lst_AtEnd(ENDNode->commands, (ClientData)cmdStart);
@@ -359,7 +359,7 @@
free(av);
free(bp);
}
- Lst_Replace (cmdNode, (ClientData) NULL);
+ Lst_Replace(cmdNode, (ClientData) NULL);
/*
* The child is off and running. Now all we can do is wait...
@@ -422,7 +422,7 @@
}
break;
} else {
- Fatal ("error in wait: %d: %s", retstat, strerror(errno));
+ Fatal("error in wait: %d: %s", retstat, strerror(errno));
/*NOTREACHED*/
}
}
@@ -466,17 +466,17 @@
gn->flags |= REMAKE;
gn->made = BEINGMADE;
if ((gn->type & OP_MADE) == 0)
- Suff_FindDeps (gn);
- Lst_ForEach (gn->children, CompatMake, (ClientData)gn);
+ Suff_FindDeps(gn);
+ Lst_ForEach(gn->children, CompatMake, (ClientData)gn);
if ((gn->flags & REMAKE) == 0) {
gn->made = ABORTED;
pgn->flags &= ~REMAKE;
goto cohorts;
}
- if (Lst_Member (gn->iParents, pgn) != NILLNODE) {
+ if (Lst_Member(gn->iParents, pgn) != NILLNODE) {
char *p1;
- Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
+ Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
if (p1)
free(p1);
}
@@ -519,24 +519,24 @@
* Alter our type to tell if errors should be ignored or things
* should not be printed so CompatRunCommand knows what to do.
*/
- if (Targ_Ignore (gn)) {
+ if (Targ_Ignore(gn)) {
gn->type |= OP_IGNORE;
}
- if (Targ_Silent (gn)) {
+ if (Targ_Silent(gn)) {
gn->type |= OP_SILENT;
}
- if (Job_CheckCommands (gn, Fatal)) {
+ if (Job_CheckCommands(gn, Fatal)) {
/*
* Our commands are ok, but we still have to worry about the -t
* flag...
*/
if (!touchFlag || (gn->type & OP_MAKE)) {
curTarg = gn;
- Lst_ForEach (gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
curTarg = NILGNODE;
} else {
- Job_Touch (gn, gn->type & OP_SILENT);
+ Job_Touch(gn, gn->type & OP_SILENT);
}
} else {
gn->made = ERROR;
@@ -568,9 +568,9 @@
*/
pgn->flags &= ~REMAKE;
} else {
- if (Lst_Member (gn->iParents, pgn) != NILLNODE) {
+ if (Lst_Member(gn->iParents, pgn) != NILLNODE) {
char *p1;
- Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
+ Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0);
if (p1)
free(p1);
}
@@ -597,7 +597,7 @@
}
cohorts:
- Lst_ForEach (gn->cohorts, CompatMake, pgnp);
+ Lst_ForEach(gn->cohorts, CompatMake, pgnp);
return (0);
}
@@ -672,8 +672,8 @@
*/
errors = 0;
while (!Lst_IsEmpty (targs)) {
- gn = (GNode *) Lst_DeQueue (targs);
- CompatMake (gn, gn);
+ gn = (GNode *) Lst_DeQueue(targs);
+ CompatMake(gn, gn);
if (gn->made == UPTODATE) {
printf ("`%s' is up to date.\n", gn->name);
Index: cond.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/cond.c,v
retrieving revision 1.24
diff -u -r1.24 cond.c
--- cond.c 7 May 2004 00:04:38 -0000 1.24
+++ cond.c 1 Feb 2005 22:40:58 -0000
@@ -292,7 +292,7 @@
cp++;
}
if (parens && *cp != ')') {
- Parse_Error (PARSE_WARNING, "Missing closing parenthesis for %s()",
+ Parse_Error(PARSE_WARNING, "Missing closing parenthesis for %s()",
func);
return (0);
} else if (parens) {
@@ -327,7 +327,7 @@
Boolean result;
arg[argLen] = '\0';
- if (Var_Value (arg, VAR_CMD, &p1) != (char *)NULL) {
+ if (Var_Value(arg, VAR_CMD, &p1) != (char *)NULL) {
result = TRUE;
} else {
result = FALSE;
@@ -378,7 +378,7 @@
Boolean result;
arg[argLen] = '\0';
- if (Lst_Find (create, (ClientData)arg, CondStrMatch) == NILLNODE) {
+ if (Lst_Find(create, (ClientData)arg, CondStrMatch) == NILLNODE) {
result = FALSE;
} else {
result = TRUE;
@@ -849,7 +849,7 @@
*/
evalProc = CondDoDefined;
condExpr += 7;
- arglen = CondGetArg (&condExpr, &arg, "defined", TRUE);
+ arglen = CondGetArg(&condExpr, &arg, "defined", TRUE);
if (arglen == 0) {
condExpr -= 7;
goto use_default;
@@ -862,7 +862,7 @@
*/
evalProc = CondDoMake;
condExpr += 4;
- arglen = CondGetArg (&condExpr, &arg, "make", TRUE);
+ arglen = CondGetArg(&condExpr, &arg, "make", TRUE);
if (arglen == 0) {
condExpr -= 4;
goto use_default;
@@ -1074,7 +1074,7 @@
/*
* F -> T
*/
- CondPushBack (o);
+ CondPushBack(o);
}
}
return (l);
@@ -1121,7 +1121,7 @@
/*
* E -> F
*/
- CondPushBack (o);
+ CondPushBack(o);
}
}
return (l);
@@ -1176,7 +1176,7 @@
case Err:
err:
if (eprint)
- Parse_Error (PARSE_FATAL, "Malformed conditional (%s)",
+ Parse_Error(PARSE_FATAL, "Malformed conditional (%s)",
line);
return (COND_INVALID);
default:
@@ -1247,7 +1247,7 @@
return (COND_SKIP);
} else {
if (condTop == MAXIF) {
- Parse_Error (level, "if-less endif");
+ Parse_Error(level, "if-less endif");
return (COND_INVALID);
} else {
skipLine = FALSE;
@@ -1277,12 +1277,12 @@
*/
if (isElse && (line[0] == 's') && (line[1] == 'e')) {
if (finalElse[condTop][skipIfLevel]) {
- Parse_Error (PARSE_WARNING, "extra else");
+ Parse_Error(PARSE_WARNING, "extra else");
} else {
finalElse[condTop][skipIfLevel] = TRUE;
}
if (condTop == MAXIF) {
- Parse_Error (level, "if-less else");
+ Parse_Error(level, "if-less else");
return (COND_INVALID);
} else if (skipIfLevel == 0) {
value = !condStack[condTop];
@@ -1298,7 +1298,7 @@
} else {
if (isElse) {
if (condTop == MAXIF) {
- Parse_Error (level, "if-less elif");
+ Parse_Error(level, "if-less elif");
return (COND_INVALID);
} else if (skipIfLevel != 0) {
/*
@@ -1316,7 +1316,7 @@
*/
skipIfLevel += 1;
if (skipIfLevel >= MAXIF) {
- Parse_Error (PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
+ Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
return (COND_INVALID);
}
finalElse[condTop][skipIfLevel] = FALSE;
@@ -1353,7 +1353,7 @@
* This is the one case where we can definitely proclaim a fatal
* error. If we don't, we're hosed.
*/
- Parse_Error (PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
+ Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
return (COND_INVALID);
} else {
condStack[condTop] = value;
Index: dir.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/dir.c,v
retrieving revision 1.44
diff -u -r1.44 dir.c
--- dir.c 29 Dec 2004 00:43:02 -0000 1.44
+++ dir.c 1 Feb 2005 22:40:59 -0000
@@ -268,26 +268,26 @@
*-----------------------------------------------------------------------
*/
void
-Dir_Init (const char *cdname)
+Dir_Init(const char *cdname)
{
- dirSearchPath = Lst_Init (FALSE);
- openDirectories = Lst_Init (FALSE);
+ dirSearchPath = Lst_Init(FALSE);
+ openDirectories = Lst_Init(FALSE);
Hash_InitTable(&mtimes, 0);
Dir_InitCur(cdname);
- dotLast = (Path *) emalloc (sizeof (Path));
+ dotLast = (Path *) emalloc(sizeof (Path));
dotLast->refCount = 1;
dotLast->hits = 0;
dotLast->name = estrdup(".DOTLAST");
- Hash_InitTable (&dotLast->files, -1);
+ Hash_InitTable(&dotLast->files, -1);
}
/*
* Called by Dir_Init() and whenever .CURDIR is assigned to.
*/
void
-Dir_InitCur (const char *cdname)
+Dir_InitCur(const char *cdname)
{
Path *p;
@@ -329,11 +329,11 @@
LstNode ln;
/* Remove old entry from openDirectories, but do not destroy. */
- ln = Lst_Member (openDirectories, (ClientData)dot);
- (void) Lst_Remove (openDirectories, ln);
+ ln = Lst_Member(openDirectories, (ClientData)dot);
+ (void) Lst_Remove(openDirectories, ln);
}
- dot = Dir_AddDir (NULL, ".");
+ dot = Dir_AddDir(NULL, ".");
if (dot == NULL) {
Error("Cannot open `.' (%s)", strerror(errno));
@@ -386,7 +386,7 @@
* This is the simplest way to deal with the effect of .DOTLAST.
*/
void
-Dir_SetPATH (void)
+Dir_SetPATH(void)
{
LstNode ln; /* a list element */
Path *p;
@@ -394,9 +394,9 @@
Var_Delete(".PATH", VAR_GLOBAL);
- if (Lst_Open (dirSearchPath) == SUCCESS) {
- if ((ln = Lst_First (dirSearchPath)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ if (Lst_Open(dirSearchPath) == SUCCESS) {
+ if ((ln = Lst_First(dirSearchPath)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast) {
hasLastDot = TRUE;
Var_Append(".PATH", dotLast->name, VAR_GLOBAL);
@@ -410,8 +410,8 @@
Var_Append(".PATH", cur->name, VAR_GLOBAL);
}
- while ((ln = Lst_Next (dirSearchPath)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ while ((ln = Lst_Next(dirSearchPath)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast)
continue;
if (p == dot && hasLastDot)
@@ -869,10 +869,10 @@
printf(" %s ...\n", p->name);
}
- if (Hash_FindEntry (&p->files, cp) == (Hash_Entry *)NULL)
+ if (Hash_FindEntry(&p->files, cp) == (Hash_Entry *)NULL)
return NULL;
- file = str_concat (p->name, cp, STR_ADDSLASH);
+ file = str_concat(p->name, cp, STR_ADDSLASH);
if (DEBUG(DIR)) {
printf(" returning %s\n", file);
}
@@ -904,7 +904,7 @@
char *file; /* the current filename to check */
if (p != dot) {
- file = str_concat (p->name, name, STR_ADDSLASH);
+ file = str_concat(p->name, name, STR_ADDSLASH);
} else {
/*
* Checking in dot -- DON'T put a leading ./ on the thing.
@@ -973,7 +973,7 @@
return NULL;
}
- if (Hash_FindEntry (&p->files, cp) == (Hash_Entry *)NULL) {
+ if (Hash_FindEntry(&p->files, cp) == (Hash_Entry *)NULL) {
if (DEBUG(DIR)) {
printf(" must be here but isn't -- returning\n");
}
@@ -986,7 +986,7 @@
if (DEBUG(DIR)) {
printf(" returning %s\n", name);
}
- return (estrdup (name));
+ return (estrdup(name));
}
/*-
@@ -1006,22 +1006,22 @@
DirFindDot(Boolean hasSlash __unused, const char *name, const char *cp)
{
- if (Hash_FindEntry (&dot->files, cp) != (Hash_Entry *)NULL) {
+ if (Hash_FindEntry(&dot->files, cp) != (Hash_Entry *)NULL) {
if (DEBUG(DIR)) {
printf(" in '.'\n");
}
hits += 1;
dot->hits += 1;
- return (estrdup (name));
+ return (estrdup(name));
}
if (cur &&
- Hash_FindEntry (&cur->files, cp) != (Hash_Entry *)NULL) {
+ Hash_FindEntry(&cur->files, cp) != (Hash_Entry *)NULL) {
if (DEBUG(DIR)) {
printf(" in ${.CURDIR} = %s\n", cur->name);
}
hits += 1;
cur->hits += 1;
- return str_concat (cur->name, cp, STR_ADDSLASH);
+ return str_concat(cur->name, cp, STR_ADDSLASH);
}
return NULL;
@@ -1078,7 +1078,7 @@
printf("Searching for %s ...", name);
}
- if (Lst_Open (path) == FAILURE) {
+ if (Lst_Open(path) == FAILURE) {
if (DEBUG(DIR)) {
printf("couldn't open path, file not found\n");
}
@@ -1086,8 +1086,8 @@
return ((char *) NULL);
}
- if ((ln = Lst_First (path)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ if ((ln = Lst_First(path)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast) {
hasLastDot = TRUE;
if (DEBUG(DIR))
@@ -1120,27 +1120,27 @@
*/
if (!hasLastDot &&
(file = DirFindDot(hasSlash, name, cp)) != NULL) {
- Lst_Close (path);
+ Lst_Close(path);
return file;
}
- while ((ln = Lst_Next (path)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ while ((ln = Lst_Next(path)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast)
continue;
if ((file = DirLookup(p, name, cp, hasSlash)) != NULL) {
- Lst_Close (path);
+ Lst_Close(path);
return file;
}
}
if (hasLastDot &&
(file = DirFindDot(hasSlash, name, cp)) != NULL) {
- Lst_Close (path);
+ Lst_Close(path);
return file;
}
}
- Lst_Close (path);
+ Lst_Close(path);
/*
* We didn't find the file on any directory in the search path.
@@ -1181,9 +1181,9 @@
return file;
}
- (void) Lst_Open (path);
- while ((ln = Lst_Next (path)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ (void) Lst_Open(path);
+ while ((ln = Lst_Next(path)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast)
continue;
if (p == dot) {
@@ -1192,11 +1192,11 @@
checkedDot = TRUE;
}
if ((file = DirLookupSubdir(p, name)) != NULL) {
- Lst_Close (path);
+ Lst_Close(path);
return file;
}
}
- Lst_Close (path);
+ Lst_Close(path);
if (hasLastDot) {
if (dot && !checkedDot) {
@@ -1237,17 +1237,17 @@
if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
return *file?file:NULL;
- (void) Lst_Open (path);
- while ((ln = Lst_Next (path)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ (void) Lst_Open(path);
+ while ((ln = Lst_Next(path)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
if (p == dotLast)
continue;
if ((file = DirLookupAbs(p, name, cp)) != NULL) {
- Lst_Close (path);
+ Lst_Close(path);
return *file?file:NULL;
}
}
- Lst_Close (path);
+ Lst_Close(path);
if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL)
return *file?file:NULL;
@@ -1272,19 +1272,19 @@
*/
#ifdef notdef
cp[-1] = '\0';
- (void) Dir_AddDir (path, name);
+ (void) Dir_AddDir(path, name);
cp[-1] = '/';
bigmisses += 1;
- ln = Lst_Last (path);
+ ln = Lst_Last(path);
if (ln == NILLNODE) {
return ((char *) NULL);
} else {
- p = (Path *) Lst_Datum (ln);
+ p = (Path *) Lst_Datum(ln);
}
- if (Hash_FindEntry (&p->files, cp) != (Hash_Entry *)NULL) {
- return (estrdup (name));
+ if (Hash_FindEntry(&p->files, cp) != (Hash_Entry *)NULL) {
+ return (estrdup(name));
} else {
return ((char *) NULL);
}
@@ -1307,7 +1307,7 @@
name);
}
Hash_SetValue(entry, (long)stb.st_mtime);
- return (estrdup (name));
+ return (estrdup(name));
} else {
if (DEBUG(DIR)) {
printf(" failed. Returning NULL\n");
@@ -1422,7 +1422,7 @@
Hash_Entry *entry;
if (gn->type & OP_ARCHV) {
- return Arch_MTime (gn);
+ return Arch_MTime(gn);
} else if (gn->type & OP_PHONY) {
gn->mtime = 0;
return 0;
@@ -1430,7 +1430,7 @@
if (gn->type & OP_NOPATH)
fullName = NULL;
else
- fullName = Dir_FindFile (gn->name, Suff_FindPath(gn));
+ fullName = Dir_FindFile(gn->name, Suff_FindPath(gn));
} else {
fullName = gn->path;
}
@@ -1456,7 +1456,7 @@
if (gn->type & OP_MEMBER) {
if (fullName != gn->path)
free(fullName);
- return Arch_MemMTime (gn);
+ return Arch_MemMTime(gn);
} else {
stb.st_mtime = 0;
}
@@ -1498,7 +1498,7 @@
struct dirent *dp; /* entry in directory */
if (strcmp(name, ".DOTLAST") == 0) {
- ln = Lst_Find (path, (ClientData)UNCONST(name), DirFindName);
+ ln = Lst_Find(path, (ClientData)UNCONST(name), DirFindName);
if (ln != NILLNODE)
return (Path *) Lst_Datum(ln);
else {
@@ -1508,7 +1508,7 @@
}
if (path)
- ln = Lst_Find (openDirectories, (ClientData)UNCONST(name), DirFindName);
+ ln = Lst_Find(openDirectories, (ClientData)UNCONST(name), DirFindName);
if (ln != NILLNODE) {
p = (Path *)Lst_Datum (ln);
if (Lst_Member(path, (ClientData)p) == NILLNODE) {
@@ -1522,11 +1522,11 @@
}
if ((d = opendir (name)) != (DIR *) NULL) {
- p = (Path *) emalloc (sizeof (Path));
- p->name = estrdup (name);
+ p = (Path *) emalloc(sizeof (Path));
+ p->name = estrdup(name);
p->hits = 0;
p->refCount = 1;
- Hash_InitTable (&p->files, -1);
+ Hash_InitTable(&p->files, -1);
while ((dp = readdir (d)) != (struct dirent *) NULL) {
#if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */
@@ -1604,17 +1604,17 @@
LstNode ln; /* the node of the current directory */
Path *p; /* the structure describing the current directory */
- str = estrdup ("");
+ str = estrdup("");
- if (Lst_Open (path) == SUCCESS) {
- while ((ln = Lst_Next (path)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
- s2 = str_concat (flag, p->name, 0);
- str = str_concat (s1 = str, s2, STR_ADDSPACE);
+ if (Lst_Open(path) == SUCCESS) {
+ while ((ln = Lst_Next(path)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
+ s2 = str_concat(flag, p->name, 0);
+ str = str_concat(s1 = str, s2, STR_ADDSPACE);
free(s1);
free(s2);
}
- Lst_Close (path);
+ Lst_Close(path);
}
return (str);
@@ -1647,10 +1647,10 @@
if (p->refCount == 0) {
LstNode ln;
- ln = Lst_Member (openDirectories, (ClientData)p);
- (void) Lst_Remove (openDirectories, ln);
+ ln = Lst_Member(openDirectories, (ClientData)p);
+ (void) Lst_Remove(openDirectories, ln);
- Hash_DeleteTable (&p->files);
+ Hash_DeleteTable(&p->files);
free((Address)p->name);
free((Address)p);
}
@@ -1730,12 +1730,12 @@
(hits+bigmisses+nearmisses ?
hits * 100 / (hits + bigmisses + nearmisses) : 0));
printf ("# %-20s referenced\thits\n", "directory");
- if (Lst_Open (openDirectories) == SUCCESS) {
- while ((ln = Lst_Next (openDirectories)) != NILLNODE) {
- p = (Path *) Lst_Datum (ln);
+ if (Lst_Open(openDirectories) == SUCCESS) {
+ while ((ln = Lst_Next(openDirectories)) != NILLNODE) {
+ p = (Path *) Lst_Datum(ln);
printf ("# %-20s %10d\t%4d\n", p->name, p->refCount, p->hits);
}
- Lst_Close (openDirectories);
+ Lst_Close(openDirectories);
}
}
@@ -1749,5 +1749,5 @@
void
Dir_PrintPath(Lst path)
{
- Lst_ForEach (path, DirPrintDir, (ClientData)0);
+ Lst_ForEach(path, DirPrintDir, (ClientData)0);
}
Index: for.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/for.c,v
retrieving revision 1.17
diff -u -r1.17 for.c
--- for.c 7 May 2004 00:04:38 -0000 1.17
+++ for.c 1 Feb 2005 22:40:59 -0000
@@ -269,7 +269,7 @@
if (DEBUG(FOR))
(void) fprintf(stderr, "For: end for %d\n", forLevel);
if (--forLevel < 0) {
- Parse_Error (level, "for-less endfor");
+ Parse_Error(level, "for-less endfor");
return 0;
}
}
Index: job.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/job.c,v
retrieving revision 1.88
diff -u -r1.88 job.c
--- job.c 31 Jan 2005 22:41:43 -0000 1.88
+++ job.c 1 Feb 2005 22:41:02 -0000
@@ -2580,7 +2580,7 @@
* NOTE: IT IS THE RESPONSIBILITY OF Rmt_Wait TO CALL Job_CatchChildren
* IN A TIMELY FASHION TO CATCH ANY LOCALLY RUNNING JOBS THAT EXIT.
* It may use the variable nLocal to determine if it needs to call
- * Job_CatchChildren (if nLocal is 0, there's nothing for which to
+ * Job_CatchChildren(if nLocal is 0, there's nothing for which to
* wait...)
*/
while (nJobs != 0 && pnJobs == nJobs) {
@@ -3528,7 +3528,7 @@
char jobarg[64];
if (pipe(job_pipe) < 0)
- Fatal ("error in pipe: %s", strerror(errno));
+ Fatal("error in pipe: %s", strerror(errno));
/*
* We mark the input side of the pipe non-blocking; we poll(2) the
Index: main.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/main.c,v
retrieving revision 1.105
diff -u -r1.105 main.c
--- main.c 13 Jul 2004 11:59:12 -0000 1.105
+++ main.c 1 Feb 2005 22:41:04 -0000
@@ -895,7 +895,7 @@
if (!noBuiltins) {
LstNode ln;
- sysMkPath = Lst_Init (FALSE);
+ sysMkPath = Lst_Init(FALSE);
Dir_Expand(_PATH_DEFSYSMK,
Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath,
sysMkPath);
@@ -1395,7 +1395,7 @@
*/
(void) close(fds[1]);
- buf = Buf_Init (MAKE_BSIZE);
+ buf = Buf_Init(MAKE_BSIZE);
do {
char result[BUFSIZ];
@@ -1417,7 +1417,7 @@
continue;
res = (char *)Buf_GetAll (buf, &cc);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
if (cc == 0)
*err = "Couldn't read shell's output for \"%s\"";
Index: make.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/make.c,v
retrieving revision 1.55
diff -u -r1.55 make.c
--- make.c 1 Jul 2004 20:38:09 -0000 1.55
+++ make.c 1 Feb 2005 22:41:05 -0000
@@ -208,7 +208,7 @@
* doesn't depend on their modification time...
*/
if ((gn->type & (OP_JOIN|OP_USE|OP_USEBEFORE|OP_EXEC)) == 0) {
- (void) Dir_MTime (gn);
+ (void) Dir_MTime(gn);
if (DEBUG(MAKE)) {
if (gn->mtime != 0) {
printf ("modified %s...", Targ_FmtTime(gn->mtime));
@@ -251,7 +251,7 @@
* always out of date if no children and :: target
* or non-existent.
*/
- oodate = (gn->mtime == 0 || Arch_LibOODate (gn) ||
+ oodate = (gn->mtime == 0 || Arch_LibOODate(gn) ||
(gn->cmtime == 0 && (gn->type & OP_DOUBLEDEP)));
} else if (gn->type & OP_JOIN) {
/*
@@ -325,7 +325,7 @@
* thinking they're out-of-date.
*/
if (!oodate) {
- Lst_ForEach (gn->parents, MakeTimeStamp, (ClientData)gn);
+ Lst_ForEach(gn->parents, MakeTimeStamp, (ClientData)gn);
}
return (oodate);
@@ -434,20 +434,20 @@
* prepend the child's commands to the parent.
*/
Lst cmds = pgn->commands;
- pgn->commands = Lst_Duplicate (cgn->commands, NOCOPY);
- (void) Lst_Concat (pgn->commands, cmds, LST_CONCNEW);
- Lst_Destroy (cmds, NOFREE);
+ pgn->commands = Lst_Duplicate(cgn->commands, NOCOPY);
+ (void) Lst_Concat(pgn->commands, cmds, LST_CONCNEW);
+ Lst_Destroy(cmds, NOFREE);
} else {
/*
* .USE or target has no commands --
* append the child's commands to the parent.
*/
- (void) Lst_Concat (pgn->commands, cgn->commands, LST_CONCNEW);
+ (void) Lst_Concat(pgn->commands, cgn->commands, LST_CONCNEW);
}
}
- if (Lst_Open (cgn->children) == SUCCESS) {
- while ((ln = Lst_Next (cgn->children)) != NILLNODE) {
+ if (Lst_Open(cgn->children) == SUCCESS) {
+ while ((ln = Lst_Next(cgn->children)) != NILLNODE) {
GNode *tgn, *gn = (GNode *)Lst_Datum (ln);
/*
@@ -470,11 +470,11 @@
gn = tgn;
}
- (void) Lst_AtEnd (pgn->children, gn);
- (void) Lst_AtEnd (gn->parents, pgn);
+ (void) Lst_AtEnd(pgn->children, gn);
+ (void) Lst_AtEnd(gn->parents, pgn);
pgn->unmade += 1;
}
- Lst_Close (cgn->children);
+ Lst_Close(cgn->children);
}
pgn->type |= cgn->type & ~(OP_OPMASK|OP_USE|OP_USEBEFORE|OP_TRANSFORM);
@@ -525,7 +525,7 @@
* children the parent has. This is used by Make_Run to decide
* whether to queue the parent or examine its children...
*/
- if ((ln = Lst_Member (pgn->children, (ClientData) cgn)) != NILLNODE) {
+ if ((ln = Lst_Member(pgn->children, (ClientData) cgn)) != NILLNODE) {
Lst_Remove(pgn->children, ln);
pgn->unmade--;
}
@@ -665,7 +665,7 @@
Lst parents;
GNode *centurion;
- cname = Var_Value (TARGET, cgn, &p1);
+ cname = Var_Value(TARGET, cgn, &p1);
if (p1)
free(p1);
@@ -687,14 +687,14 @@
Punt("%s: cohort has parents", cgn->name);
centurion->unmade_cohorts -= 1;
if (centurion->unmade_cohorts < 0)
- Error ("Graph cycles through centurion %s", centurion->name);
+ Error("Graph cycles through centurion %s", centurion->name);
parents = centurion->parents;
} else {
centurion = cgn;
parents = cgn->parents;
}
- if (Lst_Open (parents) == SUCCESS) {
- while ((ln = Lst_Next (parents)) != NILLNODE) {
+ if (Lst_Open(parents) == SUCCESS) {
+ while ((ln = Lst_Next(parents)) != NILLNODE) {
pgn = (GNode *)Lst_Datum (ln);
if (mtime == 0)
pgn->flags |= FORCE;
@@ -728,10 +728,10 @@
*/
(void)Lst_EnQueue (toBeMade, (ClientData)pgn);
} else if (pgn->unmade < 0) {
- Error ("Graph cycles through %s", pgn->name);
+ Error("Graph cycles through %s", pgn->name);
}
}
- Lst_Close (parents);
+ Lst_Close(parents);
}
/*
* Deal with successor nodes. If any is marked for making and has an unmade
@@ -755,20 +755,20 @@
* Set the .PREFIX and .IMPSRC variables for all the implied parents
* of this node.
*/
- if (Lst_Open (cgn->iParents) == SUCCESS) {
+ if (Lst_Open(cgn->iParents) == SUCCESS) {
char *cpref = Var_Value(PREFIX, cgn, &p1);
- while ((ln = Lst_Next (cgn->iParents)) != NILLNODE) {
+ while ((ln = Lst_Next(cgn->iParents)) != NILLNODE) {
pgn = (GNode *)Lst_Datum (ln);
if (pgn->flags & REMAKE) {
- Var_Set (IMPSRC, cname, pgn, 0);
+ Var_Set(IMPSRC, cname, pgn, 0);
if (cpref != NULL)
- Var_Set (PREFIX, cpref, pgn, 0);
+ Var_Set(PREFIX, cpref, pgn, 0);
}
}
if (p1)
free(p1);
- Lst_Close (cgn->iParents);
+ Lst_Close(cgn->iParents);
}
}
@@ -825,16 +825,16 @@
char *p1 = NULL, *p2 = NULL;
if (cgn->type & OP_ARCHV)
- child = Var_Value (MEMBER, cgn, &p1);
+ child = Var_Value(MEMBER, cgn, &p1);
else
child = cgn->path ? cgn->path : cgn->name;
if (cgn->type & OP_JOIN) {
- allsrc = Var_Value (ALLSRC, cgn, &p2);
+ allsrc = Var_Value(ALLSRC, cgn, &p2);
} else {
allsrc = child;
}
if (allsrc != NULL)
- Var_Append (ALLSRC, allsrc, pgn);
+ Var_Append(ALLSRC, allsrc, pgn);
if (p2)
free(p2);
if (pgn->type & OP_JOIN) {
@@ -893,19 +893,19 @@
void
Make_DoAllVar(GNode *gn)
{
- Lst_ForEach (gn->children, MakeUnmark, (ClientData) gn);
- Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
+ Lst_ForEach(gn->children, MakeUnmark, (ClientData) gn);
+ Lst_ForEach(gn->children, MakeAddAllSrc, (ClientData) gn);
if (!Var_Exists (OODATE, gn)) {
- Var_Set (OODATE, "", gn, 0);
+ Var_Set(OODATE, "", gn, 0);
}
if (!Var_Exists (ALLSRC, gn)) {
- Var_Set (ALLSRC, "", gn, 0);
+ Var_Set(ALLSRC, "", gn, 0);
}
if (gn->type & OP_JOIN) {
char *p1;
- Var_Set (TARGET, Var_Value (ALLSRC, gn, &p1), gn, 0);
+ Var_Set(TARGET, Var_Value(ALLSRC, gn, &p1), gn, 0);
if (p1)
free(p1);
}
@@ -933,7 +933,7 @@
GNode *gn;
while (!Lst_IsEmpty (toBeMade)) {
- gn = (GNode *) Lst_DeQueue (toBeMade);
+ gn = (GNode *) Lst_DeQueue(toBeMade);
if (DEBUG(MAKE)) {
printf ("Examining %s...", gn->name);
}
@@ -972,15 +972,15 @@
}
numNodes--;
- if (Make_OODate (gn)) {
+ if (Make_OODate(gn)) {
if (DEBUG(MAKE)) {
printf ("out-of-date\n");
}
if (queryFlag) {
return (TRUE);
}
- Make_DoAllVar (gn);
- Job_Make (gn);
+ Make_DoAllVar(gn);
+ Job_Make(gn);
} else {
if (DEBUG(MAKE)) {
printf ("up-to-date\n");
@@ -993,10 +993,10 @@
* value for .TARGET when building up the context variables
* of its parent(s)...
*/
- Make_DoAllVar (gn);
+ Make_DoAllVar(gn);
}
Job_TokenReturn();
- Make_Update (gn);
+ Make_Update(gn);
}
}
return (FALSE);
@@ -1082,7 +1082,7 @@
Lst examine; /* List of targets to examine */
Lst ntargs; /* List of new targets to be made */
- ntargs = Lst_Init (FALSE);
+ ntargs = Lst_Init(FALSE);
examine = Lst_Duplicate(targs, NOCOPY);
numNodes = 0;
@@ -1096,12 +1096,12 @@
* and go on about our business.
*/
while (!Lst_IsEmpty (examine)) {
- gn = (GNode *) Lst_DeQueue (examine);
+ gn = (GNode *) Lst_DeQueue(examine);
if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) {
Lst new;
- new = Lst_Duplicate (gn->cohorts, NOCOPY);
- Lst_Concat (new, examine, LST_CONCLINK);
+ new = Lst_Duplicate(gn->cohorts, NOCOPY);
+ Lst_Concat(new, examine, LST_CONCLINK);
examine = new;
}
@@ -1123,36 +1123,36 @@
continue;
*eoa = '\0';
*eon = '\0';
- Var_Set (MEMBER, eoa + 1, gn, 0);
- Var_Set (ARCHIVE, gn->name, gn, 0);
+ Var_Set(MEMBER, eoa + 1, gn, 0);
+ Var_Set(ARCHIVE, gn->name, gn, 0);
*eoa = '(';
*eon = ')';
}
(void)Dir_MTime(gn);
- Var_Set (TARGET, gn->path ? gn->path : gn->name, gn, 0);
- Lst_ForEach (gn->children, MakeUnmark, (ClientData)gn);
- Lst_ForEach (gn->children, MakeHandleUse, (ClientData)gn);
+ Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0);
+ Lst_ForEach(gn->children, MakeUnmark, (ClientData)gn);
+ Lst_ForEach(gn->children, MakeHandleUse, (ClientData)gn);
if ((gn->type & OP_MADE) == 0)
- Suff_FindDeps (gn);
+ Suff_FindDeps(gn);
else {
/* Pretend we made all this node's children */
- Lst_ForEach (gn->children, MakeFindChild, (ClientData)gn);
+ Lst_ForEach(gn->children, MakeFindChild, (ClientData)gn);
if (gn->unmade != 0)
printf("Warning: %s still has %d unmade children\n",
gn->name, gn->unmade);
}
if (gn->unmade != 0) {
- Lst_ForEach (gn->children, MakeAddChild, (ClientData)examine);
+ Lst_ForEach(gn->children, MakeAddChild, (ClientData)examine);
} else {
(void)Lst_EnQueue (ntargs, (ClientData)gn);
}
}
}
- Lst_Destroy (examine, NOFREE);
+ Lst_Destroy(examine, NOFREE);
return ntargs;
}
@@ -1185,7 +1185,7 @@
{
int errors; /* Number of errors the Job module reports */
- toBeMade = Make_ExpandUse (targs);
+ toBeMade = Make_ExpandUse(targs);
if (queryFlag) {
/*
@@ -1216,8 +1216,8 @@
* keepgoing flag was given.
*/
while (!Lst_IsEmpty(toBeMade) || !Job_Empty ()) {
- Job_CatchOutput ();
- Job_CatchChildren (!usePipes);
+ Job_CatchOutput();
+ Job_CatchChildren(!usePipes);
(void)MakeStartJobs();
}
Index: parse.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/parse.c,v
retrieving revision 1.96
diff -u -r1.96 parse.c
--- parse.c 7 May 2004 00:04:40 -0000 1.96
+++ parse.c 1 Feb 2005 22:41:07 -0000
@@ -510,7 +510,7 @@
GNode *cgn = (GNode *) cgnp;
if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (pgn->cohorts))
- pgn = (GNode *) Lst_Datum (Lst_Last (pgn->cohorts));
+ pgn = (GNode *) Lst_Datum(Lst_Last(pgn->cohorts));
(void)Lst_AtEnd (pgn->children, (ClientData)cgn);
if (specType == Not)
(void)Lst_AtEnd (cgn->parents, (ClientData)pgn);
@@ -551,7 +551,7 @@
if (((op & OP_OPMASK) != (gn->type & OP_OPMASK)) &&
!OP_NOP(gn->type) && !OP_NOP(op))
{
- Parse_Error (PARSE_FATAL, "Inconsistent operator for %s", gn->name);
+ Parse_Error(PARSE_FATAL, "Inconsistent operator for %s", gn->name);
return (1);
}
@@ -691,7 +691,7 @@
* other targets. This is the bit of ParseDoSrc which is relevant.
* The main difference is we don't link the resolved src to all targets.
*/
- gn = Targ_FindNode (cp, TARG_CREATE);
+ gn = Targ_FindNode(cp, TARG_CREATE);
if (ss->op) {
gn->type |= ss->op;
} else {
@@ -739,7 +739,7 @@
if (keywd != -1) {
int op = parseKeywords[keywd].op;
if (op != 0) {
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach(targets, ParseDoOp, (ClientData)&op);
return;
}
if (parseKeywords[keywd].spec == Wait) {
@@ -759,7 +759,7 @@
* invoked if the user didn't specify a target on the command
* line. This is to allow #ifmake's to succeed, or something...
*/
- (void) Lst_AtEnd (create, (ClientData)estrdup(src));
+ (void) Lst_AtEnd(create, (ClientData)estrdup(src));
/*
* Add the name to the .TARGETS variable as well, so the user cna
* employ that, if desired.
@@ -809,11 +809,11 @@
Lst_ForEach(targets, ParseDoSpecialSrc, (ClientData)&ss);
return;
}
- gn = Targ_FindNode (src, TARG_CREATE);
+ gn = Targ_FindNode(src, TARG_CREATE);
if (tOp) {
gn->type |= tOp;
} else {
- Lst_ForEach (targets, ParseLinkSrc, (ClientData)gn);
+ Lst_ForEach(targets, ParseLinkSrc, (ClientData)gn);
}
break;
}
@@ -999,8 +999,8 @@
* went well and FAILURE if there was an error in the
* specification. On error, line should remain untouched.
*/
- if (Arch_ParseArchive (&line, targets, VAR_CMD) != SUCCESS) {
- Parse_Error (PARSE_FATAL,
+ if (Arch_ParseArchive(&line, targets, VAR_CMD) != SUCCESS) {
+ Parse_Error(PARSE_FATAL,
"Error in archive specification: \"%s\"", line);
return;
} else {
@@ -1018,10 +1018,10 @@
if ((strncmp(line, "<<<<<<", 6) == 0) ||
(strncmp(line, "======", 6) == 0) ||
(strncmp(line, ">>>>>>", 6) == 0))
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Makefile appears to contain unresolved cvs/rcs/??? merge conflicts");
else
- Parse_Error (PARSE_FATAL, "Need an operator");
+ Parse_Error(PARSE_FATAL, "Need an operator");
return;
}
*cp = '\0';
@@ -1121,9 +1121,9 @@
Lst path;
specType = ExPath;
- path = Suff_GetPath (&line[5]);
+ path = Suff_GetPath(&line[5]);
if (path == NILLST) {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Suffix '%s' not defined (yet)",
&line[5]);
return;
@@ -1165,9 +1165,9 @@
char *targName = (char *)Lst_DeQueue(curTargs);
if (!Suff_IsTransform (targName)) {
- gn = Targ_FindNode (targName, TARG_CREATE);
+ gn = Targ_FindNode(targName, TARG_CREATE);
} else {
- gn = Suff_AddTransform (targName);
+ gn = Suff_AddTransform(targName);
}
(void)Lst_AtEnd (targets, (ClientData)gn);
@@ -1244,13 +1244,13 @@
op = OP_DEPENDS;
}
} else {
- Parse_Error (PARSE_FATAL, "Missing dependency operator");
+ Parse_Error(PARSE_FATAL, "Missing dependency operator");
return;
}
cp++; /* Advance beyond operator */
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach(targets, ParseDoOp, (ClientData)&op);
/*
* Get to the first source
@@ -1272,7 +1272,7 @@
if (!*line) {
switch (specType) {
case Suffixes:
- Suff_ClearSuffixes ();
+ Suff_ClearSuffixes();
break;
case Precious:
allPrecious = TRUE;
@@ -1301,11 +1301,11 @@
* set the initial character to a null-character so the loop to
* get sources won't get anything
*/
- Main_ParseArgLine (line);
+ Main_ParseArgLine(line);
*line = '\0';
} else if (specType == ExShell) {
- if (Job_ParseShell (line) != SUCCESS) {
- Parse_Error (PARSE_FATAL, "improper shell specification");
+ if (Job_ParseShell(line) != SUCCESS) {
+ Parse_Error(PARSE_FATAL, "improper shell specification");
return;
}
*line = '\0';
@@ -1355,19 +1355,19 @@
*cp = '\0';
switch (specType) {
case Suffixes:
- Suff_AddSuffix (line, &mainNode);
+ Suff_AddSuffix(line, &mainNode);
break;
case ExPath:
Lst_ForEach(paths, ParseAddDir, (ClientData)line);
break;
case Includes:
- Suff_AddInclude (line);
+ Suff_AddInclude(line);
break;
case Libs:
- Suff_AddLib (line);
+ Suff_AddLib(line);
break;
case Null:
- Suff_SetNull (line);
+ Suff_SetNull(line);
break;
case ExObjdir:
Main_SetObjdir(line);
@@ -1416,18 +1416,18 @@
}
if (*cp == LPAREN) {
- sources = Lst_Init (FALSE);
- if (Arch_ParseArchive (&line, sources, VAR_CMD) != SUCCESS) {
- Parse_Error (PARSE_FATAL,
+ sources = Lst_Init(FALSE);
+ if (Arch_ParseArchive(&line, sources, VAR_CMD) != SUCCESS) {
+ Parse_Error(PARSE_FATAL,
"Error in source archive spec \"%s\"", line);
return;
}
while (!Lst_IsEmpty (sources)) {
- gn = (GNode *) Lst_DeQueue (sources);
- ParseDoSrc (tOp, gn->name, curSrcs, hasWait);
+ gn = (GNode *) Lst_DeQueue(sources);
+ ParseDoSrc(tOp, gn->name, curSrcs, hasWait);
}
- Lst_Destroy (sources, NOFREE);
+ Lst_Destroy(sources, NOFREE);
cp = line;
} else {
if (*cp) {
@@ -1435,7 +1435,7 @@
cp += 1;
}
- ParseDoSrc (tOp, line, curSrcs, hasWait);
+ ParseDoSrc(tOp, line, curSrcs, hasWait);
}
while (*cp && isspace ((unsigned char)*cp)) {
cp++;
@@ -1451,7 +1451,7 @@
* the first dependency line that is actually a real target
* (i.e. isn't a .USE or .EXEC rule) to be made.
*/
- Lst_ForEach (targets, ParseFindMain, (ClientData)0);
+ Lst_ForEach(targets, ParseFindMain, (ClientData)0);
}
/*
@@ -1675,7 +1675,7 @@
}
if (type == VAR_APPEND) {
- Var_Append (line, cp, ctxt);
+ Var_Append(line, cp, ctxt);
} else if (type == VAR_SUBST) {
/*
* Allow variables in the old value to be undefined, but leave their
@@ -1766,7 +1766,7 @@
GNode *gn = (GNode *) gnp;
/* if target already supplied, ignore commands */
if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts))
- gn = (GNode *) Lst_Datum (Lst_Last (gn->cohorts));
+ gn = (GNode *) Lst_Datum(Lst_Last(gn->cohorts));
if (!(gn->type & OP_HAS_COMMANDS)) {
(void)Lst_AtEnd(gn->commands, cmd);
ParseMark(gn);
@@ -1774,15 +1774,15 @@
#ifdef notyet
/* XXX: We cannot do this until we fix the tree */
(void)Lst_AtEnd(gn->commands, cmd);
- Parse_Error (PARSE_WARNING,
+ Parse_Error(PARSE_WARNING,
"overriding commands for target \"%s\"; "
"previous commands defined at %s: %d ignored",
gn->name, gn->fname, gn->lineno);
#else
- Parse_Error (PARSE_WARNING,
+ Parse_Error(PARSE_WARNING,
"duplicate script for target \"%s\" ignored",
gn->name);
- ParseErrorInternal (gn->fname, gn->lineno, PARSE_WARNING,
+ ParseErrorInternal(gn->fname, gn->lineno, PARSE_WARNING,
"using previous script for \"%s\" defined here",
gn->name);
#endif
@@ -1838,7 +1838,7 @@
void
Parse_AddIncludeDir(char *dir)
{
- (void) Dir_AddDir (parseIncPath, dir);
+ (void) Dir_AddDir(parseIncPath, dir);
}
/*-
@@ -1878,7 +1878,7 @@
}
if ((*file != '"') && (*file != '<')) {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
".include filename must be delimited by '\"' or '<'");
return;
}
@@ -1904,7 +1904,7 @@
}
if (*cp != endc) {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Unclosed %cinclude filename. '%c' expected",
'.', endc);
return;
@@ -1915,7 +1915,7 @@
* Substitute for any variables in the file name before trying to
* find the thing.
*/
- file = Var_Subst (NULL, file, VAR_CMD, FALSE);
+ file = Var_Subst(NULL, file, VAR_CMD, FALSE);
/*
* Now we know the file's name and its search path, we attempt to
@@ -1945,8 +1945,8 @@
if (file[0] == '/')
newName = estrdup(file);
else
- newName = str_concat (Fname, file, STR_ADDSLASH);
- fullname = Dir_FindFile (newName, parseIncPath);
+ newName = str_concat(Fname, file, STR_ADDSLASH);
+ fullname = Dir_FindFile(newName, parseIncPath);
if (fullname == (char *)NULL) {
fullname = Dir_FindFile(newName, dirSearchPath);
}
@@ -1963,7 +1963,7 @@
* then on the .PATH search path, if not found in a -I directory.
* XXX: Suffix specific?
*/
- fullname = Dir_FindFile (file, parseIncPath);
+ fullname = Dir_FindFile(file, parseIncPath);
if (fullname == (char *)NULL) {
fullname = Dir_FindFile(file, dirSearchPath);
}
@@ -1981,7 +1981,7 @@
if (fullname == (char *) NULL) {
*cp = endc;
if (!silent)
- Parse_Error (PARSE_FATAL, "Could not find %s", file);
+ Parse_Error(PARSE_FATAL, "Could not find %s", file);
return;
}
@@ -1994,11 +1994,11 @@
* is placed on a list with other IFile structures. The list makes
* a very nice stack to track how we got here...
*/
- oldFile = (IFile *) emalloc (sizeof (IFile));
+ oldFile = (IFile *) emalloc(sizeof (IFile));
memcpy(oldFile, &curFile, sizeof (IFile));
- (void) Lst_AtFront (includes, (ClientData)oldFile);
+ (void) Lst_AtFront(includes, (ClientData)oldFile);
/*
* Once the previous state has been saved, we can get down to reading
@@ -2016,7 +2016,7 @@
if (curFile.F == (FILE * ) NULL) {
if (!silent)
- Parse_Error (PARSE_FATAL, "Cannot open %s", fullname);
+ Parse_Error(PARSE_FATAL, "Cannot open %s", fullname);
/*
* Pop to previous file
*/
@@ -2078,13 +2078,13 @@
if (DEBUG(FOR))
(void) fprintf(stderr, "%s\n---- at line %d\n", str, lineno);
- oldFile = (IFile *) emalloc (sizeof (IFile));
+ oldFile = (IFile *) emalloc(sizeof (IFile));
memcpy(oldFile, &curFile, sizeof (IFile));
- (void) Lst_AtFront (includes, (ClientData)oldFile);
+ (void) Lst_AtFront(includes, (ClientData)oldFile);
curFile.F = NULL;
- curFile.P = (PTR *) emalloc (sizeof (PTR));
+ curFile.P = (PTR *) emalloc(sizeof (PTR));
curFile.P->str = curFile.P->ptr = str;
curFile.lineno = lineno;
curFile.fname = estrdup(curFile.fname);
@@ -2131,7 +2131,7 @@
file++;
if (*file == '\0') {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Filename missing from \"include\"");
return;
}
@@ -2270,13 +2270,13 @@
{
IFile *ifile; /* the state on the top of the includes stack */
- if (Lst_IsEmpty (includes)) {
+ if (Lst_IsEmpty(includes)) {
Var_Delete(".PARSEDIR", VAR_GLOBAL);
Var_Delete(".PARSEFILE", VAR_GLOBAL);
return (DONE);
}
- ifile = (IFile *) Lst_DeQueue (includes);
+ ifile = (IFile *) Lst_DeQueue(includes);
/* XXX dispose of curFile info */
free ((Address) curFile.fname);
@@ -2591,7 +2591,7 @@
}
Buf_AddByte (buf, (Byte)'\0');
line = (char *)Buf_GetAll (buf, &lineLength);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
/*
* Strip trailing blanks and tabs from the line.
@@ -2613,7 +2613,7 @@
* The line might be a conditional. Ask the conditional module
* about it and act accordingly
*/
- switch (Cond_Eval (line)) {
+ switch (Cond_Eval(line)) {
case COND_SKIP:
/*
* Skip to next conditional that evaluates to COND_PARSE.
@@ -2640,7 +2640,7 @@
*/
line = ParseSkipLine(0, 1);
if (line == NULL) {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Unexpected end of file in for loop.\n");
break;
}
@@ -2683,7 +2683,7 @@
{
if (inLine) {
Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL);
- Lst_Destroy (targets, ParseHasCommands);
+ Lst_Destroy(targets, ParseHasCommands);
targets = NULL;
inLine = FALSE;
}
@@ -2725,7 +2725,7 @@
ParseSetParseFile(curFile.fname);
do {
- while ((line = ParseReadLine ()) != NULL) {
+ while ((line = ParseReadLine()) != NULL) {
if (*line == '.') {
/*
* Lines that begin with the special character are either
@@ -2737,7 +2737,7 @@
if (strncmp(cp, "include", 7) == 0 ||
((cp[0] == 's' || cp[0] == '-') &&
strncmp(&cp[1], "include", 7) == 0)) {
- ParseDoInclude (cp);
+ ParseDoInclude(cp);
goto nextLine;
} else if (strncmp(cp, "undef", 5) == 0) {
char *cp2;
@@ -2779,13 +2779,13 @@
* in a dependency spec, add the command to the list of
* commands of all targets in the dependency spec
*/
- Lst_ForEach (targets, ParseAddCmd, cp);
+ Lst_ForEach(targets, ParseAddCmd, cp);
#ifdef CLEANUP
Lst_AtEnd(targCmds, (ClientData) line);
#endif
continue;
} else {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Unassociated shell command \"%s\"",
cp);
}
@@ -2800,12 +2800,12 @@
/*
* It's an S3/S5-style "include".
*/
- ParseTraditionalInclude (line);
+ ParseTraditionalInclude(line);
goto nextLine;
#endif
- } else if (Parse_IsVar (line)) {
+ } else if (Parse_IsVar(line)) {
ParseFinishLine();
- Parse_DoVar (line, VAR_GLOBAL);
+ Parse_DoVar(line, VAR_GLOBAL);
} else {
/*
* We now know it's a dependency line so it needs to have all
@@ -2841,17 +2841,17 @@
#ifndef POSIX
if (*cp == '\0') {
if (inLine) {
- Parse_Error (PARSE_WARNING,
+ Parse_Error(PARSE_WARNING,
"Shell command needs a leading tab");
goto shellCommand;
} else if (nonSpace) {
- Parse_Error (PARSE_FATAL, "Missing operator");
+ Parse_Error(PARSE_FATAL, "Missing operator");
}
} else {
#endif
ParseFinishLine();
- cp = Var_Subst (NULL, line, VAR_CMD, TRUE);
+ cp = Var_Subst(NULL, line, VAR_CMD, TRUE);
free (line);
line = cp;
@@ -2861,10 +2861,10 @@
if (targets)
Lst_Destroy(targets, NOFREE);
- targets = Lst_Init (FALSE);
+ targets = Lst_Init(FALSE);
inLine = TRUE;
- ParseDoDependency (line);
+ ParseDoDependency(line);
#ifndef POSIX
}
#endif
@@ -2909,12 +2909,12 @@
Parse_Init(void)
{
mainNode = NILGNODE;
- parseIncPath = Lst_Init (FALSE);
- sysIncPath = Lst_Init (FALSE);
- defIncPath = Lst_Init (FALSE);
- includes = Lst_Init (FALSE);
+ parseIncPath = Lst_Init(FALSE);
+ sysIncPath = Lst_Init(FALSE);
+ defIncPath = Lst_Init(FALSE);
+ includes = Lst_Init(FALSE);
#ifdef CLEANUP
- targCmds = Lst_Init (FALSE);
+ targCmds = Lst_Init(FALSE);
#endif
}
@@ -2952,17 +2952,17 @@
{
Lst mainList; /* result list */
- mainList = Lst_Init (FALSE);
+ mainList = Lst_Init(FALSE);
if (mainNode == NILGNODE) {
- Punt ("no target to make.");
+ Punt("no target to make.");
/*NOTREACHED*/
} else if (mainNode->type & OP_DOUBLEDEP) {
- (void) Lst_AtEnd (mainList, (ClientData)mainNode);
+ (void) Lst_AtEnd(mainList, (ClientData)mainNode);
Lst_Concat(mainList, mainNode->cohorts, LST_CONCNEW);
}
else
- (void) Lst_AtEnd (mainList, (ClientData)mainNode);
+ (void) Lst_AtEnd(mainList, (ClientData)mainNode);
Var_Append(".TARGETS", mainNode->name, VAR_GLOBAL);
return (mainList);
}
Index: suff.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/suff.c,v
retrieving revision 1.47
diff -u -r1.47 suff.c
--- suff.c 29 Dec 2004 01:55:25 -0000 1.47
+++ suff.c 1 Feb 2005 22:41:09 -0000
@@ -370,7 +370,7 @@
static int
SuffSuffIsPrefix(ClientData s, ClientData str)
{
- return (SuffStrIsPrefix (((Suff *) s)->name, (char *) str) == NULL ? 1 : 0);
+ return (SuffStrIsPrefix(((Suff *) s)->name, (char *) str) == NULL ? 1 : 0);
}
/*-
@@ -439,10 +439,10 @@
s->refCount);
#endif
- Lst_Destroy (s->ref, NOFREE);
- Lst_Destroy (s->children, NOFREE);
- Lst_Destroy (s->parents, NOFREE);
- Lst_Destroy (s->searchPath, Dir_Destroy);
+ Lst_Destroy(s->ref, NOFREE);
+ Lst_Destroy(s->children, NOFREE);
+ Lst_Destroy(s->parents, NOFREE);
+ Lst_Destroy(s->searchPath, Dir_Destroy);
free ((Address)s->name);
free ((Address)s);
@@ -466,7 +466,7 @@
{
SuffUnRef((ClientData) l, (ClientData) s);
if (s->refCount == 0) {
- SuffUnRef ((ClientData) sufflist, (ClientData) s);
+ SuffUnRef((ClientData) sufflist, (ClientData) s);
SuffFree((ClientData) s);
}
}
@@ -494,17 +494,17 @@
LstNode ln; /* current element in l we're examining */
Suff *s2 = NULL; /* the suffix descriptor in this element */
- if (Lst_Open (l) == FAILURE) {
+ if (Lst_Open(l) == FAILURE) {
return;
}
- while ((ln = Lst_Next (l)) != NILLNODE) {
- s2 = (Suff *) Lst_Datum (ln);
+ while ((ln = Lst_Next(l)) != NILLNODE) {
+ s2 = (Suff *) Lst_Datum(ln);
if (s2->sNum >= s->sNum) {
break;
}
}
- Lst_Close (l);
+ Lst_Close(l);
if (DEBUG(SUFF)) {
printf("inserting %s(%d)...", s->name, s->sNum);
}
@@ -548,7 +548,7 @@
Suff_ClearSuffixes(void)
{
#ifdef CLEANUP
- Lst_Concat (suffClean, sufflist, LST_CONCLINK);
+ Lst_Concat(suffClean, sufflist, LST_CONCLINK);
#endif
sufflist = Lst_Init(FALSE);
sNum = 0;
@@ -598,7 +598,7 @@
if (srcLn == NILLNODE) {
srcLn = Lst_Find(sufflist, (ClientData)str, SuffSuffIsPrefix);
} else {
- srcLn = Lst_FindFrom (sufflist, Lst_Succ(srcLn), (ClientData)str,
+ srcLn = Lst_FindFrom(sufflist, Lst_Succ(srcLn), (ClientData)str,
SuffSuffIsPrefix);
}
if (srcLn == NILLNODE) {
@@ -621,7 +621,7 @@
}
return (FALSE);
}
- src = (Suff *) Lst_Datum (srcLn);
+ src = (Suff *) Lst_Datum(srcLn);
str2 = str + src->nameLen;
if (*str2 == '\0') {
single = src;
@@ -687,13 +687,13 @@
*t; /* target suffix */
LstNode ln; /* Node for existing transformation */
- ln = Lst_Find (transforms, (ClientData)line, SuffGNHasNameP);
+ ln = Lst_Find(transforms, (ClientData)line, SuffGNHasNameP);
if (ln == NILLNODE) {
/*
* Make a new graph node for the transformation. It will be filled in
* by the Parse module.
*/
- gn = Targ_NewGN (line);
+ gn = Targ_NewGN(line);
(void)Lst_AtEnd (transforms, (ClientData)gn);
} else {
/*
@@ -702,11 +702,11 @@
* free the commands themselves, because a given command can be
* attached to several different transformations.
*/
- gn = (GNode *) Lst_Datum (ln);
- Lst_Destroy (gn->commands, NOFREE);
- Lst_Destroy (gn->children, NOFREE);
- gn->commands = Lst_Init (FALSE);
- gn->children = Lst_Init (FALSE);
+ gn = (GNode *) Lst_Datum(ln);
+ Lst_Destroy(gn->commands, NOFREE);
+ Lst_Destroy(gn->children, NOFREE);
+ gn->commands = Lst_Init(FALSE);
+ gn->children = Lst_Init(FALSE);
}
gn->type = OP_TRANSFORM;
@@ -720,8 +720,8 @@
printf("defining transformation from `%s' to `%s'\n",
s->name, t->name);
}
- SuffInsert (t->children, s);
- SuffInsert (s->parents, t);
+ SuffInsert(t->children, s);
+ SuffInsert(s->parents, t);
return (gn);
}
@@ -753,7 +753,7 @@
GNode *gn = (GNode *) gnp;
if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts))
- gn = (GNode *) Lst_Datum (Lst_Last (gn->cohorts));
+ gn = (GNode *) Lst_Datum(Lst_Last(gn->cohorts));
if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) &&
Lst_IsEmpty(gn->children))
{
@@ -921,8 +921,8 @@
*gs->gn = NILGNODE;
Targ_SetMain(NILGNODE);
}
- Lst_Destroy (target->children, NOFREE);
- target->children = Lst_Init (FALSE);
+ Lst_Destroy(target->children, NOFREE);
+ target->children = Lst_Init(FALSE);
target->type = OP_TRANSFORM;
/*
* link the two together in the proper relationship and order
@@ -931,8 +931,8 @@
printf("defining transformation from `%s' to `%s'\n",
s->name, t->name);
}
- SuffInsert (t->children, s);
- SuffInsert (s->parents, t);
+ SuffInsert(t->children, s);
+ SuffInsert(s->parents, t);
}
return 0;
}
@@ -963,16 +963,16 @@
LstNode ln;
GNodeSuff gs;
- ln = Lst_Find (sufflist, (ClientData)str, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (ClientData)str, SuffSuffHasNameP);
if (ln == NILLNODE) {
- s = (Suff *) emalloc (sizeof (Suff));
+ s = (Suff *) emalloc(sizeof (Suff));
- s->name = estrdup (str);
+ s->name = estrdup(str);
s->nameLen = strlen (s->name);
- s->searchPath = Lst_Init (FALSE);
- s->children = Lst_Init (FALSE);
- s->parents = Lst_Init (FALSE);
- s->ref = Lst_Init (FALSE);
+ s->searchPath = Lst_Init(FALSE);
+ s->children = Lst_Init(FALSE);
+ s->parents = Lst_Init(FALSE);
+ s->ref = Lst_Init(FALSE);
s->sNum = sNum++;
s->flags = 0;
s->refCount = 1;
@@ -987,12 +987,12 @@
gs.gn = gn;
gs.s = s;
gs.r = FALSE;
- Lst_ForEach (Targ_List(), SuffScanTargets, (ClientData) &gs);
+ Lst_ForEach(Targ_List(), SuffScanTargets, (ClientData) &gs);
/*
* Look for any existing transformations from or to this suffix.
* XXX: Only do this after a Suff_ClearSuffixes?
*/
- Lst_ForEach (transforms, SuffRebuildGraph, (ClientData) s);
+ Lst_ForEach(transforms, SuffRebuildGraph, (ClientData) s);
}
}
@@ -1015,11 +1015,11 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (ClientData)sname, SuffSuffHasNameP);
if (ln == NILLNODE) {
return (NILLST);
} else {
- s = (Suff *) Lst_Datum (ln);
+ s = (Suff *) Lst_Datum(ln);
return (s->searchPath);
}
}
@@ -1051,15 +1051,15 @@
Lst inIncludes; /* Cumulative .INCLUDES path */
Lst inLibs; /* Cumulative .LIBS path */
- if (Lst_Open (sufflist) == FAILURE) {
+ if (Lst_Open(sufflist) == FAILURE) {
return;
}
inIncludes = Lst_Init(FALSE);
inLibs = Lst_Init(FALSE);
- while ((ln = Lst_Next (sufflist)) != NILLNODE) {
- s = (Suff *) Lst_Datum (ln);
+ while ((ln = Lst_Next(sufflist)) != NILLNODE) {
+ s = (Suff *) Lst_Datum(ln);
if (!Lst_IsEmpty (s->searchPath)) {
#ifdef INCLUDES
if (s->flags & SUFF_INCLUDE) {
@@ -1073,7 +1073,7 @@
#endif /* LIBRARIES */
Dir_Concat(s->searchPath, dirSearchPath);
} else {
- Lst_Destroy (s->searchPath, Dir_Destroy);
+ Lst_Destroy(s->searchPath, Dir_Destroy);
s->searchPath = Lst_Duplicate(dirSearchPath, Dir_CopyDir);
}
}
@@ -1086,7 +1086,7 @@
Lst_Destroy(inIncludes, Dir_Destroy);
Lst_Destroy(inLibs, Dir_Destroy);
- Lst_Close (sufflist);
+ Lst_Close(sufflist);
}
/*-
@@ -1113,9 +1113,9 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (ClientData)sname, SuffSuffHasNameP);
if (ln != NILLNODE) {
- s = (Suff *) Lst_Datum (ln);
+ s = (Suff *) Lst_Datum(ln);
s->flags |= SUFF_INCLUDE;
}
}
@@ -1145,9 +1145,9 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (ClientData)sname, SuffSuffHasNameP);
if (ln != NILLNODE) {
- s = (Suff *) Lst_Datum (ln);
+ s = (Suff *) Lst_Datum(ln);
s->flags |= SUFF_LIBRARY;
}
}
@@ -1188,7 +1188,7 @@
* structure for a file with no suffix attached. Two birds, and all
* that...
*/
- s2 = (Src *) emalloc (sizeof (Src));
+ s2 = (Src *) emalloc(sizeof (Src));
s2->file = estrdup(targ->pref);
s2->pref = targ->pref;
s2->parent = targ;
@@ -1206,8 +1206,8 @@
printf("\n");
#endif
}
- s2 = (Src *) emalloc (sizeof (Src));
- s2->file = str_concat (targ->pref, s->name, 0);
+ s2 = (Src *) emalloc(sizeof (Src));
+ s2->file = str_concat(targ->pref, s->name, 0);
s2->pref = targ->pref;
s2->parent = targ;
s2->node = NILGNODE;
@@ -1251,7 +1251,7 @@
ls.s = targ;
ls.l = l;
- Lst_ForEach (targ->suff->children, SuffAddSrc, (ClientData)&ls);
+ Lst_ForEach(targ->suff->children, SuffAddSrc, (ClientData)&ls);
}
/*-
@@ -1273,7 +1273,7 @@
Src *s;
int t = 0;
- if (Lst_Open (l) == FAILURE) {
+ if (Lst_Open(l) == FAILURE) {
return 0;
}
#ifdef DEBUG_SRC
@@ -1283,8 +1283,8 @@
#endif
- while ((ln = Lst_Next (l)) != NILLNODE) {
- s = (Src *) Lst_Datum (ln);
+ while ((ln = Lst_Next(l)) != NILLNODE) {
+ s = (Src *) Lst_Datum(ln);
if (s->children == 0) {
free ((Address)s->file);
if (!s->parent)
@@ -1346,7 +1346,7 @@
rs = (Src *) NULL;
while (!Lst_IsEmpty (srcs)) {
- s = (Src *) Lst_DeQueue (srcs);
+ s = (Src *) Lst_DeQueue(srcs);
if (DEBUG(SUFF)) {
printf ("\ttrying %s...", s->file);
@@ -1364,7 +1364,7 @@
break;
}
- if ((ptr = Dir_FindFile (s->file, s->suff->searchPath)) != NULL) {
+ if ((ptr = Dir_FindFile(s->file, s->suff->searchPath)) != NULL) {
rs = s;
#ifdef DEBUG_SRC
printf("remove %x from %x\n", s, srcs);
@@ -1377,7 +1377,7 @@
printf ("not there\n");
}
- SuffAddLevel (srcs, s);
+ SuffAddLevel(srcs, s);
Lst_AtEnd(slst, (ClientData) s);
}
@@ -1417,13 +1417,13 @@
char *cp;
t = targ->node;
- (void) Lst_Open (t->children);
+ (void) Lst_Open(t->children);
prefLen = strlen (targ->pref);
for (;;) {
ln = Lst_Next(t->children);
if (ln == NILLNODE) {
- Lst_Close (t->children);
+ Lst_Close(t->children);
return NULL;
}
s = (GNode *)Lst_Datum (ln);
@@ -1440,7 +1440,7 @@
* The node matches the prefix ok, see if it has a known
* suffix.
*/
- ln = Lst_Find (sufflist, (ClientData)&cp[prefLen],
+ ln = Lst_Find(sufflist, (ClientData)&cp[prefLen],
SuffSuffHasNameP);
if (ln == NILLNODE)
continue;
@@ -1915,8 +1915,8 @@
/*
* Set the other two local variables required for this target.
*/
- Var_Set (MEMBER, name, gn, 0);
- Var_Set (ARCHIVE, gn->name, gn, 0);
+ Var_Set(MEMBER, name, gn, 0);
+ Var_Set(ARCHIVE, gn->name, gn, 0);
if (ms != NULL) {
/*
@@ -2415,17 +2415,17 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)UNCONST(LIBSUFF),
+ ln = Lst_Find(sufflist, (ClientData)UNCONST(LIBSUFF),
SuffSuffHasNameP);
if (gn->suffix)
gn->suffix->refCount--;
if (ln != NILLNODE) {
- gn->suffix = s = (Suff *) Lst_Datum (ln);
+ gn->suffix = s = (Suff *) Lst_Datum(ln);
gn->suffix->refCount++;
- Arch_FindLib (gn, s->searchPath);
+ Arch_FindLib(gn, s->searchPath);
} else {
gn->suffix = NULL;
- Var_Set (TARGET, gn->name, gn, 0);
+ Var_Set(TARGET, gn->name, gn, 0);
}
/*
* Because a library (-lfoo) target doesn't follow the standard
@@ -2476,7 +2476,7 @@
*/
suffNull = s;
} else {
- Parse_Error (PARSE_WARNING, "Desired null suffix %s not defined.",
+ Parse_Error(PARSE_WARNING, "Desired null suffix %s not defined.",
name);
}
}
@@ -2496,12 +2496,12 @@
void
Suff_Init(void)
{
- sufflist = Lst_Init (FALSE);
+ sufflist = Lst_Init(FALSE);
#ifdef CLEANUP
suffClean = Lst_Init(FALSE);
#endif
- srclist = Lst_Init (FALSE);
- transforms = Lst_Init (FALSE);
+ srclist = Lst_Init(FALSE);
+ transforms = Lst_Init(FALSE);
sNum = 0;
/*
@@ -2509,15 +2509,15 @@
* actually go on the suffix list or everyone will think that's its
* suffix.
*/
- emptySuff = suffNull = (Suff *) emalloc (sizeof (Suff));
+ emptySuff = suffNull = (Suff *) emalloc(sizeof (Suff));
- suffNull->name = estrdup ("");
+ suffNull->name = estrdup("");
suffNull->nameLen = 0;
- suffNull->searchPath = Lst_Init (FALSE);
+ suffNull->searchPath = Lst_Init(FALSE);
Dir_Concat(suffNull->searchPath, dirSearchPath);
- suffNull->children = Lst_Init (FALSE);
- suffNull->parents = Lst_Init (FALSE);
- suffNull->ref = Lst_Init (FALSE);
+ suffNull->children = Lst_Init(FALSE);
+ suffNull->parents = Lst_Init(FALSE);
+ suffNull->ref = Lst_Init(FALSE);
suffNull->sNum = sNum++;
suffNull->flags = SUFF_NULL;
suffNull->refCount = 1;
@@ -2591,13 +2591,13 @@
}
fputc ('\n', stdout);
printf ("#\tTo: ");
- Lst_ForEach (s->parents, SuffPrintName, (ClientData)0);
+ Lst_ForEach(s->parents, SuffPrintName, (ClientData)0);
fputc ('\n', stdout);
printf ("#\tFrom: ");
- Lst_ForEach (s->children, SuffPrintName, (ClientData)0);
+ Lst_ForEach(s->children, SuffPrintName, (ClientData)0);
fputc ('\n', stdout);
printf ("#\tSearch Path: ");
- Dir_PrintPath (s->searchPath);
+ Dir_PrintPath(s->searchPath);
fputc ('\n', stdout);
return (dummy ? 0 : 0);
}
@@ -2608,9 +2608,9 @@
GNode *t = (GNode *) tp;
printf ("%-16s: ", t->name);
- Targ_PrintType (t->type);
+ Targ_PrintType(t->type);
fputc ('\n', stdout);
- Lst_ForEach (t->commands, Targ_PrintCmd, (ClientData)0);
+ Lst_ForEach(t->commands, Targ_PrintCmd, (ClientData)0);
fputc ('\n', stdout);
return(dummy ? 0 : 0);
}
@@ -2619,8 +2619,8 @@
Suff_PrintAll(void)
{
printf ("#*** Suffixes:\n");
- Lst_ForEach (sufflist, SuffPrintSuff, (ClientData)0);
+ Lst_ForEach(sufflist, SuffPrintSuff, (ClientData)0);
printf ("#*** Transformations:\n");
- Lst_ForEach (transforms, SuffPrintTrans, (ClientData)0);
+ Lst_ForEach(transforms, SuffPrintTrans, (ClientData)0);
}
Index: targ.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/targ.c,v
retrieving revision 1.33
diff -u -r1.33 targ.c
--- targ.c 1 Jul 2004 20:38:09 -0000 1.33
+++ targ.c 1 Feb 2005 22:41:10 -0000
@@ -163,8 +163,8 @@
void
Targ_Init(void)
{
- allTargets = Lst_Init (FALSE);
- Hash_InitTable (&targets, HTSIZE);
+ allTargets = Lst_Init(FALSE);
+ Hash_InitTable(&targets, HTSIZE);
}
/*-
@@ -229,8 +229,8 @@
{
GNode *gn;
- gn = (GNode *) emalloc (sizeof (GNode));
- gn->name = estrdup (name);
+ gn = (GNode *) emalloc(sizeof (GNode));
+ gn->name = estrdup(name);
gn->uname = NULL;
gn->path = NULL;
if (name[0] == '-' && name[1] == 'l') {
@@ -245,14 +245,14 @@
gn->flags = 0;
gn->order = 0;
gn->mtime = gn->cmtime = 0;
- gn->iParents = Lst_Init (FALSE);
- gn->cohorts = Lst_Init (FALSE);
- gn->parents = Lst_Init (FALSE);
- gn->children = Lst_Init (FALSE);
- gn->successors = Lst_Init (FALSE);
- gn->preds = Lst_Init (FALSE);
+ gn->iParents = Lst_Init(FALSE);
+ gn->cohorts = Lst_Init(FALSE);
+ gn->parents = Lst_Init(FALSE);
+ gn->children = Lst_Init(FALSE);
+ gn->successors = Lst_Init(FALSE);
+ gn->preds = Lst_Init(FALSE);
Hash_InitTable(&gn->context, 0);
- gn->commands = Lst_Init (FALSE);
+ gn->commands = Lst_Init(FALSE);
gn->suffix = NULL;
gn->lineno = 0;
gn->fname = NULL;
@@ -335,15 +335,15 @@
if (flags & TARG_CREATE) {
- he = Hash_CreateEntry (&targets, name, &isNew);
+ he = Hash_CreateEntry(&targets, name, &isNew);
if (isNew) {
- gn = Targ_NewGN (name);
+ gn = Targ_NewGN(name);
Hash_SetValue (he, gn);
Var_Append(".ALLTARGETS", name, VAR_GLOBAL);
- (void) Lst_AtEnd (allTargets, (ClientData)gn);
+ (void) Lst_AtEnd(allTargets, (ClientData)gn);
}
} else {
- he = Hash_FindEntry (&targets, name);
+ he = Hash_FindEntry(&targets, name);
}
if (he == (Hash_Entry *) NULL) {
@@ -380,26 +380,26 @@
GNode *gn; /* node in tLn */
char *name;
- nodes = Lst_Init (FALSE);
+ nodes = Lst_Init(FALSE);
- if (Lst_Open (names) == FAILURE) {
+ if (Lst_Open(names) == FAILURE) {
return (nodes);
}
- while ((ln = Lst_Next (names)) != NILLNODE) {
+ while ((ln = Lst_Next(names)) != NILLNODE) {
name = (char *)Lst_Datum(ln);
- gn = Targ_FindNode (name, flags);
+ gn = Targ_FindNode(name, flags);
if (gn != NILGNODE) {
/*
* Note: Lst_AtEnd must come before the Lst_Concat so the nodes
* are added to the list in the order in which they were
* encountered in the makefile.
*/
- (void) Lst_AtEnd (nodes, (ClientData)gn);
+ (void) Lst_AtEnd(nodes, (ClientData)gn);
} else if (flags == TARG_NOCREATE) {
- Error ("\"%s\" -- target unknown.", name);
+ Error("\"%s\" -- target unknown.", name);
}
}
- Lst_Close (names);
+ Lst_Close(names);
return (nodes);
}
@@ -643,13 +643,13 @@
}
if (!Lst_IsEmpty (gn->iParents)) {
printf("# implicit parents: ");
- Lst_ForEach (gn->iParents, TargPrintName, (ClientData)0);
+ Lst_ForEach(gn->iParents, TargPrintName, (ClientData)0);
fputc ('\n', stdout);
}
}
if (!Lst_IsEmpty (gn->parents)) {
printf("# parents: ");
- Lst_ForEach (gn->parents, TargPrintName, (ClientData)0);
+ Lst_ForEach(gn->parents, TargPrintName, (ClientData)0);
fputc ('\n', stdout);
}
@@ -662,13 +662,13 @@
case OP_DOUBLEDEP:
printf(":: "); break;
}
- Targ_PrintType (gn->type);
- Lst_ForEach (gn->children, TargPrintName, (ClientData)0);
+ Targ_PrintType(gn->type);
+ Lst_ForEach(gn->children, TargPrintName, (ClientData)0);
fputc ('\n', stdout);
- Lst_ForEach (gn->commands, Targ_PrintCmd, (ClientData)0);
+ Lst_ForEach(gn->commands, Targ_PrintCmd, (ClientData)0);
printf("\n\n");
if (gn->type & OP_DOUBLEDEP) {
- Lst_ForEach (gn->cohorts, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach(gn->cohorts, TargPrintNode, (ClientData)&pass);
}
}
return (0);
@@ -717,14 +717,14 @@
Targ_PrintGraph(int pass)
{
printf("#*** Input graph:\n");
- Lst_ForEach (allTargets, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach(allTargets, TargPrintNode, (ClientData)&pass);
printf("\n\n");
printf("#\n# Files that are only sources:\n");
- Lst_ForEach (allTargets, TargPrintOnlySrc, (ClientData) 0);
+ Lst_ForEach(allTargets, TargPrintOnlySrc, (ClientData) 0);
printf("#*** Global Variables:\n");
- Var_Dump (VAR_GLOBAL);
+ Var_Dump(VAR_GLOBAL);
printf("#*** Command-line Variables:\n");
- Var_Dump (VAR_CMD);
+ Var_Dump(VAR_CMD);
printf("\n");
Dir_PrintDirectories();
printf("\n");
@@ -746,12 +746,12 @@
{
GNode *gn = (GNode *) gnp;
if (gn->type & OP_DOUBLEDEP)
- Lst_ForEach (gn->cohorts, TargPropagateCohort, gnp);
+ Lst_ForEach(gn->cohorts, TargPropagateCohort, gnp);
return (0);
}
void
Targ_Propagate(void)
{
- Lst_ForEach (allTargets, TargPropagateNode, (ClientData)0);
+ Lst_ForEach(allTargets, TargPropagateNode, (ClientData)0);
}
Index: var.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/var.c,v
retrieving revision 1.91
diff -u -r1.91 var.c
--- var.c 30 Oct 2004 20:49:05 -0000 1.91
+++ var.c 1 Feb 2005 22:41:12 -0000
@@ -361,15 +361,15 @@
* look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order,
* depending on the FIND_* flags in 'flags'
*/
- var = Hash_FindEntry (&ctxt->context, name);
+ var = Hash_FindEntry(&ctxt->context, name);
if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) {
- var = Hash_FindEntry (&VAR_CMD->context, name);
+ var = Hash_FindEntry(&VAR_CMD->context, name);
}
if (!checkEnvFirst && (var == NULL) && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL))
{
- var = Hash_FindEntry (&VAR_GLOBAL->context, name);
+ var = Hash_FindEntry(&VAR_GLOBAL->context, name);
}
if ((var == NULL) && (flags & FIND_ENV)) {
char *env;
@@ -390,7 +390,7 @@
} else if (checkEnvFirst && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL))
{
- var = Hash_FindEntry (&VAR_GLOBAL->context, name);
+ var = Hash_FindEntry(&VAR_GLOBAL->context, name);
if (var == NULL) {
return ((Var *) NIL);
} else {
@@ -432,7 +432,7 @@
int len;
Hash_Entry *h;
- v = (Var *) emalloc (sizeof (Var));
+ v = (Var *) emalloc(sizeof (Var));
len = val ? strlen(val) : 0;
v->val = Buf_Init(len+1);
@@ -440,7 +440,7 @@
v->flags = 0;
- h = Hash_CreateEntry (&ctxt->context, name, NULL);
+ h = Hash_CreateEntry(&ctxt->context, name, NULL);
Hash_SetValue(h, v);
v->name = h->name;
if (DEBUG(VAR)) {
@@ -523,9 +523,9 @@
name = Var_Subst(NULL, cp, ctxt, 0);
} else
name = cp;
- v = VarFind (name, ctxt, 0);
+ v = VarFind(name, ctxt, 0);
if (v == (Var *) NIL) {
- VarAdd (name, val, ctxt);
+ VarAdd(name, val, ctxt);
} else {
Buf_Discard(v->val, Buf_Size(v->val));
Buf_AddBytes(v->val, strlen(val), (const Byte *)val);
@@ -594,10 +594,10 @@
} else
name = cp;
- v = VarFind (name, ctxt, (ctxt == VAR_GLOBAL) ? FIND_ENV : 0);
+ v = VarFind(name, ctxt, (ctxt == VAR_GLOBAL) ? FIND_ENV : 0);
if (v == (Var *) NIL) {
- VarAdd (name, val, ctxt);
+ VarAdd(name, val, ctxt);
} else {
Buf_AddByte(v->val, (Byte)' ');
Buf_AddBytes(v->val, strlen(val), (const Byte *)val);
@@ -615,7 +615,7 @@
* export other variables...)
*/
v->flags &= ~VAR_FROM_ENV;
- h = Hash_CreateEntry (&ctxt->context, name, NULL);
+ h = Hash_CreateEntry(&ctxt->context, name, NULL);
Hash_SetValue(h, v);
}
}
@@ -678,7 +678,7 @@
{
Var *v;
- v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+ v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
*frp = NULL;
if (v != (Var *) NIL) {
char *p = ((char *)Buf_GetAll(v->val, (int *)NULL));
@@ -728,7 +728,7 @@
Buf_AddByte (buf, vpstate->varSpace);
}
*slash = '\0';
- Buf_AddBytes (buf, strlen (word), (Byte *)word);
+ Buf_AddBytes(buf, strlen (word), (Byte *)word);
*slash = '/';
return (TRUE);
} else {
@@ -777,10 +777,10 @@
slash = strrchr (word, '/');
if (slash != (char *)NULL) {
*slash++ = '\0';
- Buf_AddBytes (buf, strlen(slash), (Byte *)slash);
+ Buf_AddBytes(buf, strlen(slash), (Byte *)slash);
slash[-1] = '/';
} else {
- Buf_AddBytes (buf, strlen(word), (Byte *)word);
+ Buf_AddBytes(buf, strlen(word), (Byte *)word);
}
return (dummy ? TRUE : TRUE);
}
@@ -818,7 +818,7 @@
Buf_AddByte (buf, vpstate->varSpace);
}
*dot++ = '\0';
- Buf_AddBytes (buf, strlen (dot), (Byte *)dot);
+ Buf_AddBytes(buf, strlen (dot), (Byte *)dot);
dot[-1] = '.';
addSpace = TRUE;
}
@@ -860,10 +860,10 @@
dot = strrchr (word, '.');
if (dot != (char *)NULL) {
*dot = '\0';
- Buf_AddBytes (buf, strlen (word), (Byte *)word);
+ Buf_AddBytes(buf, strlen (word), (Byte *)word);
*dot = '.';
} else {
- Buf_AddBytes (buf, strlen(word), (Byte *)word);
+ Buf_AddBytes(buf, strlen(word), (Byte *)word);
}
return (dummy ? TRUE : TRUE);
}
@@ -1412,7 +1412,7 @@
int ac, i;
int start, end, step;
- buf = Buf_Init (0);
+ buf = Buf_Init(0);
addSpace = FALSE;
if (vpstate->oneBigWord) {
@@ -1467,7 +1467,7 @@
Buf_AddByte (buf, '\0');
as = (char *)Buf_GetAll (buf, (int *)NULL);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
return (as);
}
@@ -1505,7 +1505,7 @@
char *as; /* word list memory */
int ac, i;
- buf = Buf_Init (0);
+ buf = Buf_Init(0);
addSpace = FALSE;
if (vpstate->oneBigWord) {
@@ -1528,7 +1528,7 @@
Buf_AddByte (buf, '\0');
as = (char *)Buf_GetAll (buf, (int *)NULL);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
return (as);
}
@@ -1564,7 +1564,7 @@
char *as; /* word list memory */
int ac, i;
- buf = Buf_Init (0);
+ buf = Buf_Init(0);
av = brk_string(str, &ac, FALSE, &as);
@@ -1582,7 +1582,7 @@
Buf_AddByte (buf, '\0');
as = (char *)Buf_GetAll (buf, (int *)NULL);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
return (as);
}
@@ -1782,7 +1782,7 @@
/* This should cover most shells :-( */
static char meta[] = "\n \t'`\";&<>()|*?{}[]\\$!#^~";
- buf = Buf_Init (MAKE_BSIZE);
+ buf = Buf_Init(MAKE_BSIZE);
for (; *str; str++) {
if (strchr(meta, *str) != NULL)
Buf_AddByte(buf, (Byte)'\\');
@@ -1790,7 +1790,7 @@
}
Buf_AddByte(buf, (Byte) '\0');
str = (char *)Buf_GetAll (buf, (int *)NULL);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
return str;
}
@@ -1818,13 +1818,13 @@
int (*modProc)(int);
modProc = (upper ? toupper : tolower);
- buf = Buf_Init (MAKE_BSIZE);
+ buf = Buf_Init(MAKE_BSIZE);
for (; *str ; str++) {
Buf_AddByte(buf, (Byte) modProc(*str));
}
Buf_AddByte(buf, (Byte) '\0');
- str = (char *) Buf_GetAll (buf, (int *) NULL);
- Buf_Destroy (buf, FALSE);
+ str = (char *) Buf_GetAll(buf, (int *) NULL);
+ Buf_Destroy(buf, FALSE);
return str;
}
@@ -1897,7 +1897,7 @@
name[0] = str[1];
name[1] = '\0';
- v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+ v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
if (v == (Var *)NIL) {
*lengthPtr = 2;
@@ -1936,7 +1936,7 @@
startc = str[1];
endc = startc == '(' ? ')' : '}';
- buf = Buf_Init (MAKE_BSIZE);
+ buf = Buf_Init(MAKE_BSIZE);
/*
* Skip to the end character or a colon, whichever comes first.
@@ -1980,7 +1980,7 @@
str = Buf_GetAll(buf, (int *) NULL);
vlen = strlen(str);
- v = VarFind (str, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
+ v = VarFind(str, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
if ((v == (Var *)NIL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) &&
(vlen == 2) && (str[1] == 'F' || str[1] == 'D'))
{
@@ -2028,7 +2028,7 @@
*freePtr = TRUE;
*lengthPtr = tstr-start+1;
*WR(tstr) = endc;
- Buf_Destroy (buf, TRUE);
+ Buf_Destroy(buf, TRUE);
return(val);
}
break;
@@ -2087,10 +2087,10 @@
strncpy(pstr, start, *lengthPtr);
pstr[*lengthPtr] = '\0';
*freePtr = TRUE;
- Buf_Destroy (buf, TRUE);
+ Buf_Destroy(buf, TRUE);
return(pstr);
} else {
- Buf_Destroy (buf, TRUE);
+ Buf_Destroy(buf, TRUE);
return (err ? var_Error : varNoError);
}
} else {
@@ -2102,10 +2102,10 @@
v->name = UNCONST(str);
v->val = Buf_Init(1);
v->flags = VAR_JUNK;
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
}
} else
- Buf_Destroy (buf, TRUE);
+ Buf_Destroy(buf, TRUE);
}
@@ -2296,9 +2296,9 @@
Var_Append(v->name, pattern.rhs, v_ctxt);
break;
case '!':
- newStr = Cmd_Exec (pattern.rhs, &emsg);
+ newStr = Cmd_Exec(pattern.rhs, &emsg);
if (emsg)
- Error (emsg, nstr);
+ Error(emsg, nstr);
else
Var_Set(v->name, newStr, v_ctxt, 0);
if (newStr)
@@ -2448,10 +2448,10 @@
NULL, &pattern.rightLen,
NULL)) == NULL)
goto cleanup;
- newStr = Cmd_Exec (pattern.rhs, &emsg);
+ newStr = Cmd_Exec(pattern.rhs, &emsg);
free(UNCONST(pattern.rhs));
if (emsg)
- Error (emsg, nstr);
+ Error(emsg, nstr);
termc = *cp;
delim = '\0';
if (v->flags & VAR_JUNK) {
@@ -2675,7 +2675,7 @@
* ":tu", ":tl"
*/
if (tstr[1] == 'u' || tstr[1] == 'l') {
- newStr = VarChangeCase (nstr, (tstr[1] == 'u'));
+ newStr = VarChangeCase(nstr, (tstr[1] == 'u'));
cp = tstr + 2;
termc = *cp;
} else if (tstr[1] == 'W' || tstr[1] == 'w') {
@@ -2964,7 +2964,7 @@
#endif
case 'Q':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarQuote (nstr);
+ newStr = VarQuote(nstr);
cp = tstr + 1;
termc = *cp;
break;
@@ -3008,7 +3008,7 @@
/*FALLTHRU*/
case 'O':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarSort (nstr);
+ newStr = VarSort(nstr);
cp = tstr + 1;
termc = *cp;
break;
@@ -3016,7 +3016,7 @@
/*FALLTHRU*/
case 'u':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarUniq (nstr);
+ newStr = VarUniq(nstr);
cp = tstr + 1;
termc = *cp;
break;
@@ -3026,9 +3026,9 @@
case 's':
if (tstr[1] == 'h' && (tstr[2] == endc || tstr[2] == ':')) {
const char *emsg;
- newStr = Cmd_Exec (nstr, &emsg);
+ newStr = Cmd_Exec(nstr, &emsg);
if (emsg)
- Error (emsg, nstr);
+ Error(emsg, nstr);
cp = tstr + 2;
termc = *cp;
break;
@@ -3099,7 +3099,7 @@
} else
#endif
{
- Error ("Unknown modifier '%c'", *tstr);
+ Error("Unknown modifier '%c'", *tstr);
for (cp = tstr+1;
*cp != ':' && *cp != endc && *cp != '\0';
cp++)
@@ -3229,7 +3229,7 @@
* been reported to prevent a plethora
* of messages when recursing */
- buf = Buf_Init (MAKE_BSIZE);
+ buf = Buf_Init(MAKE_BSIZE);
errorReported = FALSE;
while (*str) {
@@ -3308,7 +3308,7 @@
continue;
}
- val = Var_Parse (str, ctxt, undefErr, &length, &doFree);
+ val = Var_Parse(str, ctxt, undefErr, &length, &doFree);
/*
* When we come down here, val should either point to the
@@ -3332,7 +3332,7 @@
* when the file is parsed.
*/
if (!errorReported) {
- Parse_Error (PARSE_FATAL,
+ Parse_Error(PARSE_FATAL,
"Undefined variable \"%.*s\"",length,str);
}
str += length;
@@ -3352,7 +3352,7 @@
* Copy all the characters from the variable value straight
* into the new string.
*/
- Buf_AddBytes (buf, strlen (val), (Byte *)val);
+ Buf_AddBytes(buf, strlen (val), (Byte *)val);
if (doFree) {
free ((Address)val);
}
@@ -3362,7 +3362,7 @@
Buf_AddByte (buf, '\0');
val = (char *)Buf_GetAll (buf, (int *)NULL);
- Buf_Destroy (buf, FALSE);
+ Buf_Destroy(buf, FALSE);
return (val);
}
@@ -3430,8 +3430,8 @@
void
Var_Init(void)
{
- VAR_GLOBAL = Targ_NewGN ("Global");
- VAR_CMD = Targ_NewGN ("Command");
+ VAR_GLOBAL = Targ_NewGN("Global");
+ VAR_CMD = Targ_NewGN("Command");
}
Index: lst.lib/lstAtEnd.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstAtEnd.c,v
retrieving revision 1.10
diff -u -r1.10 lstAtEnd.c
--- lst.lib/lstAtEnd.c 7 May 2004 00:04:41 -0000 1.10
+++ lst.lib/lstAtEnd.c 1 Feb 2005 22:41:12 -0000
@@ -74,6 +74,6 @@
{
LstNode end;
- end = Lst_Last (l);
- return (Lst_Append (l, end, d));
+ end = Lst_Last(l);
+ return (Lst_Append(l, end, d));
}
Index: lst.lib/lstAtFront.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstAtFront.c,v
retrieving revision 1.10
diff -u -r1.10 lstAtFront.c
--- lst.lib/lstAtFront.c 7 May 2004 00:04:41 -0000 1.10
+++ lst.lib/lstAtFront.c 1 Feb 2005 22:41:12 -0000
@@ -71,6 +71,6 @@
{
LstNode front;
- front = Lst_First (l);
- return (Lst_Insert (l, front, d));
+ front = Lst_First(l);
+ return (Lst_Insert(l, front, d));
}
Index: lst.lib/lstDeQueue.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstDeQueue.c,v
retrieving revision 1.10
diff -u -r1.10 lstDeQueue.c
--- lst.lib/lstDeQueue.c 7 May 2004 00:04:41 -0000 1.10
+++ lst.lib/lstDeQueue.c 1 Feb 2005 22:41:12 -0000
@@ -72,13 +72,13 @@
ClientData rd;
ListNode tln;
- tln = (ListNode) Lst_First (l);
+ tln = (ListNode) Lst_First(l);
if (tln == NilListNode) {
return ((ClientData) NIL);
}
rd = tln->datum;
- if (Lst_Remove (l, (LstNode)tln) == FAILURE) {
+ if (Lst_Remove(l, (LstNode)tln) == FAILURE) {
return ((ClientData) NIL);
} else {
return (rd);
Index: lst.lib/lstDupl.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstDupl.c,v
retrieving revision 1.11
diff -u -r1.11 lstDupl.c
--- lst.lib/lstDupl.c 7 May 2004 00:04:41 -0000 1.11
+++ lst.lib/lstDupl.c 1 Feb 2005 22:41:13 -0000
@@ -81,7 +81,7 @@
return (NILLST);
}
- nl = Lst_Init (list->isCirc);
+ nl = Lst_Init(list->isCirc);
if (nl == NILLST) {
return (NILLST);
}
@@ -89,10 +89,10 @@
ln = list->firstPtr;
while (ln != NilListNode) {
if (copyProc != NOCOPY) {
- if (Lst_AtEnd (nl, (*copyProc) (ln->datum)) == FAILURE) {
+ if (Lst_AtEnd(nl, (*copyProc) (ln->datum)) == FAILURE) {
return (NILLST);
}
- } else if (Lst_AtEnd (nl, ln->datum) == FAILURE) {
+ } else if (Lst_AtEnd(nl, ln->datum) == FAILURE) {
return (NILLST);
}
Index: lst.lib/lstEnQueue.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstEnQueue.c,v
retrieving revision 1.10
diff -u -r1.10 lstEnQueue.c
--- lst.lib/lstEnQueue.c 7 May 2004 00:04:41 -0000 1.10
+++ lst.lib/lstEnQueue.c 1 Feb 2005 22:41:13 -0000
@@ -73,6 +73,6 @@
return (FAILURE);
}
- return (Lst_Append (l, Lst_Last(l), d));
+ return (Lst_Append(l, Lst_Last(l), d));
}
Index: lst.lib/lstFind.c
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstFind.c,v
retrieving revision 1.11
diff -u -r1.11 lstFind.c
--- lst.lib/lstFind.c 7 May 2004 00:04:41 -0000 1.11
+++ lst.lib/lstFind.c 1 Feb 2005 22:41:13 -0000
@@ -69,6 +69,6 @@
LstNode
Lst_Find(Lst l, ClientData d, int (*cProc)(ClientData, ClientData))
{
- return (Lst_FindFrom (l, Lst_First(l), d, cProc));
+ return (Lst_FindFrom(l, Lst_First(l), d, cProc));
}
Index: lst.lib/lstInt.h
===================================================================
RCS file: /cvsroot/src/usr.bin/make/lst.lib/lstInt.h,v
retrieving revision 1.10
diff -u -r1.10 lstInt.h
--- lst.lib/lstInt.h 6 May 2004 23:15:46 -0000 1.10
+++ lst.lib/lstInt.h 1 Feb 2005 22:41:13 -0000
@@ -86,7 +86,7 @@
* PAlloc (var, ptype) --
* Allocate a pointer-typedef structure 'ptype' into the variable 'var'
*/
-#define PAlloc(var,ptype) var = (ptype) emalloc (sizeof (*var))
+#define PAlloc(var,ptype) var = (ptype) emalloc(sizeof (*var))
/*
* LstValid (l) --
--------------090607050603080104090407--