diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-03 08:10:38 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-04 20:32:19 (GMT) |
commit | 387aff200c94073560a961cd2971ab6826347d4d (patch) | |
tree | b5f85dbeba2259548823d30198f6b75a69b5982e /Source | |
parent | dbf680d670e399cc3b042721a1179fba0429073b (diff) | |
download | CMake-387aff200c94073560a961cd2971ab6826347d4d.zip CMake-387aff200c94073560a961cd2971ab6826347d4d.tar.gz CMake-387aff200c94073560a961cd2971ab6826347d4d.tar.bz2 |
cmPolicies: Trivialize GetPolicyStatus method.
It would be possible to implement this with an XMacro and switch
statement, but every codepath currently would still return WARN.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmPolicies.cxx | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 10f85ac..75d12d4 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -124,15 +124,12 @@ const char* idToShortDescription(cmPolicies::PolicyID id) class cmPolicy { public: - cmPolicy(cmPolicies::PolicyID iD, - cmPolicies::PolicyStatus status) + cmPolicy(cmPolicies::PolicyID iD) { this->ID = iD; - this->Status = status; } cmPolicies::PolicyID ID; - cmPolicies::PolicyStatus Status; }; cmPolicies::cmPolicies() @@ -460,10 +457,9 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, unsigned int, unsigned int, unsigned int, - cmPolicies::PolicyStatus status) + cmPolicies::PolicyStatus) { - this->Policies[iD] = new cmPolicy(iD, - status); + this->Policies[iD] = new cmPolicy(iD); } //---------------------------------------------------------------------------- @@ -664,18 +660,9 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) ///! Get the default status for a policy cmPolicies::PolicyStatus -cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id) +cmPolicies::GetPolicyStatus(cmPolicies::PolicyID) { - // if the policy is not know then what? - std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos = - this->Policies.find(id); - if (pos == this->Policies.end()) - { - // TODO is this right? - return cmPolicies::WARN; - } - - return pos->second->Status; + return cmPolicies::WARN; } //---------------------------------------------------------------------------- |