[Cmake-commits] CMake branch, next, updated. v3.1.2-1280-g17b2eba

Stephen Kelly steveire at gmail.com
Wed Feb 11 15:19:29 EST 2015


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  17b2ebaf51f87d9622c92fce30605989ce1b0afd (commit)
       via  df66c10eb5c616acd227d1765c1163421b3f57d6 (commit)
      from  1c961d4388be52bf7b6d644357a9cc86698d2eb1 (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=17b2ebaf51f87d9622c92fce30605989ce1b0afd
commit 17b2ebaf51f87d9622c92fce30605989ce1b0afd
Merge: 1c961d4 df66c10
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 15:19:28 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 11 15:19:28 2015 -0500

    Merge topic 'clean-up-cmMacroCommand' into next
    
    df66c10e cmMacroCommand: Move computation of ARGV%n names out of double loop.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df66c10eb5c616acd227d1765c1163421b3f57d6
commit df66c10eb5c616acd227d1765c1163421b3f57d6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 20:16:40 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Feb 11 21:19:11 2015 +0100

    cmMacroCommand: Move computation of ARGV%n names out of double loop.

diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index f797da8..c6f0571 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -113,10 +113,18 @@ bool cmMacroHelperCommand::InvokeInitialPass
   std::string expandedArgv = cmJoin(expandedArgs, ";");
   std::vector<std::string> variables;
   variables.reserve(this->Args.size() - 1);
+  std::vector<std::string> argVs;
+  argVs.reserve(this->Args.size() - 1);
+  char argvName[60];
   for (unsigned int j = 1; j < this->Args.size(); ++j)
     {
     variables.push_back("${" + this->Args[j] + "}");
     }
+  for (unsigned int j = 0; j < expandedArgs.size(); ++j)
+    {
+    sprintf(argvName,"${ARGV%i}",j);
+    argVs.push_back(argvName);
+    }
   if(!this->Functions.empty())
     {
     this->FilePath = this->Functions[0].FilePath;
@@ -166,12 +174,9 @@ bool cmMacroHelperCommand::InvokeInitialPass
         // then try replacing ARGV values
         if (tmps.find("${ARGV") != std::string::npos)
           {
-          char argvName[60];
-          // also replace the ARGV1 ARGV2 ... etc
           for (unsigned int t = 0; t < expandedArgs.size(); ++t)
             {
-            sprintf(argvName,"${ARGV%i}",t);
-            cmSystemTools::ReplaceString(tmps, argvName,
+            cmSystemTools::ReplaceString(tmps, argVs[t].c_str(),
                                          expandedArgs[t].c_str());
             }
           }

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list