diff options
Diffstat (limited to 'usr.bin/make/cond.c')
-rw-r--r-- | usr.bin/make/cond.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 1f99a4e..0acea82 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -157,6 +157,7 @@ static Boolean skipLine = FALSE; /* Whether the parse module is skipping static void CondPushBack(Token t) { + condPushBack = t; } @@ -213,7 +214,7 @@ CondGetArg(char **linePtr, char **argPtr, char *func, Boolean parens) */ buf = Buf_Init(16); - while ((strchr(" \t)&|", *cp) == (char *)NULL) && (*cp != '\0')) { + while ((strchr(" \t)&|", *cp) == NULL) && (*cp != '\0')) { if (*cp == '$') { /* * Parse the variable spec and install it as part of the argument @@ -281,7 +282,7 @@ CondDoDefined(int argLen, char *arg) Boolean result; arg[argLen] = '\0'; - if (Var_Value(arg, VAR_CMD, &p1) != (char *)NULL) { + if (Var_Value(arg, VAR_CMD, &p1) != NULL) { result = TRUE; } else { result = FALSE; @@ -308,6 +309,7 @@ CondDoDefined(int argLen, char *arg) static int CondStrMatch(void *string, void *pattern) { + return (!Str_Match((char *)string, (char *)pattern)); } @@ -331,7 +333,7 @@ CondDoMake(int argLen, char *arg) Boolean result; arg[argLen] = '\0'; - if (Lst_Find(create, (void *)arg, CondStrMatch) == NULL) { + if (Lst_Find(create, arg, CondStrMatch) == NULL) { result = FALSE; } else { result = TRUE; @@ -362,7 +364,7 @@ CondDoExists(int argLen, char *arg) arg[argLen] = '\0'; path = Dir_FindFile(arg, dirSearchPath); - if (path != (char *)NULL) { + if (path != NULL) { result = TRUE; free(path); } else { @@ -436,7 +438,7 @@ CondCvtArg(char *str, double *value) x = 10 + *str - isupper((unsigned char)*str) ? 'A' : 'a'; else { *value = (double)i; - return str; + return (str); } i = (i << 4) + x; } @@ -639,7 +641,7 @@ do_string_compare: Buf_AddByte(buf, (Byte)0); - string = (char *)Buf_GetAll(buf, (int *)0); + string = (char *)Buf_GetAll(buf, (int *)NULL); Buf_Destroy(buf, FALSE); DEBUGF(COND, ("lhs = \"%s\", rhs = \"%s\", op = %.2s\n", @@ -1095,13 +1097,13 @@ Cond_Eval(char *line) * Figure out what sort of conditional it is -- what its default * function is, etc. -- by looking in the table of valid "ifs" */ - for (ifp = ifs; ifp->form != (char *)0; ifp++) { + for (ifp = ifs; ifp->form != NULL; ifp++) { if (strncmp(ifp->form, line, ifp->formlen) == 0) { break; } } - if (ifp->form == (char *)0) { + if (ifp->form == NULL) { /* * Nothing fit. If the first word on the line is actually * "else", it's a valid conditional whose value is the inverse |