diff options
| author | christos <christos@NetBSD.org> | 2005-07-25 22:55:58 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-07-25 22:55:58 +0000 |
| commit | 3692d77541719fcf01cd0767f047ec48db1a5eba (patch) | |
| tree | d27c36361ad666a23b1503410d1a3da7b39d28f7 /usr.bin/make/parse.c | |
| parent | c3414672de892161e24b25495c8512650cd9d90a (diff) | |
Whitespace KNF cleanup from Max Okumoto
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index d7f670685a9..7e8f366b3ab 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.102 2005/06/18 14:32:04 rpaulo Exp $ */ +/* $NetBSD: parse.c,v 1.103 2005/07/25 22:55:58 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.102 2005/06/18 14:32:04 rpaulo Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.103 2005/07/25 22:55:58 christos Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.102 2005/06/18 14:32:04 rpaulo Exp $"); +__RCSID("$NetBSD: parse.c,v 1.103 2005/07/25 22:55:58 christos Exp $"); #endif #endif /* not lint */ #endif @@ -373,7 +373,7 @@ ParseFindKeyword(char *str) do { cur = start + ((end - start) / 2); - diff = strcmp (str, parseKeywords[cur].name); + diff = strcmp(str, parseKeywords[cur].name); if (diff == 0) { return (cur); @@ -510,10 +510,10 @@ ParseLinkSrc(ClientData pgnp, ClientData cgnp) GNode *cgn = (GNode *) cgnp; if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (pgn->cohorts)) - pgn = (GNode *) Lst_Datum(Lst_Last(pgn->cohorts)); - (void)Lst_AtEnd (pgn->children, (ClientData)cgn); + 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); + (void)Lst_AtEnd(cgn->parents, (ClientData)pgn); pgn->unmade += 1; return (0); } @@ -759,7 +759,7 @@ ParseDoSrc(int tOp, char *src, Lst allsrc, Boolean resolve) * 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. @@ -872,7 +872,7 @@ ParseFindMain(ClientData gnp, ClientData dummy) static int ParseAddDir(ClientData path, ClientData name) { - (void) Dir_AddDir((Lst) path, (char *) name); + (void)Dir_AddDir((Lst) path, (char *) name); return(0); } @@ -1112,7 +1112,7 @@ ParseDoDependency(char *line) default: break; } - } else if (strncmp (line, ".PATH", 5) == 0) { + } else if (strncmp(line, ".PATH", 5) == 0) { /* * .PATH<suffix> has to be handled specially. * Call on the suffix module to give us a path to @@ -1170,7 +1170,7 @@ ParseDoDependency(char *line) gn = Suff_AddTransform(targName); } - (void)Lst_AtEnd (targets, (ClientData)gn); + (void)Lst_AtEnd(targets, (ClientData)gn); } } else if (specType == ExPath && *line != '.' && *line != '\0') { Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line); @@ -1424,7 +1424,7 @@ ParseDoDependency(char *line) } while (!Lst_IsEmpty (sources)) { - gn = (GNode *) Lst_DeQueue(sources); + gn = (GNode *)Lst_DeQueue(sources); ParseDoSrc(tOp, gn->name, curSrcs, hasWait); } Lst_Destroy(sources, NOFREE); @@ -1766,7 +1766,7 @@ ParseAddCmd(ClientData gnp, ClientData cmd) 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); @@ -1838,7 +1838,7 @@ ParseHasCommands(ClientData gnp) void Parse_AddIncludeDir(char *dir) { - (void) Dir_AddDir(parseIncPath, dir); + (void)Dir_AddDir(parseIncPath, dir); } /*- @@ -1937,7 +1937,7 @@ ParseDoInclude(char *line) /* Make a temporary copy of this, to be safe. */ Fname = estrdup(curFile.fname); - prefEnd = strrchr (Fname, '/'); + prefEnd = strrchr(Fname, '/'); if (prefEnd != (char *)NULL) { char *newName; @@ -1950,12 +1950,12 @@ ParseDoInclude(char *line) if (fullname == (char *)NULL) { fullname = Dir_FindFile(newName, dirSearchPath); } - free (newName); + free(newName); *prefEnd = '/'; } else { fullname = (char *)NULL; } - free (Fname); + free(Fname); if (fullname == (char *)NULL) { /* * Makefile wasn't found in same directory as included makefile. @@ -1996,9 +1996,9 @@ ParseDoInclude(char *line) */ oldFile = emalloc(sizeof(IFile)); - memcpy(oldFile, &curFile, 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 @@ -2011,7 +2011,7 @@ ParseDoInclude(char *line) ParseSetParseFile(curFile.fname); - curFile.F = fopen (fullname, "r"); + curFile.F = fopen(fullname, "r"); curFile.P = NULL; if (curFile.F == (FILE * ) NULL) { @@ -2020,7 +2020,7 @@ ParseDoInclude(char *line) /* * Pop to previous file */ - (void) ParseEOF(0); + (void)ParseEOF(0); } } @@ -2076,12 +2076,12 @@ Parse_FromString(char *str, int lineno) IFile *oldFile; /* state associated with this file */ if (DEBUG(FOR)) - (void) fprintf(stderr, "%s\n---- at line %d\n", str, lineno); + (void)fprintf(stderr, "%s\n---- at line %d\n", str, lineno); oldFile = emalloc(sizeof(IFile)); - memcpy(oldFile, &curFile, sizeof (IFile)); + memcpy(oldFile, &curFile, sizeof(IFile)); - (void) Lst_AtFront(includes, (ClientData)oldFile); + (void)Lst_AtFront(includes, (ClientData)oldFile); curFile.F = NULL; curFile.P = emalloc(sizeof(PTR)); @@ -2175,7 +2175,7 @@ ParseTraditionalInclude(char *line) if (fullname == NULL) { fullname = Dir_FindFile(newName, dirSearchPath); } - free (newName); + free(newName); *prefEnd = '/'; } else { fullname = NULL; @@ -2221,9 +2221,9 @@ ParseTraditionalInclude(char *line) * a very nice stack to track how we got here... */ oldFile = emalloc(sizeof(IFile)); - memcpy(oldFile, &curFile, 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 @@ -2244,7 +2244,7 @@ ParseTraditionalInclude(char *line) /* * Pop to previous file */ - (void) ParseEOF(1); + (void)ParseEOF(1); } } } @@ -2276,20 +2276,20 @@ ParseEOF(int opened) return (DONE); } - ifile = (IFile *) Lst_DeQueue(includes); + ifile = (IFile *)Lst_DeQueue(includes); /* XXX dispose of curFile info */ - free ((Address) curFile.fname); + free((Address) curFile.fname); if (opened && curFile.F) - (void) fclose (curFile.F); + (void)fclose(curFile.F); if (curFile.P) { free((Address) curFile.P->str); free((Address) curFile.P); } - memcpy(&curFile, ifile, sizeof (IFile)); + memcpy(&curFile, ifile, sizeof(IFile)); - free ((Address)ifile); + free((Address)ifile); /* pop the PARSEDIR/PARSEFILE variables */ ParseSetParseFile(curFile.fname); @@ -2467,7 +2467,7 @@ ParseReadLine(void) lastc = c; buf = Buf_Init(MAKE_BSIZE); - while (((c = ParseReadc ()) != '\n' || (lastc == '\\')) && + while (((c = ParseReadc()) != '\n' || (lastc == '\\')) && (c != EOF)) { test_char: @@ -2483,7 +2483,7 @@ test_char: */ curFile.lineno++; lastc = ' '; - while ((c = ParseReadc ()) == ' ' || c == '\t') { + while ((c = ParseReadc()) == ' ' || c == '\t') { continue; } if (c == EOF || c == '\n') { @@ -2586,7 +2586,7 @@ test_char: /* * Copy in the previous character and save this one in lastc. */ - Buf_AddByte (buf, (Byte)lastc); + Buf_AddByte(buf, (Byte)lastc); lastc = c; } @@ -2594,10 +2594,10 @@ test_char: curFile.lineno++; if (lastc != '\0') { - Buf_AddByte (buf, (Byte)lastc); + Buf_AddByte(buf, (Byte)lastc); } - Buf_AddByte (buf, (Byte)'\0'); - line = (char *)Buf_GetAll (buf, &lineLength); + Buf_AddByte(buf, (Byte)'\0'); + line = (char *)Buf_GetAll(buf, &lineLength); Buf_Destroy(buf, FALSE); /* @@ -2626,14 +2626,14 @@ test_char: * Skip to next conditional that evaluates to COND_PARSE. */ do { - free (line); + free(line); line = ParseSkipLine(1, 0); } while (line && Cond_Eval(line) != COND_PARSE); if (line == NULL) break; /*FALLTHRU*/ case COND_PARSE: - free ((Address) line); + free((Address) line); line = ParseReadLine(); break; case COND_INVALID: @@ -2859,7 +2859,7 @@ Parse_File(const char *name, FILE *stream) ParseFinishLine(); cp = Var_Subst(NULL, line, VAR_CMD, TRUE); - free (line); + free(line); line = cp; /* @@ -2879,7 +2879,7 @@ Parse_File(const char *name, FILE *stream) nextLine: - free (line); + free(line); } /* * Reached EOF, but it may be just EOF of an include file... @@ -2896,7 +2896,7 @@ Parse_File(const char *name, FILE *stream) "%s: Fatal errors encountered -- cannot continue\n", progname); PrintOnError(NULL); - exit (1); + exit(1); } } @@ -2965,11 +2965,11 @@ Parse_MainName(void) 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); } |
