mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 14:23:10 -05: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:
@@ -58,7 +58,7 @@ bool cmCMakePolicyCommand
|
||||
|
||||
cmOStringStream e;
|
||||
e << "given unknown first argument \"" << args[0] << "\"";
|
||||
this->SetError(e.str().c_str());
|
||||
this->SetError(e.str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
|
||||
{
|
||||
cmOStringStream e;
|
||||
e << "SET given unrecognized policy status \"" << args[2] << "\"";
|
||||
this->SetError(e.str().c_str());
|
||||
this->SetError(e.str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
|
||||
cmOStringStream e;
|
||||
e << "GET given policy \"" << id << "\" which is not known to this "
|
||||
<< "version of CMake.";
|
||||
this->SetError(e.str().c_str());
|
||||
this->SetError(e.str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -126,15 +126,15 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
|
||||
{
|
||||
case cmPolicies::OLD:
|
||||
// Report that the policy is set to OLD.
|
||||
this->Makefile->AddDefinition(var.c_str(), "OLD");
|
||||
this->Makefile->AddDefinition(var, "OLD");
|
||||
break;
|
||||
case cmPolicies::WARN:
|
||||
// Report that the policy is not set.
|
||||
this->Makefile->AddDefinition(var.c_str(), "");
|
||||
this->Makefile->AddDefinition(var, "");
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
// Report that the policy is set to NEW.
|
||||
this->Makefile->AddDefinition(var.c_str(), "NEW");
|
||||
this->Makefile->AddDefinition(var, "NEW");
|
||||
break;
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
|
||||
Reference in New Issue
Block a user