diff options
author | harti <harti@FreeBSD.org> | 2005-03-21 12:19:23 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-03-21 12:19:23 +0000 |
commit | ae5d59a29a844bb2def5ef66d7d2df92653bbdb4 (patch) | |
tree | 3ae0bb7cf5c720658649c153abf28b1621b6fcee /usr.bin/make/var.c | |
parent | 79f8c5593b8df6ca9b6f66590ee45feacce8a079 (diff) | |
download | FreeBSD-src-ae5d59a29a844bb2def5ef66d7d2df92653bbdb4.zip FreeBSD-src-ae5d59a29a844bb2def5ef66d7d2df92653bbdb4.tar.gz |
Rename freePtr to freeResult to make it more obvious about what
pointer we're talking.
Patch: 7.138
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/var.c')
-rw-r--r-- | usr.bin/make/var.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index bab8fb8..178e597 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1239,13 +1239,13 @@ modifier_C(VarParser *vp, char value[], Var *v) * XXXHB update this comment or remove it and point to the man page. */ static char * -ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freePtr) +ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freeResult) { char *value; char endc; value = VarExpand(v, vp); - *freePtr = TRUE; + *freeResult = TRUE; endc = (startc == OPEN_PAREN) ? CLOSE_PAREN : CLOSE_BRACE; @@ -1500,14 +1500,14 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freePtr) } DEBUGF(VAR, ("Result is \"%s\"\n", newStr)); - if (*freePtr) { + if (*freeResult) { free(value); } value = newStr; if (value != var_Error) { - *freePtr = TRUE; + *freeResult = TRUE; } else { - *freePtr = FALSE; + *freeResult = FALSE; } } @@ -1515,7 +1515,7 @@ ParseModifier(VarParser *vp, char startc, Var *v, Boolean *freePtr) } static char * -ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) +ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult) { const char *vname; size_t vlen; @@ -1526,7 +1526,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) v = VarFind(vname, vp->ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); if (v != NULL) { - value = ParseModifier(vp, startc, v, freePtr); + value = ParseModifier(vp, startc, v, freeResult); if (v->flags & VAR_FROM_ENV) { VarDestroy(v, TRUE); @@ -1553,7 +1553,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) strncpy(value, vp->input, consumed); value[consumed] = '\0'; - *freePtr = TRUE; + *freeResult = TRUE; return (value); } } @@ -1568,7 +1568,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) strncpy(value, vp->input, consumed); value[consumed] = '\0'; - *freePtr = TRUE; + *freeResult = TRUE; return (value); } } @@ -1579,13 +1579,13 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) * modifications */ v = VarCreate(vname, NULL, VAR_JUNK); - value = ParseModifier(vp, startc, v, freePtr); - if (*freePtr) { + value = ParseModifier(vp, startc, v, freeResult); + if (*freeResult) { free(value); } VarDestroy(v, TRUE); - *freePtr = FALSE; + *freeResult = FALSE; return (vp->err ? var_Error : varNoError); } else { /* @@ -1602,7 +1602,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) v = VarFind(name, vp->ctxt, 0); if (v != NULL) { - value = ParseModifier(vp, startc, v, freePtr); + value = ParseModifier(vp, startc, v, freeResult); return (value); } } @@ -1613,19 +1613,19 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freePtr) * modifications */ v = VarCreate(vname, NULL, VAR_JUNK); - value = ParseModifier(vp, startc, v, freePtr); - if (*freePtr) { + value = ParseModifier(vp, startc, v, freeResult); + if (*freeResult) { free(value); } VarDestroy(v, TRUE); - *freePtr = FALSE; + *freeResult = FALSE; return (vp->err ? var_Error : varNoError); } } static char * -ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) +ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult) { const char *vname; size_t vlen; @@ -1642,7 +1642,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) VarDestroy(v, TRUE); } - *freePtr = TRUE; + *freeResult = TRUE; return (value); } @@ -1665,7 +1665,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) strncpy(value, vp->input, consumed); value[consumed] = '\0'; - *freePtr = TRUE; + *freeResult = TRUE; return (value); } } @@ -1680,12 +1680,12 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) strncpy(value, vp->input, consumed); value[consumed] = '\0'; - *freePtr = TRUE; + *freeResult = TRUE; return (value); } } - *freePtr = FALSE; + *freeResult = FALSE; return (vp->err ? var_Error : varNoError); } else { /* @@ -1717,12 +1717,12 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) val = VarModify(val, VarTail, NULL); } - *freePtr = TRUE; + *freeResult = TRUE; return (val); } } - *freePtr = FALSE; + *freeResult = FALSE; return (vp->err ? var_Error : varNoError); } } @@ -1731,12 +1731,12 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freePtr) * Parse a multi letter variable name, and return it's value. */ static char * -VarParseLong(VarParser *vp, Boolean *freePtr) +VarParseLong(VarParser *vp, Boolean *freeResult) { Buffer *buf; char startc; char endc; - char *result; + char *value; buf = Buf_Init(MAKE_BSIZE); @@ -1751,16 +1751,16 @@ VarParseLong(VarParser *vp, Boolean *freePtr) while (*vp->ptr != '\0') { if (*vp->ptr == endc) { - result = ParseRestEnd(vp, buf, freePtr); + value = ParseRestEnd(vp, buf, freeResult); vp->ptr++; /* consume closing paren or brace */ Buf_Destroy(buf, TRUE); - return (result); + return (value); } else if (*vp->ptr == ':') { - result = ParseRestModifier(vp, startc, buf, freePtr); + value = ParseRestModifier(vp, startc, buf, freeResult); vp->ptr++; /* consume closing paren or brace */ Buf_Destroy(buf, TRUE); - return (result); + return (value); } else if (*vp->ptr == '$') { size_t rlen; @@ -1785,7 +1785,7 @@ VarParseLong(VarParser *vp, Boolean *freePtr) /* If we did not find the end character, return var_Error */ Buf_Destroy(buf, TRUE); - *freePtr = FALSE; + *freeResult = FALSE; return (var_Error); } |