Merge topic 'fix-style'

5916645 Fix some indentation problems in cmPolicies.
This commit is contained in:
Brad King 2013-10-07 15:41:54 -04:00 committed by CMake Topic Stage
commit d673e1f38f
1 changed files with 32 additions and 32 deletions

View File

@ -27,11 +27,11 @@ public:
cmPolicies::PolicyStatus status) cmPolicies::PolicyStatus status)
{ {
if (!idString || !shortDescription || ! longDescription) if (!idString || !shortDescription || ! longDescription)
{ {
cmSystemTools::Error("Attempt to define a policy without " cmSystemTools::Error("Attempt to define a policy without "
"all parameters being specified!"); "all parameters being specified!");
return; return;
} }
this->ID = iD; this->ID = iD;
this->IDString = idString; this->IDString = idString;
this->ShortDescription = shortDescription; this->ShortDescription = shortDescription;
@ -61,29 +61,29 @@ public:
unsigned int tweakV) unsigned int tweakV)
{ {
if (majorV < this->MajorVersionIntroduced) if (majorV < this->MajorVersionIntroduced)
{ {
return true; return true;
} }
if (majorV > this->MajorVersionIntroduced) if (majorV > this->MajorVersionIntroduced)
{ {
return false; return false;
} }
if (minorV < this->MinorVersionIntroduced) if (minorV < this->MinorVersionIntroduced)
{ {
return true; return true;
} }
if (minorV > this->MinorVersionIntroduced) if (minorV > this->MinorVersionIntroduced)
{ {
return false; return false;
} }
if (patchV < this->PatchVersionIntroduced) if (patchV < this->PatchVersionIntroduced)
{ {
return true; return true;
} }
if (patchV > this->PatchVersionIntroduced) if (patchV > this->PatchVersionIntroduced)
{ {
return false; return false;
} }
return (tweakV < this->TweakVersionIntroduced); return (tweakV < this->TweakVersionIntroduced);
} }
@ -609,9 +609,9 @@ cmPolicies::~cmPolicies()
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin(); = this->Policies.begin();
for (;i != this->Policies.end(); ++i) for (;i != this->Policies.end(); ++i)
{ {
delete i->second; delete i->second;
} }
} }
void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
@ -626,11 +626,11 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
{ {
// a policy must be unique and can only be defined once // a policy must be unique and can only be defined once
if (this->Policies.find(iD) != this->Policies.end()) if (this->Policies.find(iD) != this->Policies.end())
{ {
cmSystemTools::Error("Attempt to redefine a CMake policy for policy " cmSystemTools::Error("Attempt to redefine a CMake policy for policy "
"ID ", this->GetPolicyIDString(iD).c_str()); "ID ", this->GetPolicyIDString(iD).c_str());
return; return;
} }
this->Policies[iD] = new cmPolicy(iD, idString, this->Policies[iD] = new cmPolicy(iD, idString,
shortDescription, shortDescription,
@ -784,15 +784,15 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy,
bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid) bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid)
{ {
if (!id || strlen(id) < 1) if (!id || strlen(id) < 1)
{ {
return false; return false;
} }
std::map<std::string,cmPolicies::PolicyID>::iterator pos = std::map<std::string,cmPolicies::PolicyID>::iterator pos =
this->PolicyStringMap.find(id); this->PolicyStringMap.find(id);
if (pos == this->PolicyStringMap.end()) if (pos == this->PolicyStringMap.end())
{ {
return false; return false;
} }
pid = pos->second; pid = pos->second;
return true; return true;
} }
@ -802,9 +802,9 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(pid); this->Policies.find(pid);
if (pos == this->Policies.end()) if (pos == this->Policies.end())
{ {
return ""; return "";
} }
return pos->second->IDString; return pos->second->IDString;
} }
@ -815,11 +815,11 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id); this->Policies.find(id);
if (pos == this->Policies.end()) if (pos == this->Policies.end())
{ {
cmSystemTools::Error( cmSystemTools::Error(
"Request for warning text for undefined policy!"); "Request for warning text for undefined policy!");
return "Request for warning text for undefined policy!"; return "Request for warning text for undefined policy!";
} }
cmOStringStream msg; cmOStringStream msg;
msg << msg <<
@ -839,11 +839,11 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id); this->Policies.find(id);
if (pos == this->Policies.end()) if (pos == this->Policies.end())
{ {
cmSystemTools::Error( cmSystemTools::Error(
"Request for error text for undefined policy!"); "Request for error text for undefined policy!");
return "Request for error text for undefined policy!"; return "Request for error text for undefined policy!";
} }
cmOStringStream error; cmOStringStream error;
error << error <<
@ -869,10 +869,10 @@ cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
this->Policies.find(id); this->Policies.find(id);
if (pos == this->Policies.end()) if (pos == this->Policies.end())
{ {
// TODO is this right? // TODO is this right?
return cmPolicies::WARN; return cmPolicies::WARN;
} }
return pos->second->Status; return pos->second->Status;
} }
@ -883,7 +883,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v)
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin(); = this->Policies.begin();
for (;i != this->Policies.end(); ++i) for (;i != this->Policies.end(); ++i)
{ {
cmOStringStream full; cmOStringStream full;
full << i->second->LongDescription; full << i->second->LongDescription;
full << "\nThis policy was introduced in CMake version "; full << "\nThis policy was introduced in CMake version ";
@ -920,7 +920,7 @@ void cmPolicies::GetDocumentation(std::vector<cmDocumentationEntry>& v)
i->second->ShortDescription.c_str(), i->second->ShortDescription.c_str(),
full.str().c_str()); full.str().c_str());
v.push_back(e); v.push_back(e);
} }
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------