This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 765971c021ebf386f3f2a3e5bedd2152ff367b21 (commit) via c3f9a833e2679cf50e958a43eecd9eb2d9b1f311 (commit) via 59f79ee681b2ebb910c096ac307c8f9d260683e9 (commit) via d743c2128f0ca634c189a83de62984c132fba77e (commit) via 174e69e90124118d0cdda76034c2f0712b8dee12 (commit) from bb83202491d53765fd713280b7f35923398db511 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=765971c021ebf386f3f2a3e5bedd2152ff367b21 commit 765971c021ebf386f3f2a3e5bedd2152ff367b21 Merge: bb83202 c3f9a83 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Tue Feb 11 17:20:47 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Tue Feb 11 17:20:47 2014 -0500 Merge topic 'dev/custom-parsers' into next c3f9a833 EVIS: Always use 'last' for stack lookups 59f79ee6 EVIS: Remove unused anchor member d743c212 EVIS: Remove the need for a separate starting location 174e69e9 EVIS: Use the stack for all result strings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3f9a833e2679cf50e958a43eecd9eb2d9b1f311 commit c3f9a833e2679cf50e958a43eecd9eb2d9b1f311 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Tue Feb 11 16:31:14 2014 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Tue Feb 11 16:31:14 2014 -0500 EVIS: Always use 'last' for stack lookups diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 110c210..9483b76 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2532,7 +2532,6 @@ typedef enum } t_domain; struct t_lookup { - const char* start; t_domain domain; std::string lookup; }; @@ -2710,36 +2709,34 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, break; case '$': { - bool good = true; t_lookup lookup; const char* next = in + 1; + const char* start = NULL; char nextc = *next; if(nextc == '{') { // Looking for a variable. - lookup.start = in + 2; + start = in + 2; lookup.domain = NORMAL; } else if(nextc == '<') { - good = false; } else if(!nextc) { openstack.top().lookup.append(last, next - last); last = next; - good = false; } else if(cmHasLiteralPrefix(next, "ENV{")) { // Looking for an environment variable. - lookup.start = in + 5; + start = in + 5; lookup.domain = ENVIRONMENT; } else if(cmHasLiteralPrefix(next, "CACHE{")) { // Looking for a cache variable. - lookup.start = in + 7; + start = in + 7; lookup.domain = CACHE; } else @@ -2752,12 +2749,11 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, "and $CACHE{} are allowed."; error = true; } - good = false; } - if(good) + if(start) { openstack.top().lookup.append(last, in - last); - last = lookup.start; + last = start; openstack.push(lookup); } break; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59f79ee681b2ebb910c096ac307c8f9d260683e9 commit 59f79ee681b2ebb910c096ac307c8f9d260683e9 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Tue Feb 11 16:31:00 2014 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Tue Feb 11 16:31:00 2014 -0500 EVIS: Remove unused anchor member diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fe4c83e..110c210 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2532,7 +2532,6 @@ typedef enum } t_domain; struct t_lookup { - const char* anchor; const char* start; t_domain domain; std::string lookup; @@ -2713,7 +2712,6 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, { bool good = true; t_lookup lookup; - lookup.anchor = in; const char* next = in + 1; char nextc = *next; if(nextc == '{') http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d743c2128f0ca634c189a83de62984c132fba77e commit d743c2128f0ca634c189a83de62984c132fba77e Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Tue Feb 11 16:24:56 2014 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Tue Feb 11 16:24:56 2014 -0500 EVIS: Remove the need for a separate starting location diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1bdd1e2..fe4c83e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2642,14 +2642,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, t_lookup var = openstack.top(); openstack.pop(); std::string lookup = var.lookup; - if(lookup.empty()) - { - lookup.append(var.start, in - var.start); - } - else - { - lookup.append(last, in - last); - } + lookup.append(last, in - last); const char* value = NULL; switch(var.domain) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=174e69e90124118d0cdda76034c2f0712b8dee12 commit 174e69e90124118d0cdda76034c2f0712b8dee12 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Tue Feb 11 16:24:36 2014 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Tue Feb 11 16:24:36 2014 -0500 EVIS: Use the stack for all result strings diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4f7fb83..1bdd1e2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2622,27 +2622,13 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, // It also supports the $ENV{VAR} syntax where VAR is looked up in // the current environment variables. - std::string work; const char* in = atwork.c_str(); const char* last = in; std::stack<t_lookup> openstack; std::string estr; bool error = false; bool done = false; - -#define PUSH(args) \ - do \ - { \ - if(!openstack.empty()) \ - { \ - openstack.top() \ - .lookup.append args; \ - } \ - else \ - { \ - work.append args; \ - } \ - } while(false) + openstack.push(t_lookup()); do { @@ -2651,7 +2637,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, switch(*in) { case '}': - if(!openstack.empty()) + if(openstack.size() > 1) { t_lookup var = openstack.top(); openstack.pop(); @@ -2672,7 +2658,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, { cmOStringStream ostr; ostr << line; - PUSH((ostr.str())); + openstack.top().lookup.append(ostr.str()); } else { @@ -2725,7 +2711,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, } } } - PUSH((result)); + openstack.top().lookup.append(result); // Start looking from here on out. last = in + 1; } @@ -2749,7 +2735,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, } else if(!nextc) { - PUSH((last, next - last)); + openstack.top().lookup.append(last, next - last); last = next; good = false; } @@ -2779,7 +2765,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, } if(good) { - PUSH((last, in - last)); + openstack.top().lookup.append(last, in - last); last = lookup.start; openstack.push(lookup); } @@ -2792,20 +2778,20 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, char nextc = *next; if(nextc == 't') { - PUSH((last, in - last)); - PUSH(("\t")); + openstack.top().lookup.append(last, in - last); + openstack.top().lookup.append("\t"); last = next + 1; } else if(nextc == 'n') { - PUSH((last, in - last)); - PUSH(("\n")); + openstack.top().lookup.append(last, in - last); + openstack.top().lookup.append("\n"); last = next + 1; } else if(nextc == 'r') { - PUSH((last, in - last)); - PUSH(("\r")); + openstack.top().lookup.append(last, in - last); + openstack.top().lookup.append("\r"); last = next + 1; } else if(nextc == ';') @@ -2815,7 +2801,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, else { // Take what we've found so far, skipping the escape character. - PUSH((last, in - last)); + openstack.top().lookup.append(last, in - last); // Start tracking from the next character. last = in + 1; } @@ -2844,7 +2830,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, cmake::MessageType mtype = cmake::FATAL_ERROR; // Check for open variable references yet. - if(!openstack.empty()) + if(openstack.size() != 1) { // There's an open variable reference waiting. Use policy CMP0010 to // decide whether it is an error. @@ -2889,13 +2875,11 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, else { // Append the rest of the unchanged part of the string. - PUSH((last)); + openstack.top().lookup.append(last); - source = work; + source = openstack.top().lookup; } -#undef PUSH - return source.c_str(); } ----------------------------------------------------------------------- Summary of changes: Source/cmMakefile.cxx | 75 +++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 52 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits