From baa28efd107a3efa821034a64a1c737d3c58ad89 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 20 Sep 2001 15:08:30 -0400 Subject: [PATCH] ENH: change InitialPass to take a const reference to the argument string, to avoid changes to the file cache --- Source/cmAbstractFilesCommand.cxx | 4 ++-- Source/cmAbstractFilesCommand.h | 2 +- Source/cmAddCustomTargetCommand.cxx | 3 ++- Source/cmAddCustomTargetCommand.h | 2 +- Source/cmAddDefinitionsCommand.cxx | 4 ++-- Source/cmAddDefinitionsCommand.h | 2 +- Source/cmAddDependenciesCommand.cxx | 4 ++-- Source/cmAddDependenciesCommand.h | 2 +- Source/cmAddExecutableCommand.cxx | 4 ++-- Source/cmAddExecutableCommand.h | 2 +- Source/cmAddLibraryCommand.cxx | 4 ++-- Source/cmAddLibraryCommand.h | 2 +- Source/cmAddTestCommand.cxx | 2 +- Source/cmAddTestCommand.h | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.h | 2 +- Source/cmBuildCommand.cxx | 4 ++-- Source/cmBuildCommand.h | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmBuildNameCommand.h | 2 +- Source/cmCableClassSetCommand.cxx | 6 +++--- Source/cmCableClassSetCommand.h | 2 +- Source/cmCableWrapTclCommand.cxx | 5 +++-- Source/cmCableWrapTclCommand.h | 2 +- Source/cmCommand.h | 2 +- Source/cmConfigureFileCommand.cxx | 2 +- Source/cmConfigureFileCommand.h | 2 +- Source/cmConfigureGccXmlCommand.cxx | 2 +- Source/cmConfigureGccXmlCommand.h | 2 +- Source/cmElseCommand.cxx | 4 ++-- Source/cmElseCommand.h | 2 +- Source/cmEnableTestingCommand.h | 2 +- Source/cmEndForEachCommand.cxx | 2 +- Source/cmEndForEachCommand.h | 2 +- Source/cmEndIfCommand.cxx | 2 +- Source/cmEndIfCommand.h | 2 +- Source/cmExecProgramCommand.cxx | 3 ++- Source/cmExecProgramCommand.h | 2 +- Source/cmFindFileCommand.cxx | 4 ++-- Source/cmFindFileCommand.h | 2 +- Source/cmFindLibraryCommand.cxx | 3 ++- Source/cmFindLibraryCommand.h | 2 +- Source/cmFindPathCommand.cxx | 2 +- Source/cmFindPathCommand.h | 2 +- Source/cmFindProgramCommand.cxx | 5 +++-- Source/cmFindProgramCommand.h | 2 +- Source/cmForEachCommand.cxx | 4 ++-- Source/cmForEachCommand.h | 2 +- Source/cmGetFilenameComponentCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.h | 2 +- Source/cmIfCommand.cxx | 4 ++-- Source/cmIfCommand.h | 2 +- Source/cmIncludeCommand.cxx | 6 +++--- Source/cmIncludeCommand.h | 2 +- Source/cmIncludeDirectoryCommand.cxx | 4 ++-- Source/cmIncludeDirectoryCommand.h | 2 +- Source/cmIncludeRegularExpressionCommand.cxx | 2 +- Source/cmIncludeRegularExpressionCommand.h | 2 +- Source/cmInstallFilesCommand.cxx | 4 ++-- Source/cmInstallFilesCommand.h | 2 +- Source/cmInstallProgramsCommand.cxx | 4 ++-- Source/cmInstallProgramsCommand.h | 2 +- Source/cmInstallTargetsCommand.cxx | 4 ++-- Source/cmInstallTargetsCommand.h | 2 +- Source/cmLibraryCommand.h | 2 +- Source/cmLinkDirectoriesCommand.cxx | 4 ++-- Source/cmLinkDirectoriesCommand.h | 2 +- Source/cmLinkLibrariesCommand.cxx | 4 ++-- Source/cmLinkLibrariesCommand.h | 2 +- Source/cmLoadCacheCommand.cxx | 5 +++-- Source/cmLoadCacheCommand.h | 2 +- Source/cmMakeDirectoryCommand.cxx | 7 ++++--- Source/cmMakeDirectoryCommand.h | 2 +- Source/cmMakefile.cxx | 8 +++----- Source/cmMakefile.h | 4 ++-- Source/cmMessageCommand.cxx | 4 ++-- Source/cmMessageCommand.h | 2 +- Source/cmOptionCommand.cxx | 2 +- Source/cmOptionCommand.h | 2 +- Source/cmOutputRequiredFilesCommand.cxx | 2 +- Source/cmOutputRequiredFilesCommand.h | 2 +- Source/cmProjectCommand.cxx | 2 +- Source/cmProjectCommand.h | 2 +- Source/cmSetCommand.cxx | 4 ++-- Source/cmSetCommand.h | 2 +- Source/cmSiteNameCommand.cxx | 2 +- Source/cmSiteNameCommand.h | 2 +- Source/cmSourceFilesCommand.cxx | 4 ++-- Source/cmSourceFilesCommand.h | 2 +- Source/cmSourceFilesRemoveCommand.cxx | 4 ++-- Source/cmSourceFilesRemoveCommand.h | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmSourceGroupCommand.h | 2 +- Source/cmSubdirCommand.cxx | 4 ++-- Source/cmSubdirCommand.h | 2 +- Source/cmSubdirDependsCommand.cxx | 2 +- Source/cmSubdirDependsCommand.h | 2 +- Source/cmTargetLinkLibrariesCommand.cxx | 4 ++-- Source/cmTargetLinkLibrariesCommand.h | 2 +- Source/cmUseMangledMesaCommand.cxx | 5 +++-- Source/cmUseMangledMesaCommand.h | 2 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUtilitySourceCommand.h | 2 +- Source/cmVTKWrapJavaCommand.cxx | 4 ++-- Source/cmVTKWrapJavaCommand.h | 2 +- Source/cmVTKWrapPythonCommand.cxx | 4 ++-- Source/cmVTKWrapPythonCommand.h | 2 +- Source/cmVTKWrapTclCommand.cxx | 4 ++-- Source/cmVTKWrapTclCommand.h | 2 +- Source/cmWrapExcludeFilesCommand.cxx | 4 ++-- Source/cmWrapExcludeFilesCommand.h | 2 +- 111 files changed, 158 insertions(+), 152 deletions(-) diff --git a/Source/cmAbstractFilesCommand.cxx b/Source/cmAbstractFilesCommand.cxx index 7b35fc6ae..2c481c3ea 100644 --- a/Source/cmAbstractFilesCommand.cxx +++ b/Source/cmAbstractFilesCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmAbstractFilesCommand.h" // cmAbstractFilesCommand -bool cmAbstractFilesCommand::InitialPass(std::vector& args) +bool cmAbstractFilesCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -49,7 +49,7 @@ bool cmAbstractFilesCommand::InitialPass(std::vector& args) return false; } cmMakefile::SourceMap &Classes = m_Makefile->GetSources(); - for(std::vector::iterator j = args.begin(); + for(std::vector::const_iterator j = args.begin(); j != args.end(); ++j) { for(cmMakefile::SourceMap::iterator l = Classes.begin(); diff --git a/Source/cmAbstractFilesCommand.h b/Source/cmAbstractFilesCommand.h index 6d0dafa1c..7d3f17330 100644 --- a/Source/cmAbstractFilesCommand.h +++ b/Source/cmAbstractFilesCommand.h @@ -56,7 +56,7 @@ public: * This is called when the command is first encountered in * the input file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 070c1afad..18016f838 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -41,8 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmAddCustomTargetCommand.h" // cmAddCustomTargetCommand -bool cmAddCustomTargetCommand::InitialPass(std::vector& args) +bool cmAddCustomTargetCommand::InitialPass(std::vector const& argsIn) { + std::vector args = argsIn; bool all = false; if(args.size() < 2 ) diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 3acf4ce88..2c293c40f 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmAddDefinitionsCommand.cxx b/Source/cmAddDefinitionsCommand.cxx index 19a0ad7ae..9afe7bbfa 100644 --- a/Source/cmAddDefinitionsCommand.cxx +++ b/Source/cmAddDefinitionsCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmAddDefinitionsCommand.h" // cmAddDefinitionsCommand -bool cmAddDefinitionsCommand::InitialPass(std::vector& args) +bool cmAddDefinitionsCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { std::string str = *i; diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index e593ed409..ec28072e4 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index baa08e42e..11dcc9524 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmDependenciesCommand -bool cmAddDependenciesCommand::InitialPass(std::vector& args) +bool cmAddDependenciesCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { @@ -53,7 +53,7 @@ bool cmAddDependenciesCommand::InitialPass(std::vector& args) cmTargets &tgts = m_Makefile->GetTargets(); if (tgts.find(args[0]) != tgts.end()) { - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); ++s; for (; s != args.end(); ++s) { diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index 8eff6fe37..5a60a2156 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index 83136a23b..b1ce21fbb 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmExecutableCommand -bool cmAddExecutableCommand::InitialPass(std::vector& args) +bool cmAddExecutableCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { @@ -50,7 +50,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector& args) return false; } - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); ++s; if (*s == "WIN32") { diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h index 421a32e2d..22ebc12ff 100644 --- a/Source/cmAddExecutableCommand.h +++ b/Source/cmAddExecutableCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index f75e909ec..cf3d68eae 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmLibraryCommand -bool cmAddLibraryCommand::InitialPass(std::vector& args) +bool cmAddLibraryCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -54,7 +54,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector& args) // otherwise it defaults to static library. int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")); - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); ++s; // If the second argument is "SHARED" or "STATIC", then it controls diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index 9ec8a8225..786041939 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index e7d16b4a0..481be7e6d 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmExecutableCommand -bool cmAddTestCommand::InitialPass(std::vector& args) +bool cmAddTestCommand::InitialPass(std::vector const& args) { // First argument is the name of the test // Second argument is the name of the executable to run (a target or external diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index 6f0e272e6..4c9870e8c 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This is called at the end after all the information diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 1639ce0df..89614a2be 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmDirectory.h" // cmAuxSourceDirectoryCommand -bool cmAuxSourceDirectoryCommand::InitialPass(std::vector& args) +bool cmAuxSourceDirectoryCommand::InitialPass(std::vector const& args) { if(args.size() < 2 || args.size() > 2) { diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index 893681bf9..52aa21061 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -68,7 +68,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 528c365cc..18037b497 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmBuildCommand.h" // cmBuildCommand -bool cmBuildCommand::InitialPass(std::vector& args) +bool cmBuildCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { @@ -56,7 +56,7 @@ bool cmBuildCommand::InitialPass(std::vector& args) return true; } std::string makecommand; - std::string& makeprogram = args[1]; + std::string makeprogram = args[1]; m_Makefile->ExpandVariablesInString(makeprogram); if(makeprogram.find("msdev") != std::string::npos || makeprogram.find("MSDEV") != std::string::npos ) diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index 38be6fcb5..5043459b0 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 5016825bf..ca1721035 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmBuildNameCommand.h" // cmBuildNameCommand -bool cmBuildNameCommand::InitialPass(std::vector& args) +bool cmBuildNameCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index f2dce71d0..4d9a6bb52 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmCableClassSetCommand.cxx b/Source/cmCableClassSetCommand.cxx index ba2265735..28ea366d9 100644 --- a/Source/cmCableClassSetCommand.cxx +++ b/Source/cmCableClassSetCommand.cxx @@ -43,14 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmTarget.h" // cmCableClassSetCommand -bool cmCableClassSetCommand::InitialPass(std::vector& args) +bool cmCableClassSetCommand::InitialPass(std::vector const& argsIn) { - if(args.size() < 2) + if(argsIn.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; } - + std::vector args = argsIn; // First, we want to expand all CMAKE variables in all arguments. for(std::vector::iterator a = args.begin(); a != args.end(); ++a) diff --git a/Source/cmCableClassSetCommand.h b/Source/cmCableClassSetCommand.h index 7eab6a203..bfa5747a5 100644 --- a/Source/cmCableClassSetCommand.h +++ b/Source/cmCableClassSetCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmCableWrapTclCommand.cxx b/Source/cmCableWrapTclCommand.cxx index 19112f570..8dd2ebe19 100644 --- a/Source/cmCableWrapTclCommand.cxx +++ b/Source/cmCableWrapTclCommand.cxx @@ -118,13 +118,14 @@ cmCableWrapTclCommand::~cmCableWrapTclCommand() // cmCableWrapTclCommand -bool cmCableWrapTclCommand::InitialPass(std::vector& args) +bool cmCableWrapTclCommand::InitialPass(std::vector const& argsIn) { - if(args.size() < 2) + if(argsIn.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; } + std::vector args = argsIn; // First, we want to expand all CMAKE variables in all arguments. for(std::vector::iterator a = args.begin(); diff --git a/Source/cmCableWrapTclCommand.h b/Source/cmCableWrapTclCommand.h index 24793c8a9..a1c801f70 100644 --- a/Source/cmCableWrapTclCommand.h +++ b/Source/cmCableWrapTclCommand.h @@ -68,7 +68,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmCommand.h b/Source/cmCommand.h index ee43675f0..b9cba5a81 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -78,7 +78,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args) = 0; + virtual bool InitialPass(std::vector const& args) = 0; /** * This is called at the end after all the information diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index bf49a82ee..9f482d395 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmConfigureFileCommand.h" // cmConfigureFileCommand -bool cmConfigureFileCommand::InitialPass(std::vector& args) +bool cmConfigureFileCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index ab624b0ef..b052ffaf7 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -56,7 +56,7 @@ public: * This is called when the command is first encountered in * the input file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmConfigureGccXmlCommand.cxx b/Source/cmConfigureGccXmlCommand.cxx index 65f0d9f55..bb4ac9d61 100644 --- a/Source/cmConfigureGccXmlCommand.cxx +++ b/Source/cmConfigureGccXmlCommand.cxx @@ -50,7 +50,7 @@ cmConfigureGccXmlCommand::~cmConfigureGccXmlCommand() } // cmConfigureGccXmlCommand -bool cmConfigureGccXmlCommand::InitialPass(std::vector& args) +bool cmConfigureGccXmlCommand::InitialPass(std::vector const& args) { if(args.size() != 2) { diff --git a/Source/cmConfigureGccXmlCommand.h b/Source/cmConfigureGccXmlCommand.h index 7d71e0d66..a50baa351 100644 --- a/Source/cmConfigureGccXmlCommand.h +++ b/Source/cmConfigureGccXmlCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index 0f35203a9..12847cfe0 100644 --- a/Source/cmElseCommand.cxx +++ b/Source/cmElseCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmElseCommand.h" #include "cmCacheManager.h" -bool cmElseCommand::InitialPass(std::vector& args) +bool cmElseCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -109,7 +109,7 @@ bool cmElseCommand::InitialPass(std::vector& args) // if we created a function blocker then set its args if (f) { - for(std::vector::iterator j = args.begin(); + for(std::vector::const_iterator j = args.begin(); j != args.end(); ++j) { f->m_Args.push_back(*j); diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h index f4df77463..71ac22503 100644 --- a/Source/cmElseCommand.h +++ b/Source/cmElseCommand.h @@ -63,7 +63,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index 12688f3bc..e3f66d0f4 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -76,7 +76,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args) { + virtual bool InitialPass(std::vector const& args) { return true;}; /** diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx index 3bef15e2c..e8b61984c 100644 --- a/Source/cmEndForEachCommand.cxx +++ b/Source/cmEndForEachCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmEndForEachCommand.h" #include "cmCacheManager.h" -bool cmEndForEachCommand::InitialPass(std::vector& args) +bool cmEndForEachCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h index b34ba69d2..7c453d94d 100644 --- a/Source/cmEndForEachCommand.h +++ b/Source/cmEndForEachCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx index 7972a1bbe..e070c9378 100644 --- a/Source/cmEndIfCommand.cxx +++ b/Source/cmEndIfCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmEndIfCommand.h" #include "cmCacheManager.h" -bool cmEndIfCommand::InitialPass(std::vector& args) +bool cmEndIfCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h index 287b2e056..d7361d98b 100644 --- a/Source/cmEndIfCommand.h +++ b/Source/cmEndIfCommand.h @@ -63,7 +63,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index f391b693d..0b8c85d9d 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -42,8 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSystemTools.h" // cmExecProgramCommand -bool cmExecProgramCommand::InitialPass(std::vector& args) +bool cmExecProgramCommand::InitialPass(std::vector const& argsIn) { + std::vector args = argsIn; if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 321e80806..9ee38dcba 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx index 7a240fe45..b610a21b2 100644 --- a/Source/cmFindFileCommand.cxx +++ b/Source/cmFindFileCommand.cxx @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // cmFindFileCommand -bool cmFindFileCommand::InitialPass(std::vector& args) +bool cmFindFileCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { @@ -53,7 +53,7 @@ bool cmFindFileCommand::InitialPass(std::vector& args) return false; } - std::vector::iterator i = args.begin(); + std::vector::const_iterator i = args.begin(); // Use the first argument as the name of something to be defined const char* define = (*i).c_str(); i++; // move iterator to next arg diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index 371293722..d245fa77a 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -67,7 +67,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 1a931bbc1..5e374f262 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -42,8 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmFindLibraryCommand -bool cmFindLibraryCommand::InitialPass(std::vector& args) +bool cmFindLibraryCommand::InitialPass(std::vector const& argsIn) { + std::vector args = argsIn; if(args.size() < 2) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index 51a6bce96..cd275b2cb 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -67,7 +67,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 7b0550cc3..c4abd4612 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmFindPathCommand -bool cmFindPathCommand::InitialPass(std::vector& args) +bool cmFindPathCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index d401d1773..048fc754e 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -42,7 +42,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 1195ea8ba..e6c7edc02 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -45,13 +45,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // cmFindProgramCommand -bool cmFindProgramCommand::InitialPass(std::vector& args) +bool cmFindProgramCommand::InitialPass(std::vector const& argsIn) { - if(args.size() < 2 ) + if(argsIn.size() < 2 ) { this->SetError("called with incorrect number of arguments"); return false; } + std::vector args = argsIn; std::vector::iterator i = args.begin(); // Use the first argument as the name of something to be defined const char* define = (*i).c_str(); diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index d23321eda..060fb10cc 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -67,7 +67,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 7803da24b..03f6d72a2 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -109,7 +109,7 @@ ScopeEnded(cmMakefile &mf) mf.GetCurrentDirectory()); } -bool cmForEachCommand::InitialPass(std::vector& args) +bool cmForEachCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { @@ -119,7 +119,7 @@ bool cmForEachCommand::InitialPass(std::vector& args) // create a function blocker cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker(); - for(std::vector::iterator j = args.begin(); + for(std::vector::const_iterator j = args.begin(); j != args.end(); ++j) { f->m_Args.push_back(*j); diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index ee029d2f7..e496ac9d3 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -88,7 +88,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9b2000531..390cef8b0 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSystemTools.h" // cmGetFilenameComponentCommand -bool cmGetFilenameComponentCommand::InitialPass(std::vector& args) +bool cmGetFilenameComponentCommand::InitialPass(std::vector const& args) { if(args.size() < 3) { diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index 5d825feb2..19b887338 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 85a59dbf0..703f9e343 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -69,7 +69,7 @@ ScopeEnded(cmMakefile &mf) mf.GetCurrentDirectory()); } -bool cmIfCommand::InitialPass(std::vector& args) +bool cmIfCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -137,7 +137,7 @@ bool cmIfCommand::InitialPass(std::vector& args) // if we created a function blocker then set its args if (f) { - for(std::vector::iterator j = args.begin(); + for(std::vector::const_iterator j = args.begin(); j != args.end(); ++j) { f->m_Args.push_back(*j); diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 5355bc0ae..9d8910fa8 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -86,7 +86,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 3c2d35df2..68eb6cc67 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -17,14 +17,14 @@ // cmIncludeCommand -bool cmIncludeCommand::InitialPass(std::vector& args) +bool cmIncludeCommand::InitialPass(std::vector const& argsIn) { - if (args.size()< 1 || args.size() > 2) + if (argsIn.size()< 1 || argsIn.size() > 2) { this->SetError("called with wrong number of arguments. " "Include only takes one file."); } - + std::vector args = argsIn; m_Makefile->ExpandVariablesInString( args[0]); bool exists = cmSystemTools::FileExists(args[0].c_str()); if(args.size() == 2 && args[1] == "OPTIONAL" && !exists) diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h index c60fbefb2..854d83393 100644 --- a/Source/cmIncludeCommand.h +++ b/Source/cmIncludeCommand.h @@ -42,7 +42,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 22b82cfd5..d56fe5c92 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmIncludeDirectoryCommand.h" #include "cmCacheManager.h" // cmIncludeDirectoryCommand -bool cmIncludeDirectoryCommand::InitialPass(std::vector& args) +bool cmIncludeDirectoryCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { m_Makefile->AddIncludeDirectory((*i).c_str()); diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index 755df69fa..579e24a44 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx index 2ccc556ff..b5c5861a0 100644 --- a/Source/cmIncludeRegularExpressionCommand.cxx +++ b/Source/cmIncludeRegularExpressionCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmIncludeRegularExpressionCommand.h" // cmIncludeRegularExpressionCommand -bool cmIncludeRegularExpressionCommand::InitialPass(std::vector& args) +bool cmIncludeRegularExpressionCommand::InitialPass(std::vector const& args) { if((args.size() < 1) || (args.size() > 2)) { diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index fcec512f0..4cab776cc 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index b4cf57a4c..6516fdb1a 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmExecutableCommand -bool cmInstallFilesCommand::InitialPass(std::vector& args) +bool cmInstallFilesCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { @@ -58,7 +58,7 @@ bool cmInstallFilesCommand::InitialPass(std::vector& args) target.SetInstallPath(args[0].c_str()); m_Makefile->GetTargets().insert(cmTargets::value_type(m_TargetName, target)); - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); for (++s;s != args.end(); ++s) { m_FinalArgs.push_back(*s); diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index 070f70328..423727a61 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 657691b0d..6b835580f 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmExecutableCommand -bool cmInstallProgramsCommand::InitialPass(std::vector& args) +bool cmInstallProgramsCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { @@ -58,7 +58,7 @@ bool cmInstallProgramsCommand::InitialPass(std::vector& args) target.SetInstallPath(args[0].c_str()); m_Makefile->GetTargets().insert(cmTargets::value_type(m_TargetName, target)); - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); for (++s;s != args.end(); ++s) { m_FinalArgs.push_back(*s); diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 307bfb985..082c75ca1 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index 5e379c878..cb27b0a9c 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmExecutableCommand -bool cmInstallTargetsCommand::InitialPass(std::vector& args) +bool cmInstallTargetsCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { @@ -51,7 +51,7 @@ bool cmInstallTargetsCommand::InitialPass(std::vector& args) } cmTargets &tgts = m_Makefile->GetTargets(); - std::vector::iterator s = args.begin(); + std::vector::const_iterator s = args.begin(); ++s; for (;s != args.end(); ++s) { diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 03f48d110..067e6e5f7 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmLibraryCommand.h b/Source/cmLibraryCommand.h index 793a254e8..e18d9d724 100644 --- a/Source/cmLibraryCommand.h +++ b/Source/cmLibraryCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 8fd859a3a..ab3b5306a 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmLinkDirectoriesCommand.h" // cmLinkDirectoriesCommand -bool cmLinkDirectoriesCommand::InitialPass(std::vector& args) +bool cmLinkDirectoriesCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { m_Makefile->AddLinkDirectory((*i).c_str()); diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index 56455cb69..ba1d5a8c3 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -67,7 +67,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index 39a809690..2e28dfade 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/Source/cmLinkLibrariesCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmLinkLibrariesCommand.h" // cmLinkLibrariesCommand -bool cmLinkLibrariesCommand::InitialPass(std::vector& args) +bool cmLinkLibrariesCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -50,7 +50,7 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector& args) } // add libraries, nothe that there is an optional prefix // of debug and optimized than can be used - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { if (*i == "debug") diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index 1be241ef5..bd3bdc029 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 93afbd6a5..e1445a923 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -17,12 +17,13 @@ // cmLoadcacheCommand -bool cmLoadCacheCommand::InitialPass(std::vector& args) +bool cmLoadCacheCommand::InitialPass(std::vector const& argsIn) { - if (args.size()< 1) + if (argsIn.size()< 1) { this->SetError("called with wrong number of arguments."); } + std::vector args = argsIn; // Cache entries to be excluded from the import list. // If this set is empty, all cache entries are brought in diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index 3a80af936..859cecdbe 100644 --- a/Source/cmLoadCacheCommand.h +++ b/Source/cmLoadCacheCommand.h @@ -61,7 +61,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmMakeDirectoryCommand.cxx b/Source/cmMakeDirectoryCommand.cxx index 22dd4af56..aac1a11b5 100644 --- a/Source/cmMakeDirectoryCommand.cxx +++ b/Source/cmMakeDirectoryCommand.cxx @@ -42,15 +42,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmDirectory.h" // cmMakeDirectoryCommand -bool cmMakeDirectoryCommand::InitialPass(std::vector& args) +bool cmMakeDirectoryCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - m_Makefile->ExpandVariablesInString(args[0]); - cmSystemTools::MakeDirectory(args[0].c_str()); + std::string arg = args[0]; + m_Makefile->ExpandVariablesInString(arg); + cmSystemTools::MakeDirectory(arg.c_str()); return true; } diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index 6f0709646..12f5dcf0a 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -68,7 +68,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d58f72d05..f3e777e01 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -217,7 +217,7 @@ void cmMakefile::Print() const void cmMakefile::ExecuteCommand(std::string &name, - std::vector &arguments) + std::vector const& arguments) { RegisteredCommandsMap::iterator pos = m_Commands.find(name); if(pos != m_Commands.end()) @@ -336,16 +336,14 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) // add this list file to the list of dependencies m_ListFiles.push_back( filenametoread); const int numberFunctions = lf->m_Functions.size(); - std::vector argumentsCopy; for(int i =0; i < numberFunctions; ++i) { cmListFileFunction& curFunction = lf->m_Functions[i]; if(!this->IsFunctionBlocked(curFunction.m_Name.c_str(), curFunction.m_Arguments)) { - argumentsCopy = curFunction.m_Arguments; this->ExecuteCommand(curFunction.m_Name, - argumentsCopy); + curFunction.m_Arguments); } } @@ -1149,7 +1147,7 @@ cmMakefile::FindSourceGroup(const char* source, bool cmMakefile::IsFunctionBlocked(const char *name, - std::vector &args) + std::vector const&args) { // loop over all function blockers to see if any block this command std::set::const_iterator pos; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 797e3643d..451cdda75 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -540,7 +540,7 @@ public: /** * execute a single CMake command */ - void ExecuteCommand(std::string &name, std::vector &args); + void ExecuteCommand(std::string &name, std::vector const& args); protected: @@ -590,7 +590,7 @@ protected: RegisteredCommandsMap m_Commands; std::vector m_UsedCommands; cmMakefileGenerator* m_MakefileGenerator; - bool IsFunctionBlocked(const char *name, std::vector &args); + bool IsFunctionBlocked(const char *name, std::vector const& args); private: /** diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 7671bd3e6..bb28eabdf 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmCacheManager.h" // cmLibraryCommand -bool cmMessageCommand::InitialPass(std::vector& args) +bool cmMessageCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -53,7 +53,7 @@ bool cmMessageCommand::InitialPass(std::vector& args) if (args.size() >= 2) { std::string message; - std::vector::iterator i = args.begin(); + std::vector::const_iterator i = args.begin(); ++i; for(;i != args.end(); ++i) { diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index eb0ad36f8..67618fe54 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -63,7 +63,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 3e167de1f..92bd7d40d 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmOptionCommand.h" // cmOptionCommand -bool cmOptionCommand::InitialPass(std::vector& args) +bool cmOptionCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index 99baea52a..76d668325 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index d796ad73a..0c6e2a9bd 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -181,7 +181,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) } // cmOutputRequiredFilesCommand -bool cmOutputRequiredFilesCommand::InitialPass(std::vector& args) +bool cmOutputRequiredFilesCommand::InitialPass(std::vector const& args) { if(args.size() < 2 ) { diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 440acb113..e5da4316b 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -63,7 +63,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); virtual void FinalPass(); diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 30ebef359..9926c25b8 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmProjectCommand.h" // cmProjectCommand -bool cmProjectCommand::InitialPass(std::vector& args) +bool cmProjectCommand::InitialPass(std::vector const& args) { if(args.size() < 1 || args.size() > 1) { diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index e03e0821b..dd6d8365f 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -67,7 +67,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 2357468a9..657788083 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSetCommand.h" // cmSetCommand -bool cmSetCommand::InitialPass(std::vector& args) +bool cmSetCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -90,7 +90,7 @@ bool cmSetCommand::InitialPass(std::vector& args) message += "Syntax error in SET:\n"; message += "CACHE requires TYPE and document string SET command:\n"; message += "SET ("; - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { message += *i; diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index b1a4c7dcf..81d390d3b 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index c629c4415..42a4c3325 100644 --- a/Source/cmSiteNameCommand.cxx +++ b/Source/cmSiteNameCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSiteNameCommand.h" // cmSiteNameCommand -bool cmSiteNameCommand::InitialPass(std::vector& args) +bool cmSiteNameCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index b74c39dc6..8eb8bcaa2 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -64,7 +64,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmSourceFilesCommand.cxx b/Source/cmSourceFilesCommand.cxx index 778c095ef..6795b845e 100644 --- a/Source/cmSourceFilesCommand.cxx +++ b/Source/cmSourceFilesCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSourceFilesCommand.h" // cmSourceFilesCommand -bool cmSourceFilesCommand::InitialPass(std::vector& args) +bool cmSourceFilesCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = (args.begin() + 1); + for(std::vector::const_iterator i = (args.begin() + 1); i != args.end(); ++i) { std::string copy = *i; diff --git a/Source/cmSourceFilesCommand.h b/Source/cmSourceFilesCommand.h index 48ad84bc4..235c6b6ce 100644 --- a/Source/cmSourceFilesCommand.h +++ b/Source/cmSourceFilesCommand.h @@ -70,7 +70,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmSourceFilesRemoveCommand.cxx b/Source/cmSourceFilesRemoveCommand.cxx index e43facb2a..86efc2f41 100644 --- a/Source/cmSourceFilesRemoveCommand.cxx +++ b/Source/cmSourceFilesRemoveCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSourceFilesRemoveCommand.h" // cmSourceFilesRemoveCommand -bool cmSourceFilesRemoveCommand::InitialPass(std::vector& args) +bool cmSourceFilesRemoveCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = (args.begin() + 1); + for(std::vector::const_iterator i = (args.begin() + 1); i != args.end(); ++i) { cmSourceFile file; diff --git a/Source/cmSourceFilesRemoveCommand.h b/Source/cmSourceFilesRemoveCommand.h index 6de864f67..44cb63f8d 100644 --- a/Source/cmSourceFilesRemoveCommand.h +++ b/Source/cmSourceFilesRemoveCommand.h @@ -70,7 +70,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index f9e71db98..627a5a488 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSourceGroupCommand.h" // cmSourceGroupCommand -bool cmSourceGroupCommand::InitialPass(std::vector& args) +bool cmSourceGroupCommand::InitialPass(std::vector const& args) { if(args.size() != 2) { diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index 7f24460e4..cd4f1766f 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -65,7 +65,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index c1720cd6f..33a239ee8 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSubdirCommand.h" // cmSubdirCommand -bool cmSubdirCommand::InitialPass(std::vector& args) +bool cmSubdirCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector::iterator i = args.begin(); + for(std::vector::const_iterator i = args.begin(); i != args.end(); ++i) { m_Makefile->AddSubDirectory((*i).c_str()); diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index ef7f5e856..15d03f75c 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmSubdirDependsCommand.cxx b/Source/cmSubdirDependsCommand.cxx index 2060e1c12..9d92da44d 100644 --- a/Source/cmSubdirDependsCommand.cxx +++ b/Source/cmSubdirDependsCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSubdirDependsCommand.h" // cmSubdirDependsCommand -bool cmSubdirDependsCommand::InitialPass(std::vector& args) +bool cmSubdirDependsCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 29c235e7f..523a47bd4 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -70,7 +70,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 526ee6903..013c5e4af 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmTargetLinkLibrariesCommand.h" // cmTargetLinkLibrariesCommand -bool cmTargetLinkLibrariesCommand::InitialPass(std::vector& args) +bool cmTargetLinkLibrariesCommand::InitialPass(std::vector const& args) { if(args.size() < 2) { @@ -50,7 +50,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector& args) } // add libraries, nothe that there is an optional prefix // of debug and optimized than can be used - std::vector::iterator i = args.begin(); + std::vector::const_iterator i = args.begin(); for(++i; i != args.end(); ++i) { diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index faccd11e6..b16810e81 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -66,7 +66,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 2c70aa8ed..96990cf19 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -42,16 +42,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmSystemTools.h" // cmUseMangledMesaCommand -bool cmUseMangledMesaCommand::InitialPass(std::vector& args) +bool cmUseMangledMesaCommand::InitialPass(std::vector const& argsIn) { // expected two arguments: // arguement one: the full path to gl_mangle.h // arguement two : directory for output of edited headers - if(args.size() < 2) + if(argsIn.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; } + std::vector args = argsIn; m_Makefile->ExpandVariablesInString(args[0]); m_Makefile->ExpandVariablesInString(args[1]); const char* inputDir = args[0].c_str(); diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index 6db3d2d72..79bbdbcf4 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -25,7 +25,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index ec996f9d1..250db2414 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmUtilitySourceCommand.h" // cmUtilitySourceCommand -bool cmUtilitySourceCommand::InitialPass(std::vector& args) +bool cmUtilitySourceCommand::InitialPass(std::vector const& args) { if(args.size() < 3) { diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 32af3a911..d24b3037f 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -68,7 +68,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This determines if the command gets propagated down diff --git a/Source/cmVTKWrapJavaCommand.cxx b/Source/cmVTKWrapJavaCommand.cxx index 322c48602..033cf0959 100644 --- a/Source/cmVTKWrapJavaCommand.cxx +++ b/Source/cmVTKWrapJavaCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmVTKWrapJavaCommand.h" // cmVTKWrapJavaCommand -bool cmVTKWrapJavaCommand::InitialPass(std::vector& args) +bool cmVTKWrapJavaCommand::InitialPass(std::vector const& args) { if(args.size() < 3 ) { @@ -65,7 +65,7 @@ bool cmVTKWrapJavaCommand::InitialPass(std::vector& args) // get the list of classes for this library cmMakefile::SourceMap &Classes = m_Makefile->GetSources(); - for(std::vector::iterator j = (args.begin() + 2); + for(std::vector::const_iterator j = (args.begin() + 2); j != args.end(); ++j) { cmMakefile::SourceMap::iterator l = Classes.find(*j); diff --git a/Source/cmVTKWrapJavaCommand.h b/Source/cmVTKWrapJavaCommand.h index 31bd2a5e1..3b72bd426 100644 --- a/Source/cmVTKWrapJavaCommand.h +++ b/Source/cmVTKWrapJavaCommand.h @@ -24,7 +24,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This is called at the end after all the information diff --git a/Source/cmVTKWrapPythonCommand.cxx b/Source/cmVTKWrapPythonCommand.cxx index 1cfa21821..09e8accac 100644 --- a/Source/cmVTKWrapPythonCommand.cxx +++ b/Source/cmVTKWrapPythonCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmVTKWrapPythonCommand.h" // cmVTKWrapPythonCommand -bool cmVTKWrapPythonCommand::InitialPass(std::vector& args) +bool cmVTKWrapPythonCommand::InitialPass(std::vector const& args) { if(args.size() < 3 ) { @@ -66,7 +66,7 @@ bool cmVTKWrapPythonCommand::InitialPass(std::vector& args) // get the list of classes for this library cmMakefile::SourceMap &Classes = m_Makefile->GetSources(); - for(std::vector::iterator j = (args.begin() + 2); + for(std::vector::const_iterator j = (args.begin() + 2); j != args.end(); ++j) { cmMakefile::SourceMap::iterator l = Classes.find(*j); diff --git a/Source/cmVTKWrapPythonCommand.h b/Source/cmVTKWrapPythonCommand.h index dcc713c06..be90456f9 100644 --- a/Source/cmVTKWrapPythonCommand.h +++ b/Source/cmVTKWrapPythonCommand.h @@ -24,7 +24,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This is called at the end after all the information diff --git a/Source/cmVTKWrapTclCommand.cxx b/Source/cmVTKWrapTclCommand.cxx index 6fa52d069..9dd4904d6 100644 --- a/Source/cmVTKWrapTclCommand.cxx +++ b/Source/cmVTKWrapTclCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmVTKWrapTclCommand.h" // cmVTKWrapTclCommand -bool cmVTKWrapTclCommand::InitialPass(std::vector& args) +bool cmVTKWrapTclCommand::InitialPass(std::vector const& args) { if(args.size() < 3 ) { @@ -63,7 +63,7 @@ bool cmVTKWrapTclCommand::InitialPass(std::vector& args) std::vector sources; bool doing_sources = true; - for(std::vector::iterator j = (args.begin() + 1); + for(std::vector::const_iterator j = (args.begin() + 1); j != args.end(); ++j) { if(*j == "SOURCES") diff --git a/Source/cmVTKWrapTclCommand.h b/Source/cmVTKWrapTclCommand.h index 65f9774ee..65346303d 100644 --- a/Source/cmVTKWrapTclCommand.h +++ b/Source/cmVTKWrapTclCommand.h @@ -25,7 +25,7 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * This is called at the end after all the information diff --git a/Source/cmWrapExcludeFilesCommand.cxx b/Source/cmWrapExcludeFilesCommand.cxx index eb6475953..6c47086dc 100644 --- a/Source/cmWrapExcludeFilesCommand.cxx +++ b/Source/cmWrapExcludeFilesCommand.cxx @@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "cmWrapExcludeFilesCommand.h" // cmWrapExcludeFilesCommand -bool cmWrapExcludeFilesCommand::InitialPass(std::vector& args) +bool cmWrapExcludeFilesCommand::InitialPass(std::vector const& args) { if(args.size() < 1 ) { @@ -50,7 +50,7 @@ bool cmWrapExcludeFilesCommand::InitialPass(std::vector& args) } cmMakefile::SourceMap &Classes = m_Makefile->GetSources(); - for(std::vector::iterator j = args.begin(); + for(std::vector::const_iterator j = args.begin(); j != args.end(); ++j) { for(cmMakefile::SourceMap::iterator l = Classes.begin(); diff --git a/Source/cmWrapExcludeFilesCommand.h b/Source/cmWrapExcludeFilesCommand.h index 967fcd91f..75b7f9e15 100644 --- a/Source/cmWrapExcludeFilesCommand.h +++ b/Source/cmWrapExcludeFilesCommand.h @@ -56,7 +56,7 @@ public: * This is called when the command is first encountered in * the input file. */ - virtual bool InitialPass(std::vector& args); + virtual bool InitialPass(std::vector const& args); /** * The name of the command as specified in CMakeList.txt.