diff options
author | harti <harti@FreeBSD.org> | 2005-02-18 07:33:43 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-02-18 07:33:43 +0000 |
commit | 1da3314647c31c3f08a9dbb819251efc969e2261 (patch) | |
tree | a84233c7f57f285cd858fb2c1bcef28883afdaa4 /usr.bin | |
parent | 359989e277b8fa03b11c3fa2952aac7ecb25a12b (diff) | |
download | FreeBSD-src-1da3314647c31c3f08a9dbb819251efc969e2261.zip FreeBSD-src-1da3314647c31c3f08a9dbb819251efc969e2261.tar.gz |
Push down variables into local scope in Var_Parse to make their
liveness clear for splitting up this monster function.
Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/var.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index e4aeab7..59a8a70 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -869,23 +869,16 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, { char *tstr; /* Pointer into str */ Var *v; /* Variable in invocation */ - char *cp; /* Secondary pointer into str (place marker - * for tstr) */ Boolean haveModifier; /* TRUE if have modifiers for the variable */ char endc; /* Ending character when variable in parens * or braces */ char startc; /* Starting character when variable in parens * or braces */ - int cnt; /* Used to count brace pairs when variable in - * in parens or braces */ char *start; - char delim; Boolean dynamic; /* TRUE if the variable is local and we're * expanding it in a non-local context. This * is done to support dynamic sources. The * result is just the invocation, unaltered */ - int vlen; /* length of variable name, after embedded - * variable expansion */ *freePtr = FALSE; dynamic = FALSE; @@ -903,6 +896,8 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, /* * Check if brackets contain a variable name. */ + int vlen; /* length of variable name, after embedded variable + * expansion */ /* build up expanded variable name in this buffer */ Buffer *buf = Buf_Init(MAKE_BSIZE); @@ -1175,6 +1170,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, * :L Converts variable to lower-case. */ if ((str != NULL) && haveModifier) { + char *cp; /* * Skip initial colon while putting it back. */ @@ -1410,6 +1406,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, } case 'C': { + int delim; VarREPattern pattern; char *re; int error; @@ -1591,6 +1588,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, */ VarPattern pattern; Boolean eqFound; + int cnt; pattern.flags = 0; eqFound = FALSE; @@ -1614,6 +1612,7 @@ Var_Parse(char *str, GNode *ctxt, Boolean err, size_t *lengthPtr, cp++; } if (*cp == endc && eqFound) { + int delim; /* * Now we break this sucker into the lhs and |