diff options
author | harti <harti@FreeBSD.org> | 2005-03-22 08:12:16 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-03-22 08:12:16 +0000 |
commit | f4c9341562fb273bf2c05f5792e7e6cbb0171a4d (patch) | |
tree | f2d33b7410815e570c5610371060765111f18c14 /usr.bin/make/var.c | |
parent | 3c9bfe335d9419a4ad3c3a421f257181f4d52eb7 (diff) | |
download | FreeBSD-src-f4c9341562fb273bf2c05f5792e7e6cbb0171a4d.zip FreeBSD-src-f4c9341562fb273bf2c05f5792e7e6cbb0171a4d.tar.gz |
De-lispify some if()-expressions by removing extra parantheses.
Patch: 7.160
Requested by: harti
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/var.c')
-rw-r--r-- | usr.bin/make/var.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index e363df8..a5d7652 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -869,11 +869,11 @@ modifier_M(VarParser *vp, const char value[], char endc) patt = estrdup(vp->ptr); ptr = patt; while (vp->ptr[0] != '\0') { - if ((vp->ptr[0] == endc) || (vp->ptr[0] == ':')) { + if (vp->ptr[0] == endc || vp->ptr[0] == ':') { break; } - if ((vp->ptr[0] == '\\') && - ((vp->ptr[1] == endc) || (vp->ptr[1] == ':'))) { + if (vp->ptr[0] == '\\' && + (vp->ptr[1] == endc || vp->ptr[1] == ':')) { vp->ptr++; /* consume backslash */ } *ptr = vp->ptr[0]; @@ -1307,8 +1307,8 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult) * specially as they are the only four that will be set when * dynamic sources are expanded. */ - if ((vlen == 1) || - ((vlen == 2) && (vname[1] == 'F' || vname[1] == 'D'))) { + if (vlen == 1 || + (vlen == 2 && (vname[1] == 'F' || vname[1] == 'D'))) { if (strchr("!%*@", vname[0]) != NULL) { value = emalloc(consumed + 1); strncpy(value, vp->input, consumed); @@ -1318,8 +1318,8 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult) return (value); } } - if ((vlen > 2) && - (vname[0] == '.') && + if (vlen > 2 && + vname[0] == '.' && isupper((unsigned char)vname[1])) { if ((strncmp(vname, ".TARGET", vlen - 1) == 0) || (strncmp(vname, ".ARCHIVE", vlen - 1) == 0) || @@ -1338,7 +1338,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult) * Check for D and F forms of local variables since we're in * a local context and the name is the right length. */ - if ((vlen == 2) && + if (vlen == 2 && (vname[1] == 'F' || vname[1] == 'D') && (strchr("!%*<>@", vname[0]) != NULL)) { char name[2]; @@ -1393,7 +1393,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult) } if ((vp->ctxt == VAR_CMD) || (vp->ctxt == VAR_GLOBAL)) { - size_t consumed = vp->ptr - vp->input + 1; + size_t consumed = vp->ptr - vp->input + 1; /* * If substituting a local variable in a non-local context, @@ -1404,8 +1404,8 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult) * specially as they are the only four that will be set when * dynamic sources are expanded. */ - if (((vlen == 1)) || - ((vlen == 2) && (vname[1] == 'F' || vname[1] == 'D'))) { + if (vlen == 1 || + (vlen == 2 && (vname[1] == 'F' || vname[1] == 'D'))) { if (strchr("!%*@", vname[0]) != NULL) { value = emalloc(consumed + 1); strncpy(value, vp->input, consumed); @@ -1415,8 +1415,8 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult) return (value); } } - if ((vlen > 2) && - (vname[0] == '.') && + if (vlen > 2 && + vname[0] == '.' && isupper((unsigned char)vname[1])) { if ((strncmp(vname, ".TARGET", vlen - 1) == 0) || (strncmp(vname, ".ARCHIVE", vlen - 1) == 0) || @@ -1435,7 +1435,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult) * Check for D and F forms of local variables since we're in * a local context and the name is the right length. */ - if ((vlen == 2) && + if (vlen == 2 && (vname[1] == 'F' || vname[1] == 'D') && (strchr("!%*<>@", vname[0]) != NULL)) { char name[2]; |