mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user