General whitespace cleanup: remove mixes of tabs and spaces, remove

space after function names, remove spaces on emtpy lines.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
This commit is contained in:
Hartmut Brandt 2005-02-04 12:38:57 +00:00
parent 435916b011
commit ce8c7083f4
7 changed files with 85 additions and 86 deletions

View File

@ -52,39 +52,39 @@ __FBSDID("$FreeBSD$");
* is referenced.
*
* The interface to this module is:
* Arch_ParseArchive Given an archive specification, return a list
* of GNode's, one for each member in the spec.
* FAILURE is returned if the specification is
* invalid for some reason.
* Arch_ParseArchive Given an archive specification, return a list
* of GNode's, one for each member in the spec.
* FAILURE is returned if the specification is
* invalid for some reason.
*
* Arch_Touch Alter the modification time of the archive
* member described by the given node to be
* the current time.
* Arch_Touch Alter the modification time of the archive
* member described by the given node to be
* the current time.
*
* Arch_TouchLib Update the modification time of the library
* described by the given node. This is special
* because it also updates the modification time
* of the library's table of contents.
* Arch_TouchLib Update the modification time of the library
* described by the given node. This is special
* because it also updates the modification time
* of the library's table of contents.
*
* Arch_MTime Find the modification time of a member of
* an archive *in the archive*. The time is also
* placed in the member's GNode. Returns the
* modification time.
* Arch_MTime Find the modification time of a member of
* an archive *in the archive*. The time is also
* placed in the member's GNode. Returns the
* modification time.
*
* Arch_MemTime Find the modification time of a member of
* an archive. Called when the member doesn't
* already exist. Looks in the archive for the
* modification time. Returns the modification
* time.
* Arch_MemTime Find the modification time of a member of
* an archive. Called when the member doesn't
* already exist. Looks in the archive for the
* modification time. Returns the modification
* time.
*
* Arch_FindLib Search for a library along a path. The
* library name in the GNode should be in
* -l<name> format.
* Arch_FindLib Search for a library along a path. The
* library name in the GNode should be in
* -l<name> format.
*
* Arch_LibOODate Special function to decide if a library node
* is out-of-date.
* Arch_LibOODate Special function to decide if a library node
* is out-of-date.
*
* Arch_Init Initialize this module.
* Arch_Init Initialize this module.
*/
#include <sys/param.h>
@ -112,11 +112,11 @@ __FBSDID("$FreeBSD$");
static Lst archives = Lst_Initializer(archives);
typedef struct Arch {
char *name; /* Name of archive */
Hash_Table members; /* All the members of the archive described
* by <name, struct ar_hdr *> key/value pairs */
char *fnametab; /* Extended name table strings */
size_t fnamesize; /* Size of the string table */
char *name; /* Name of archive */
Hash_Table members; /* All the members of the archive described
* by <name, struct ar_hdr *> key/value pairs */
char *fnametab; /* Extended name table strings */
size_t fnamesize; /* Size of the string table */
} Arch;
static struct ar_hdr *ArchStatMember(const char *, const char *, Boolean);
@ -149,14 +149,14 @@ static int ArchSVR4Entry(Arch *, char *, size_t, FILE *);
ReturnStatus
Arch_ParseArchive(char **linePtr, Lst *nodeLst, GNode *ctxt)
{
char *cp; /* Pointer into line */
GNode *gn; /* New node */
char *libName; /* Library-part of specification */
char *memName; /* Member-part of specification */
char *nameBuf; /* temporary place for node name */
char saveChar; /* Ending delimiter of member-name */
Boolean subLibName; /* TRUE if libName should have/had
* variable substitution performed on it */
char *cp; /* Pointer into line */
GNode *gn; /* New node */
char *libName; /* Library-part of specification */
char *memName; /* Member-part of specification */
char *nameBuf; /* temporary place for node name */
char saveChar; /* Ending delimiter of member-name */
Boolean subLibName; /* TRUE if libName should have/had
* variable substitution performed on it */
libName = *linePtr;
@ -436,16 +436,15 @@ static struct ar_hdr *
ArchStatMember(const char *archive, const char *member, Boolean hash)
{
#define AR_MAX_NAME_LEN (sizeof(arh.ar_name) - 1)
FILE * arch; /* Stream to archive */
int size; /* Size of archive member */
char *cp; /* Useful character pointer */
char magic[SARMAG];
LstNode *ln; /* Lst member containing archive descriptor */
Arch *ar; /* Archive descriptor */
Hash_Entry *he; /* Entry containing member's description */
struct ar_hdr arh; /* archive-member header for reading archive */
char memName[MAXPATHLEN + 1];
/* Current member name while hashing. */
FILE *arch; /* Stream to archive */
int size; /* Size of archive member */
char *cp; /* Useful character pointer */
char magic[SARMAG];
LstNode *ln; /* Lst member containing archive descriptor */
Arch *ar; /* Archive descriptor */
Hash_Entry *he; /* Entry containing member's description */
struct ar_hdr arh; /* archive-member header for reading archive */
char memName[MAXPATHLEN + 1]; /* Current member name while hashing. */
/*
* Because of space constraints and similar things, files are archived
@ -515,7 +514,7 @@ ArchStatMember(const char *archive, const char *member, Boolean hash)
* can handle...
*/
if ((fread(magic, SARMAG, 1, arch) != 1) ||
(strncmp(magic, ARMAG, SARMAG) != 0)) {
(strncmp(magic, ARMAG, SARMAG) != 0)) {
fclose(arch);
return (NULL);
}
@ -756,7 +755,7 @@ ArchFindMember(const char *archive, const char *member, struct ar_hdr *arhPtr,
* can handle...
*/
if ((fread(magic, SARMAG, 1, arch) != 1) ||
(strncmp(magic, ARMAG, SARMAG) != 0)) {
(strncmp(magic, ARMAG, SARMAG) != 0)) {
fclose(arch);
return (NULL);
}
@ -919,9 +918,9 @@ void
Arch_TouchLib(GNode *gn)
{
#ifdef RANLIBMAG
FILE * arch; /* Stream open to archive */
struct ar_hdr arh; /* Header describing table of contents */
struct utimbuf times; /* Times for utime() call */
FILE *arch; /* Stream open to archive */
struct ar_hdr arh; /* Header describing table of contents */
struct utimbuf times; /* Times for utime() call */
arch = ArchFindMember(gn->path, RANLIBMAG, &arh, "r+");
snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
@ -991,10 +990,10 @@ Arch_MTime(GNode *gn)
int
Arch_MemMTime(GNode *gn)
{
LstNode *ln;
GNode *pgn;
char *nameStart,
*nameEnd;
LstNode *ln;
GNode *pgn;
char *nameStart;
char *nameEnd;
for (ln = Lst_First(&gn->parents); ln != NULL; ln = Lst_Succ(ln)) {
pgn = Lst_Datum(ln);
@ -1083,13 +1082,13 @@ Arch_FindLib(GNode *gn, Lst *path)
* A library will be considered out-of-date for any of these reasons,
* given that it is a target on a dependency line somewhere:
* Its modification time is less than that of one of its
* sources (gn->mtime < gn->cmtime).
* sources (gn->mtime < gn->cmtime).
* Its modification time is greater than the time at which the
* make began (i.e. it's been modified in the course
* of the make, probably by archiving).
* make began (i.e. it's been modified in the course
* of the make, probably by archiving).
* The modification time of one of its sources is greater than
* the one of its RANLIBMAG member (i.e. its table of contents
* is out-of-date). We don't compare of the archive time
* is out-of-date). We don't compare of the archive time
* vs. TOC time because they can be too close. In my
* opinion we should not bother with the TOC at all since
* this is used by 'ar' rules that affect the data contents
@ -1107,7 +1106,7 @@ Arch_FindLib(GNode *gn, Lst *path)
Boolean
Arch_LibOODate(GNode *gn)
{
Boolean oodate;
Boolean oodate;
if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->children)) {
oodate = FALSE;
@ -1115,8 +1114,8 @@ Arch_LibOODate(GNode *gn)
oodate = TRUE;
} else {
#ifdef RANLIBMAG
struct ar_hdr *arhPtr; /* Header for __.SYMDEF */
int modTimeTOC; /* The table-of-contents's mod time */
struct ar_hdr *arhPtr; /* Header for __.SYMDEF */
int modTimeTOC; /* The table-of-contents's mod time */
arhPtr = ArchStatMember(gn->path, RANLIBMAG, FALSE);

View File

@ -138,7 +138,7 @@ CompatCatchSig(int signo)
*-----------------------------------------------------------------------
*/
static void
CompatInterrupt (int signo)
CompatInterrupt(int signo)
{
GNode *gn;
sigset_t nmask, omask;
@ -269,7 +269,7 @@ Compat_RunCommand(void *cmdp, void *gnp)
} else {
cmd = cmdStart;
}
Lst_Replace (cmdNode, cmdStart);
Lst_Replace(cmdNode, cmdStart);
if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
Lst_AtEnd(&ENDNode->commands, cmdStart);
@ -374,7 +374,7 @@ Compat_RunCommand(void *cmdp, void *gnp)
}
if (cpid == 0) {
execvp(av[0], av);
write(STDERR_FILENO, av[0], strlen (av[0]));
write(STDERR_FILENO, av[0], strlen(av[0]));
write(STDERR_FILENO, ":", 1);
write(STDERR_FILENO, strerror(errno), strlen(strerror(errno)));
write(STDERR_FILENO, "\n", 1);

View File

@ -504,7 +504,7 @@ Make_Update(GNode *cgn)
*/
cpref = Var_Value(PREFIX, cgn, &ptr);
for (ln = Lst_First(&cgn->iParents); ln != NULL; ln = Lst_Succ(ln)) {
pgn = Lst_Datum (ln);
pgn = Lst_Datum(ln);
if (pgn->make) {
Var_Set(IMPSRC, cname, pgn);
Var_Set(PREFIX, cpref, pgn);

View File

@ -682,7 +682,7 @@ ParseClearPath(void *path, void *dummy __unused)
*---------------------------------------------------------------------
*/
static void
ParseDoDependency (char *line)
ParseDoDependency(char *line)
{
char *cp; /* our current position */
GNode *gn; /* a general purpose temporary node */
@ -1129,7 +1129,7 @@ ParseDoDependency (char *line)
} else {
Lst curSrcs = Lst_Initializer(curSrc); /* list of sources in order */
while (*line) {
/*
* The targets take real sources, so we must beware of archive
@ -1611,7 +1611,7 @@ ParseDoWarning(char *warnmsg)
*---------------------------------------------------------------------
*/
static void
ParseDoInclude (char *file)
ParseDoInclude(char *file)
{
char *fullname; /* full pathname of file */
IFile *oldFile; /* state associated with current file */
@ -1743,7 +1743,7 @@ ParseDoInclude (char *file)
* is placed on a list with other IFile structures. The list makes
* a very nice stack to track how we got here...
*/
oldFile = emalloc(sizeof (IFile));
oldFile = emalloc(sizeof(IFile));
memcpy(oldFile, &curFile, sizeof(IFile));
Lst_AtFront(&includes, oldFile);
@ -1796,7 +1796,7 @@ Parse_FromString(char *str, int lineno)
Lst_AtFront(&includes, oldFile);
curFile.F = NULL;
curFile.p = emalloc(sizeof (PTR));
curFile.p = emalloc(sizeof(PTR));
curFile.p->str = curFile.p->ptr = str;
curFile.lineno = lineno;
curFile.fname = estrdup(curFile.fname);
@ -1820,7 +1820,7 @@ Parse_FromString(char *str, int lineno)
*---------------------------------------------------------------------
*/
static void
ParseTraditionalInclude (char *file)
ParseTraditionalInclude(char *file)
{
char *fullname; /* full pathname of file */
IFile *oldFile; /* state associated with current file */
@ -2395,7 +2395,7 @@ Parse_File(char *name, FILE *stream)
continue;
}
if (strncmp(cp, "include", 7) == 0) {
ParseDoInclude (cp + 7);
ParseDoInclude(cp + 7);
goto nextLine;
} else if (strncmp(cp, "error", 5) == 0) {
ParseDoError(cp + 5);
@ -2495,7 +2495,7 @@ Parse_File(char *name, FILE *stream)
Lst_Destroy(&targets, NOFREE);
inLine = TRUE;
ParseDoDependency (line);
ParseDoDependency(line);
}
nextLine:

View File

@ -441,7 +441,7 @@ SuffInsert(Lst *l, Suff *s)
DEBUGF(SUFF, ("inserting %s(%d)...", s->name, s->sNum));
if (ln == NULL) {
DEBUGF(SUFF, ("at end of list\n"));
Lst_AtEnd (l, s);
Lst_AtEnd(l, s);
s->refCount++;
Lst_AtEnd(&s->ref, l);
} else if (s2->sNum != s->sNum) {
@ -549,7 +549,7 @@ SuffParseTransform(char *str, Suff **srcPtr, Suff **targPtr)
}
return (FALSE);
}
src = Lst_Datum (srcLn);
src = Lst_Datum(srcLn);
str2 = str + src->nameLen;
if (*str2 == '\0') {
single = src;
@ -804,7 +804,7 @@ Suff_AddSuffix(char *str)
s = emalloc(sizeof(Suff));
s->name = estrdup(str);
s->nameLen = strlen (s->name);
s->nameLen = strlen(s->name);
Lst_Init(&s->searchPath);
Lst_Init(&s->children);
Lst_Init(&s->parents);
@ -1199,7 +1199,7 @@ SuffFindThem(Lst *srcs, Lst *slst)
*-----------------------------------------------------------------------
*/
static Src *
SuffFindCmds (Src *targ, Lst *slst)
SuffFindCmds(Src *targ, Lst *slst)
{
LstNode *ln; /* General-purpose list node */
GNode *t, /* Target GNode */
@ -2166,7 +2166,7 @@ SuffFindDeps(GNode *gn, Lst *slst)
if (gn->suffix)
gn->suffix->refCount--;
if (ln != NULL) {
gn->suffix = s = Lst_Datum (ln);
gn->suffix = s = Lst_Datum(ln);
gn->suffix->refCount++;
Arch_FindLib(gn, &s->searchPath);
} else {

View File

@ -194,7 +194,7 @@ Targ_FindNode(const char *name, int flags)
he = Hash_CreateEntry(&targets, name, &isNew);
if (isNew) {
gn = Targ_NewGN(name);
Hash_SetValue (he, gn);
Hash_SetValue(he, gn);
Lst_AtEnd(&allTargets, gn);
}
} else {
@ -392,7 +392,7 @@ Targ_FmtTime(time_t modtime)
parts = localtime(&modtime);
strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
strftime(buf, sizeof(buf), "%H:%M:%S %b %d, %Y", parts);
buf[sizeof(buf) - 1] = '\0';
return (buf);
}

View File

@ -608,7 +608,7 @@ VarModify(char *str, Boolean (*modProc)(const char *, Boolean, Buffer *, void *)
for (i = 1; i < ac; i++)
addSpace = (*modProc)(av[i], addSpace, buf, datum);
Buf_AddByte (buf, '\0');
Buf_AddByte(buf, '\0');
str = (char *)Buf_GetAll(buf, (size_t *)NULL);
Buf_Destroy(buf, FALSE);
return (str);
@ -1848,7 +1848,7 @@ Var_Subst(const char *var, char *str, GNode *ctxt, Boolean undefErr)
str += length;
errorReported = TRUE;
} else {
Buf_AddByte (buf, (Byte)*str);
Buf_AddByte(buf, (Byte)*str);
str += 1;
}
} else {