Deleted Added
full compact
42c42
< __FBSDID("$FreeBSD: head/usr.bin/make/parse.c 138192 2004-11-29 12:17:13Z harti $");
---
> __FBSDID("$FreeBSD: head/usr.bin/make/parse.c 138232 2004-11-30 17:46:29Z harti $");
248c248
< ParseFindKeyword (char *str)
---
> ParseFindKeyword(char *str)
256c256
< end = (sizeof(parseKeywords)/sizeof(parseKeywords[0])) - 1;
---
> end = (sizeof(parseKeywords) / sizeof(parseKeywords[0])) - 1;
260c260
< diff = strcmp (str, parseKeywords[cur].name);
---
> diff = strcmp(str, parseKeywords[cur].name);
292c292
< (void)fprintf(stderr, "\"%s\", line %d: ",
---
> fprintf(stderr, "\"%s\", line %d: ",
295,296c295,296
< (void)fprintf(stderr, "warning: ");
< (void)vfprintf(stderr, fmt, ap);
---
> fprintf(stderr, "warning: ");
> vfprintf(stderr, fmt, ap);
298,299c298,299
< (void)fprintf(stderr, "\n");
< (void)fflush(stderr);
---
> fprintf(stderr, "\n");
> fflush(stderr);
321c321
< ParseLinkSrc (void *pgnp, void *cgnp)
---
> ParseLinkSrc(void *pgnp, void *cgnp)
323,326c323,327
< GNode *pgn = (GNode *) pgnp;
< GNode *cgn = (GNode *) cgnp;
< if (Lst_Member (pgn->children, (void *)cgn) == NULL) {
< (void)Lst_AtEnd (pgn->children, (void *)cgn);
---
> GNode *pgn = (GNode *)pgnp;
> GNode *cgn = (GNode *)cgnp;
>
> if (Lst_Member(pgn->children, (void *)cgn) == NULL) {
> Lst_AtEnd (pgn->children, (void *)cgn);
328c329
< (void)Lst_AtEnd (cgn->parents, (void *)pgn);
---
> Lst_AtEnd (cgn->parents, (void *)pgn);
352c353
< ParseDoOp (void *gnp, void *opp)
---
> ParseDoOp(void *gnp, void *opp)
354,355c355,357
< GNode *gn = (GNode *) gnp;
< int op = *(int *) opp;
---
> GNode *gn = (GNode *)gnp;
> int op = *(int *)opp;
>
364c366
< Parse_Error (PARSE_FATAL, "Inconsistent operator for %s", gn->name);
---
> Parse_Error(PARSE_FATAL, "Inconsistent operator for %s", gn->name);
392c394
< (void)Lst_AtEnd(gn->cohorts, (void *)cohort);
---
> Lst_AtEnd(gn->cohorts, (void *)cohort);
429,430c431,432
< GNode *p = (GNode *) pp;
< GNode *s = (GNode *) sp;
---
> GNode *p = (GNode *)pp;
> GNode *s = (GNode *)sp;
438,440c440,442
< (void)Lst_AtEnd(p->successors, (void *)s);
< (void)Lst_AtEnd(s->preds, (void *)p);
< return 0;
---
> Lst_AtEnd(p->successors, (void *)s);
> Lst_AtEnd(s->preds, (void *)p);
> return (0);
443c445
< return 1;
---
> return (1);
465c467
< ParseDoSrc (int tOp, char *src, Lst allsrc)
---
> ParseDoSrc(int tOp, char *src, Lst allsrc)
494c496
< (void) Lst_AtEnd (create, (void *)estrdup(src));
---
> Lst_AtEnd (create, (void *)estrdup(src));
509,510c511,512
< (void)Lst_AtEnd(predecessor->successors, (void *)gn);
< (void)Lst_AtEnd(gn->preds, (void *)predecessor);
---
> Lst_AtEnd(predecessor->successors, (void *)gn);
> Lst_AtEnd(gn->preds, (void *)predecessor);
530c532
< gn = Targ_FindNode (src, TARG_CREATE);
---
> gn = Targ_FindNode(src, TARG_CREATE);
553c555
< (void)Lst_AtEnd(allsrc, (void *)gn);
---
> Lst_AtEnd(allsrc, (void *)gn);
578c580
< if ((gn->type & (OP_NOTMAIN|OP_USE|OP_EXEC|OP_TRANSFORM)) == 0) {
---
> if ((gn->type & (OP_NOTMAIN | OP_USE | OP_EXEC | OP_TRANSFORM)) == 0) {
603c605,606
< Dir_AddDir((Lst) path, (char *) name);
---
>
> Dir_AddDir((Lst)path, (char *)name);
623c626,627
< Dir_ClearPath((Lst) path);
---
>
> Dir_ClearPath((Lst)path);
688c692
< *cp && !isspace ((unsigned char) *cp) && *cp != '(';
---
> *cp && !isspace ((unsigned char)*cp) && *cp != '(';
703c707
< result=Var_Parse(cp, VAR_CMD, TRUE, &length, &freeIt);
---
> result = Var_Parse(cp, VAR_CMD, TRUE, &length, &freeIt);
708c712
< cp += length-1;
---
> cp += length - 1;
750,751c754,755
< if (Arch_ParseArchive (&line, targets, VAR_CMD) != SUCCESS) {
< Parse_Error (PARSE_FATAL,
---
> if (Arch_ParseArchive(&line, targets, VAR_CMD) != SUCCESS) {
> Parse_Error(PARSE_FATAL,
769c773
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
772c776
< Parse_Error (PARSE_FATAL, "Need an operator");
---
> Parse_Error(PARSE_FATAL, "Need an operator");
780c784
< if (*line == '.' && isupper ((unsigned char) line[1])) {
---
> if (*line == '.' && isupper ((unsigned char)line[1])) {
828c832
< (void)Lst_AtEnd(paths, (void *)dirSearchPath);
---
> Lst_AtEnd(paths, (void *)dirSearchPath);
840c844
< (void)Lst_AtEnd(targets, (void *)gn);
---
> Lst_AtEnd(targets, (void *)gn);
845c849
< (void)Lst_AtEnd(targets, (void *)gn);
---
> Lst_AtEnd(targets, (void *)gn);
862c866
< } else if (strncmp (line, ".PATH", 5) == 0) {
---
> } else if (strncmp(line, ".PATH", 5) == 0) {
871c875
< path = Suff_GetPath (&line[5]);
---
> path = Suff_GetPath(&line[5]);
873c877
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
881c885
< (void)Lst_AtEnd(paths, (void *)path);
---
> Lst_AtEnd(paths, (void *)path);
908c912
< (void)Lst_AtEnd(curTargs, (void *)line);
---
> Lst_AtEnd(curTargs, (void *)line);
915c919
< gn = Targ_FindNode (targName, TARG_CREATE);
---
> gn = Targ_FindNode(targName, TARG_CREATE);
917c921
< gn = Suff_AddTransform (targName);
---
> gn = Suff_AddTransform(targName);
920c924
< (void)Lst_AtEnd (targets, (void *)gn);
---
> Lst_AtEnd(targets, (void *)gn);
991c995
< Parse_Error (PARSE_FATAL, "Missing dependency operator");
---
> Parse_Error(PARSE_FATAL, "Missing dependency operator");
997c1001
< Lst_ForEach (targets, ParseDoOp, (void *)&op);
---
> Lst_ForEach(targets, ParseDoOp, (void *)&op);
1002c1006
< while (*cp && isspace ((unsigned char) *cp)) {
---
> while (*cp && isspace ((unsigned char)*cp)) {
1019c1023
< Suff_ClearSuffixes ();
---
> Suff_ClearSuffixes();
1045c1049
< Main_ParseArgLine (line);
---
> Main_ParseArgLine(line);
1048,1049c1052,1053
< if (Job_ParseShell (line) != SUCCESS) {
< Parse_Error (PARSE_FATAL, "improper shell specification");
---
> if (Job_ParseShell(line) != SUCCESS) {
> Parse_Error(PARSE_FATAL, "improper shell specification");
1090c1094
< while (*cp && !isspace ((unsigned char) *cp)) {
---
> while (*cp && !isspace ((unsigned char)*cp)) {
1097c1101
< Suff_AddSuffix (line);
---
> Suff_AddSuffix(line);
1103c1107
< Suff_AddInclude (line);
---
> Suff_AddInclude(line);
1106c1110
< Suff_AddLib (line);
---
> Suff_AddLib(line);
1109c1113
< Suff_SetNull (line);
---
> Suff_SetNull(line);
1118c1122
< while (*cp && isspace ((unsigned char) *cp)) {
---
> while (*cp && isspace ((unsigned char)*cp)) {
1133c1137
< while (*cp && !isspace ((unsigned char) *cp)) {
---
> while (*cp && !isspace ((unsigned char)*cp)) {
1150,1152c1154,1156
< 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,
1158,1159c1162,1163
< gnp = (GNode *) Lst_DeQueue (sources);
< ParseDoSrc (tOp, gnp->name, curSrcs);
---
> gnp = (GNode *)Lst_DeQueue(sources);
> ParseDoSrc(tOp, gnp->name, curSrcs);
1161c1165
< Lst_Destroy (sources, NOFREE);
---
> Lst_Destroy(sources, NOFREE);
1169c1173
< ParseDoSrc (tOp, line, curSrcs);
---
> ParseDoSrc(tOp, line, curSrcs);
1171c1175
< while (*cp && isspace ((unsigned char) *cp)) {
---
> while (*cp && isspace ((unsigned char)*cp)) {
1185c1189
< Lst_ForEach (targets, ParseFindMain, (void *)0);
---
> Lst_ForEach(targets, ParseFindMain, (void *)0);
1211c1215
< Parse_IsVar (char *line)
---
> Parse_IsVar(char *line)
1214a1219
>
1222c1227
< for (;(*line == ' ') || (*line == '\t'); line++)
---
> for (; (*line == ' ') || (*line == '\t'); line++)
1231c1236
< return FALSE;
---
> return (FALSE);
1259c1264
< return FALSE;
---
> return (FALSE);
1267c1272
< return haveName;
---
> return (haveName);
1273c1278
< return haveName;
---
> return (haveName);
1279c1284
< return FALSE;
---
> return (FALSE);
1288c1293
< return haveName;
---
> return (haveName);
1312c1317
< Parse_DoVar (char *line, GNode *ctxt)
---
> Parse_DoVar(char *line, GNode *ctxt)
1325,1326c1330,1331
< (void) &cp;
< (void) &line;
---
> (void)&cp;
> (void)&line;
1340c1345
< if (isspace ((unsigned char) *cp)) {
---
> if (isspace ((unsigned char)*cp)) {
1344c1349
< opc = cp-1; /* operator is the previous character */
---
> opc = cp - 1; /* operator is the previous character */
1396c1401
< while (isspace ((unsigned char) *cp)) {
---
> while (isspace ((unsigned char)*cp)) {
1401c1406
< Var_Append (line, cp, ctxt);
---
> Var_Append(line, cp, ctxt);
1476a1482
>
1479c1485
< (void)Lst_AtEnd(gn->commands, cmd);
---
> Lst_AtEnd(gn->commands, cmd);
1484c1490
< return(0);
---
> return (0);
1505a1512
>
1506a1514
>
1527c1535
< Parse_AddIncludeDir (char *dir)
---
> Parse_AddIncludeDir(char *dir)
1529c1537,1538
< Dir_AddDir (parseIncPath, dir);
---
>
> Dir_AddDir(parseIncPath, dir);
1545c1554,1555
< if (!isspace((unsigned char) *errmsg)) {
---
>
> if (!isspace((unsigned char)*errmsg)) {
1549,1550c1559,1560
<
< while (isspace((unsigned char) *errmsg))
---
>
> while (isspace((unsigned char)*errmsg))
1552c1562
<
---
>
1573c1583,1584
< if (!isspace((unsigned char) *warnmsg)) {
---
>
> if (!isspace((unsigned char)*warnmsg)) {
1578,1579c1589,1590
<
< while (isspace((unsigned char) *warnmsg))
---
>
> while (isspace((unsigned char)*warnmsg))
1581c1592
<
---
>
1622c1633
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
1648c1659
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
1659c1670
< file = Var_Subst (NULL, file, VAR_CMD, FALSE);
---
> file = Var_Subst(NULL, file, VAR_CMD, FALSE);
1679c1690
< prefEnd = strrchr (Fname, '/');
---
> prefEnd = strrchr(Fname, '/');
1687,1688c1698,1699
< newName = str_concat (Fname, file, STR_ADDSLASH);
< fullname = Dir_FindFile (newName, parseIncPath);
---
> newName = str_concat(Fname, file, STR_ADDSLASH);
> fullname = Dir_FindFile(newName, parseIncPath);
1692c1703
< free (newName);
---
> free(newName);
1697c1708
< free (Fname);
---
> free(Fname);
1709c1720
< fullname = Dir_FindFile (file, parseIncPath);
---
> fullname = Dir_FindFile(file, parseIncPath);
1725c1736
< Parse_Error (PARSE_FATAL, "Could not find %s", file);
---
> Parse_Error(PARSE_FATAL, "Could not find %s", file);
1738c1749
< oldFile = (IFile *) emalloc (sizeof (IFile));
---
> oldFile = (IFile *) emalloc(sizeof (IFile));
1741c1752
< (void) Lst_AtFront (includes, (void *)oldFile);
---
> Lst_AtFront(includes, (void *)oldFile);
1752c1763
< curFile.F = fopen (fullname, "r");
---
> curFile.F = fopen(fullname, "r");
1755c1766
< Parse_Error (PARSE_FATAL, "Cannot open %s", fullname);
---
> Parse_Error(PARSE_FATAL, "Cannot open %s", fullname);
1759c1770
< (void) ParseEOF(0);
---
> ParseEOF(0);
1765,1766d1775
<
<
1787,1788c1796,1797
< oldFile = (IFile *) emalloc (sizeof (IFile));
< memcpy(oldFile, &curFile, sizeof (IFile));
---
> oldFile = (IFile *)emalloc(sizeof(IFile));
> memcpy(oldFile, &curFile, sizeof(IFile));
1790c1799
< (void) Lst_AtFront (includes, (void *)oldFile);
---
> Lst_AtFront (includes, (void *)oldFile);
1793c1802
< curFile.p = (PTR *) emalloc (sizeof (PTR));
---
> curFile.p = (PTR *)emalloc(sizeof (PTR));
1799d1807
<
1832c1840
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
1850c1858
< file = Var_Subst (NULL, file, VAR_CMD, FALSE);
---
> file = Var_Subst(NULL, file, VAR_CMD, FALSE);
1857c1865
< fullname = Dir_FindFile (file, parseIncPath);
---
> fullname = Dir_FindFile(file, parseIncPath);
1871c1879
< Parse_Error (PARSE_FATAL, "Could not find %s", file);
---
> Parse_Error(PARSE_FATAL, "Could not find %s", file);
1882,1883c1890,1891
< oldFile = (IFile *) emalloc (sizeof (IFile));
< memcpy(oldFile, &curFile, sizeof (IFile));
---
> oldFile = (IFile *)emalloc(sizeof(IFile));
> memcpy(oldFile, &curFile, sizeof(IFile));
1885c1893
< (void) Lst_AtFront (includes, (void *)oldFile);
---
> Lst_AtFront(includes, (void *)oldFile);
1896c1904
< curFile.F = fopen (fullname, "r");
---
> curFile.F = fopen(fullname, "r");
1898,1899c1906,1907
< if (curFile.F == (FILE * ) NULL) {
< Parse_Error (PARSE_FATAL, "Cannot open %s", fullname);
---
> if (curFile.F == (FILE * )NULL) {
> Parse_Error(PARSE_FATAL, "Cannot open %s", fullname);
1903c1911
< (void) ParseEOF(1);
---
> ParseEOF(1);
1927c1935
< ParseEOF (int opened)
---
> ParseEOF(int opened)
1936,1937c1944,1945
< ifile = (IFile *) Lst_DeQueue (includes);
< free (curFile.fname);
---
> ifile = (IFile *)Lst_DeQueue(includes);
> free(curFile.fname);
1939c1947
< (void) fclose (curFile.F);
---
> fclose(curFile.F);
1946,1947c1954,1955
< memcpy(&curFile, ifile, sizeof (IFile));
< free (ifile);
---
> memcpy(&curFile, ifile, sizeof(IFile));
> free(ifile);
1964a1973
>
1966c1975
< return fgetc(curFile.F);
---
> return (fgetc(curFile.F));
1969,1970c1978,1979
< return *curFile.p->ptr++;
< return EOF;
---
> return (*curFile.p->ptr++);
> return (EOF);
1987a1997
>
2046c2056
< return((char *)NULL);
---
> return ((char *)NULL);
2055c2065
< return line;
---
> return (line);
2077c2087
< ParseReadLine (void)
---
> ParseReadLine(void)
2126c2136
< while (((c = ParseReadc ()) != '\n' || (lastc == '\\')) &&
---
> while (((c = ParseReadc()) != '\n' || (lastc == '\\')) &&
2130c2140
< switch(c) {
---
> switch (c) {
2142c2152
< while ((c = ParseReadc ()) == ' ' || c == '\t') {
---
> while ((c = ParseReadc()) == ' ' || c == '\t') {
2194c2204,2205
< ignDepOp = TRUE; semiNL = FALSE;
---
> ignDepOp = TRUE;
> semiNL = FALSE;
2236c2247
< Buf_AddByte (buf, (Byte)lastc);
---
> Buf_AddByte(buf, (Byte)lastc);
2244c2255
< Buf_AddByte (buf, (Byte)lastc);
---
> Buf_AddByte(buf, (Byte)lastc);
2246,2248c2257,2259
< Buf_AddByte (buf, (Byte)'\0');
< line = (char *)Buf_GetAll (buf, &lineLength);
< Buf_Destroy (buf, FALSE);
---
> Buf_AddByte(buf, (Byte)'\0');
> line = (char *)Buf_GetAll(buf, &lineLength);
> Buf_Destroy(buf, FALSE);
2270c2281
< switch (Cond_Eval (line)) {
---
> switch (Cond_Eval(line)) {
2276c2287
< free (line);
---
> free(line);
2283c2294
< free (line);
---
> free(line);
2297c2308
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
2320c2331
< return((char *)NULL);
---
> return ((char *)NULL);
2339a2351
>
2342c2354
< Lst_Destroy (targets, ParseHasCommands);
---
> Lst_Destroy(targets, ParseHasCommands);
2379c2391
< while ((line = ParseReadLine ()) != NULL) {
---
> while ((line = ParseReadLine()) != NULL) {
2385c2397
< for (cp = line + 1; isspace ((unsigned char) *cp); cp++) {
---
> for (cp = line + 1; isspace((unsigned char)*cp); cp++) {
2388c2400
< if (strncmp (cp, "include", 7) == 0) {
---
> if (strncmp(cp, "include", 7) == 0) {
2391c2403
< } else if (strncmp (cp, "error", 5) == 0) {
---
> } else if (strncmp(cp, "error", 5) == 0) {
2393,2394c2405,2406
< goto nextLine;
< } else if (strncmp (cp, "warning", 7) == 0) {
---
> goto nextLine;
> } else if (strncmp(cp, "warning", 7) == 0) {
2396c2408
< goto nextLine;
---
> goto nextLine;
2399c2411
< for (cp += 5; isspace((unsigned char) *cp); cp++) {
---
> for (cp += 5; isspace((unsigned char)*cp); cp++) {
2403c2415
< for (cp2 = cp; !isspace((unsigned char) *cp2) &&
---
> for (cp2 = cp; !isspace((unsigned char)*cp2) &&
2425c2437
< for (cp = line + 1; isspace ((unsigned char) *cp); cp++) {
---
> for (cp = line + 1; isspace((unsigned char)*cp); cp++) {
2435,2436c2447,2448
< Lst_ForEach (targets, ParseAddCmd, cp);
< Lst_AtEnd(targCmds, (void *) line);
---
> Lst_ForEach(targets, ParseAddCmd, cp);
> Lst_AtEnd(targCmds, (void *)line);
2439c2451
< Parse_Error (PARSE_FATAL,
---
> Parse_Error(PARSE_FATAL,
2445,2446c2457,2458
< } else if (strncmp (line, "include", 7) == 0 &&
< isspace((unsigned char) line[7]) &&
---
> } else if (strncmp(line, "include", 7) == 0 &&
> isspace((unsigned char)line[7]) &&
2451c2463
< ParseTraditionalInclude (line + 7);
---
> ParseTraditionalInclude(line + 7);
2454c2466
< } else if (Parse_IsVar (line)) {
---
> } else if (Parse_IsVar(line)) {
2456c2468
< Parse_DoVar (line, VAR_GLOBAL);
---
> Parse_DoVar(line, VAR_GLOBAL);
2469,2470c2481,2482
< if (isspace((unsigned char) line[0])) {
< while ((*cp != '\0') && isspace((unsigned char) *cp)) {
---
> if (isspace((unsigned char)line[0])) {
> while ((*cp != '\0') && isspace((unsigned char)*cp)) {
2480,2481c2492,2493
< cp = Var_Subst (NULL, line, VAR_CMD, TRUE);
< free (line);
---
> cp = Var_Subst(NULL, line, VAR_CMD, TRUE);
> free(line);
2490c2502
< targets = Lst_Init (FALSE);
---
> targets = Lst_Init(FALSE);
2498c2510
< free (line);
---
> free(line);
2527c2539
< Parse_Init (void)
---
> Parse_Init(void)
2528a2541
>
2530,2533c2543,2546
< parseIncPath = Lst_Init (FALSE);
< sysIncPath = Lst_Init (FALSE);
< includes = Lst_Init (FALSE);
< targCmds = Lst_Init (FALSE);
---
> parseIncPath = Lst_Init(FALSE);
> sysIncPath = Lst_Init(FALSE);
> includes = Lst_Init(FALSE);
> targCmds = Lst_Init(FALSE);
2537c2550
< Parse_End (void)
---
> Parse_End(void)
2538a2552
>
2567c2581
< listmain = Lst_Init (FALSE);
---
> listmain = Lst_Init(FALSE);
2570c2584
< Punt ("no target to make.");
---
> Punt("no target to make.");
2573c2587
< (void) Lst_AtEnd (listmain, (void *)mainNode);
---
> Lst_AtEnd(listmain, (void *)mainNode);
2577c2591
< (void) Lst_AtEnd (listmain, (void *)mainNode);
---
> Lst_AtEnd(listmain, (void *)mainNode);