From bd990c803b40e1532cab6b29c75414ca6f30e782 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 18 Jan 2015 17:10:03 +0100 Subject: [PATCH] Remove use of ExpandSourceListArguments. By now, it is only an expensive copy. --- Source/cmCPluginAPI.cxx | 7 +++---- Source/cmFLTKWrapUICommand.cxx | 7 ++----- Source/cmInstallFilesCommand.cxx | 7 ++----- Source/cmQTWrapCPPCommand.cxx | 10 +++------- Source/cmQTWrapUICommand.cxx | 10 +++------- 5 files changed, 13 insertions(+), 28 deletions(-) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index d0dc30a6a..691d80d7e 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -438,15 +438,14 @@ void CCONV cmExpandSourceListArguments(void *arg, char ***resArgv, unsigned int startArgumentIndex) { - cmMakefile *mf = static_cast(arg); + (void)arg; + (void)startArgumentIndex; std::vector result; - std::vector args2; int i; for (i = 0; i < numArgs; ++i) { - args2.push_back(args[i]); + result.push_back(args[i]); } - mf->ExpandSourceListArguments(args2, result, startArgumentIndex); int resargc = static_cast(result.size()); char **resargv = 0; if (resargc) diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index f7d824347..488beaad4 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -31,9 +31,6 @@ bool cmFLTKWrapUICommand // get parameter for the command this->Target = args[0]; // Target that will use the generated files - std::vector newArgs; - this->Makefile->ExpandSourceListArguments(args,newArgs, 1); - // get the list of GUI files from which .cxx and .h will be generated std::string outputDirectory = this->Makefile->GetCurrentOutputDirectory(); @@ -45,8 +42,8 @@ bool cmFLTKWrapUICommand this->Makefile->AddIncludeDirectories( outputDirectories ); } - for(std::vector::iterator i = (newArgs.begin() + 1); - i != newArgs.end(); i++) + for(std::vector::const_iterator i = (args.begin() + 1); + i != args.end(); i++) { cmSourceFile *curr = this->Makefile->GetSource(*i); // if we should use the source GUI diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 06a78e5a6..85e5345b8 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -15,9 +15,9 @@ // cmExecutableCommand bool cmInstallFilesCommand -::InitialPass(std::vector const& argsIn, cmExecutionStatus &) +::InitialPass(std::vector const& args, cmExecutionStatus &) { - if(argsIn.size() < 2) + if(args.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; @@ -27,9 +27,6 @@ bool cmInstallFilesCommand this->Makefile->GetLocalGenerator() ->GetGlobalGenerator()->EnableInstallTarget(); - std::vector args; - this->Makefile->ExpandSourceListArguments(argsIn, args, 2); - this->Destination = args[0]; if((args.size() > 1) && (args[1] == "FILES")) diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index a984260d6..878562c99 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -12,19 +12,15 @@ #include "cmQTWrapCPPCommand.h" // cmQTWrapCPPCommand -bool cmQTWrapCPPCommand::InitialPass(std::vector const& argsIn, +bool cmQTWrapCPPCommand::InitialPass(std::vector const& args, cmExecutionStatus &) { - if(argsIn.size() < 3 ) + if(args.size() < 3 ) { this->SetError("called with incorrect number of arguments"); return false; } - // This command supports source list inputs for compatibility. - std::vector args; - this->Makefile->ExpandSourceListArguments(argsIn, args, 2); - // Get the moc executable to run in the custom command. const char* moc_exe = this->Makefile->GetRequiredDefinition("QT_MOC_EXECUTABLE"); @@ -35,7 +31,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector const& argsIn, this->Makefile->GetSafeDefinition(sourceList); // Create a rule for all sources listed. - for(std::vector::iterator j = (args.begin() + 2); + for(std::vector::const_iterator j = (args.begin() + 2); j != args.end(); ++j) { cmSourceFile *curr = this->Makefile->GetSource(*j); diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index dce59efa1..9b92b1eea 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -12,19 +12,15 @@ #include "cmQTWrapUICommand.h" // cmQTWrapUICommand -bool cmQTWrapUICommand::InitialPass(std::vector const& argsIn, +bool cmQTWrapUICommand::InitialPass(std::vector const& args, cmExecutionStatus &) { - if(argsIn.size() < 4 ) + if(args.size() < 4 ) { this->SetError("called with incorrect number of arguments"); return false; } - // This command supports source list inputs for compatibility. - std::vector args; - this->Makefile->ExpandSourceListArguments(argsIn, args, 3); - // Get the uic and moc executables to run in the custom commands. const char* uic_exe = this->Makefile->GetRequiredDefinition("QT_UIC_EXECUTABLE"); @@ -40,7 +36,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector const& argsIn, this->Makefile->GetSafeDefinition(sourceList); // Create rules for all sources listed. - for(std::vector::iterator j = (args.begin() + 3); + for(std::vector::const_iterator j = (args.begin() + 3); j != args.end(); ++j) { cmSourceFile *curr = this->Makefile->GetSource(*j);