summaryrefslogtreecommitdiffstats
path: root/Source/cmForEachCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-10 23:04:11 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-11 14:03:50 (GMT)
commit21c573f682f9eafbc8d4402f7febbb1bec1cb86a (patch)
tree8c9e0b913c7de5737a770430064ff5533a19477d /Source/cmForEachCommand.cxx
parente21ffaf8fe5499426604b4ebb9cd08798ee6107c (diff)
downloadCMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.zip
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.gz
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.bz2
Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
Diffstat (limited to 'Source/cmForEachCommand.cxx')
-rw-r--r--Source/cmForEachCommand.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index d697067..e3f66c1 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -35,9 +35,9 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
// at end of for each execute recorded commands
// store the old value
std::string oldDef;
- if (mf.GetDefinition(this->Args[0].c_str()))
+ if (mf.GetDefinition(this->Args[0]))
{
- oldDef = mf.GetDefinition(this->Args[0].c_str());
+ oldDef = mf.GetDefinition(this->Args[0]);
}
std::vector<std::string>::const_iterator j = this->Args.begin();
++j;
@@ -47,7 +47,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
for( ; j != this->Args.end(); ++j)
{
// set the variable to the loop value
- mf.AddDefinition(this->Args[0].c_str(),j->c_str());
+ mf.AddDefinition(this->Args[0],j->c_str());
// Invoke all the functions that were collected in the block.
cmExecutionStatus status;
for(unsigned int c = 0; c < this->Functions.size(); ++c)
@@ -58,13 +58,13 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
{
inStatus.SetReturnInvoked(true);
// restore the variable to its prior value
- mf.AddDefinition(this->Args[0].c_str(),oldDef.c_str());
+ mf.AddDefinition(this->Args[0],oldDef.c_str());
return true;
}
if (status.GetBreakInvoked())
{
// restore the variable to its prior value
- mf.AddDefinition(this->Args[0].c_str(),oldDef.c_str());
+ mf.AddDefinition(this->Args[0],oldDef.c_str());
return true;
}
if(cmSystemTools::GetFatalErrorOccured() )
@@ -74,7 +74,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
}
}
// restore the variable to its prior value
- mf.AddDefinition(this->Args[0].c_str(),oldDef.c_str());
+ mf.AddDefinition(this->Args[0],oldDef.c_str());
return true;
}
else
@@ -166,7 +166,7 @@ bool cmForEachCommand
cmOStringStream str;
str << "called with incorrect range specification: start ";
str << start << ", stop " << stop << ", step " << step;
- this->SetError(str.str().c_str());
+ this->SetError(str.str());
return false;
}
std::vector<std::string> range;
@@ -226,7 +226,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
}
else if(doing == DoingLists)
{
- const char* value = this->Makefile->GetDefinition(args[i].c_str());
+ const char* value = this->Makefile->GetDefinition(args[i]);
if(value && *value)
{
cmSystemTools::ExpandListArgument(value, f->Args, true);