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:
@@ -26,7 +26,7 @@ static std::string cmIfCommandError(
|
||||
i != args.end(); ++i)
|
||||
{
|
||||
err += " ";
|
||||
err += lg->EscapeForCMake(i->c_str());
|
||||
err += lg->EscapeForCMake(*i);
|
||||
}
|
||||
err += "\n";
|
||||
return err;
|
||||
@@ -199,7 +199,7 @@ bool cmIfCommand
|
||||
err += errorString;
|
||||
if (status == cmake::FATAL_ERROR)
|
||||
{
|
||||
this->SetError(err.c_str());
|
||||
this->SetError(err);
|
||||
cmSystemTools::SetFatalErrorOccured();
|
||||
return false;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ namespace
|
||||
}
|
||||
|
||||
// Check definition.
|
||||
const char* def = mf->GetDefinition(arg.c_str());
|
||||
const char* def = mf->GetDefinition(arg);
|
||||
return !cmSystemTools::IsOff(def);
|
||||
}
|
||||
|
||||
@@ -277,12 +277,12 @@ namespace
|
||||
else if(arg == "1")
|
||||
{ return true; }
|
||||
else
|
||||
{ return !cmSystemTools::IsOff(mf->GetDefinition(arg.c_str())); }
|
||||
{ return !cmSystemTools::IsOff(mf->GetDefinition(arg)); }
|
||||
}
|
||||
else
|
||||
{
|
||||
// Old GetVariableOrNumber behavior.
|
||||
const char* def = mf->GetDefinition(arg.c_str());
|
||||
const char* def = mf->GetDefinition(arg);
|
||||
if(!def && atoi(arg.c_str()))
|
||||
{
|
||||
def = arg.c_str();
|
||||
@@ -559,7 +559,7 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
bdef = makefile->IsDefinitionSet((argP1)->c_str());
|
||||
bdef = makefile->IsDefinitionSet(*(argP1));
|
||||
}
|
||||
HandlePredicate(bdef, reducible, arg, newArgs, argP1, argP2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user