Commit baa28efd authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: change InitialPass to take a const reference to the argument string, to...

ENH: change InitialPass to take a const reference to the argument string, to avoid changes to the file cache
parent b9d56e84
......@@ -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<std::string>& args)
bool cmAbstractFilesCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 1 )
{
......@@ -49,7 +49,7 @@ bool cmAbstractFilesCommand::InitialPass(std::vector<std::string>& args)
return false;
}
cmMakefile::SourceMap &Classes = m_Makefile->GetSources();
for(std::vector<std::string>::iterator j = args.begin();
for(std::vector<std::string>::const_iterator j = args.begin();
j != args.end(); ++j)
{
for(cmMakefile::SourceMap::iterator l = Classes.begin();
......
......@@ -56,7 +56,7 @@ public:
* This is called when the command is first encountered in
* the input file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& argsIn)
{
std::vector<std::string> args = argsIn;
bool all = false;
if(args.size() < 2 )
......
......@@ -66,7 +66,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 1 )
{
this->SetError("called with incorrect number of arguments");
return false;
}
for(std::vector<std::string>::iterator i = args.begin();
for(std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i)
{
std::string str = *i;
......
......@@ -65,7 +65,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* This determines if the command gets propagated down
......
......@@ -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<std::string>& args)
bool cmAddDependenciesCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 2 )
{
......@@ -53,7 +53,7 @@ bool cmAddDependenciesCommand::InitialPass(std::vector<std::string>& args)
cmTargets &tgts = m_Makefile->GetTargets();
if (tgts.find(args[0]) != tgts.end())
{
std::vector<std::string>::iterator s = args.begin();
std::vector<std::string>::const_iterator s = args.begin();
++s;
for (; s != args.end(); ++s)
{
......
......@@ -64,7 +64,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 2 )
{
......@@ -50,7 +50,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string>& args)
return false;
}
std::vector<std::string>::iterator s = args.begin();
std::vector<std::string>::const_iterator s = args.begin();
++s;
if (*s == "WIN32")
{
......
......@@ -65,7 +65,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 1 )
{
......@@ -54,7 +54,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string>& args)
// otherwise it defaults to static library.
int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS"));
std::vector<std::string>::iterator s = args.begin();
std::vector<std::string>::const_iterator s = args.begin();
++s;
// If the second argument is "SHARED" or "STATIC", then it controls
......
......@@ -65,7 +65,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
{
// First argument is the name of the test
// Second argument is the name of the executable to run (a target or external
......
......@@ -64,7 +64,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* This is called at the end after all the information
......
......@@ -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<std::string>& args)
bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 2 || args.size() > 2)
{
......
......@@ -68,7 +68,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* The name of the command as specified in CMakeList.txt.
......
......@@ -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<std::string>& args)
bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 2 )
{
......@@ -56,7 +56,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string>& 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 )
......
......@@ -64,7 +64,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* This determines if the command gets propagated down
......
......@@ -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<std::string>& args)
bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args)
{
if(args.size() < 1 )
{
......
......@@ -64,7 +64,7 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string>& args);
virtual bool InitialPass(std::vector<std::string> const& args);
/**
* This determines if the command gets propagated down
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment