diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-03 08:10:42 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-04 20:32:19 (GMT) |
commit | 3de54497030b7d8f40f219c0fdfe991e2a9041be (patch) | |
tree | 1a58aebb31ec85f0e7185b279ec7f46a6d18ae30 /Source/cmPolicies.cxx | |
parent | 387aff200c94073560a961cd2971ab6826347d4d (diff) | |
download | CMake-3de54497030b7d8f40f219c0fdfe991e2a9041be.zip CMake-3de54497030b7d8f40f219c0fdfe991e2a9041be.tar.gz CMake-3de54497030b7d8f40f219c0fdfe991e2a9041be.tar.bz2 |
cmPolicies: Loop over all policies using enum constants.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r-- | Source/cmPolicies.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 75d12d4..12f945a 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -579,20 +579,20 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, // now loop over all the policies and set them as appropriate std::vector<cmPolicies::PolicyID> ancientPolicies; - for(std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i - = this->Policies.begin(); i != this->Policies.end(); ++i) + for(PolicyID pid = cmPolicies::CMP0000; + pid != cmPolicies::CMPCOUNT; pid = PolicyID(pid+1)) { - if (isPolicyNewerThan(i->first, majorVer, minorVer, patchVer)) + if (isPolicyNewerThan(pid, majorVer, minorVer, patchVer)) { - if(this->GetPolicyStatus(i->first) == cmPolicies::REQUIRED_ALWAYS) + if(this->GetPolicyStatus(pid) == cmPolicies::REQUIRED_ALWAYS) { - ancientPolicies.push_back(i->first); + ancientPolicies.push_back(pid); } else { cmPolicies::PolicyStatus status = cmPolicies::WARN; - if(!GetPolicyDefault(mf, idToString(i->first), &status) || - !mf->SetPolicy(i->first, status)) + if(!GetPolicyDefault(mf, idToString(pid), &status) || + !mf->SetPolicy(pid, status)) { return false; } @@ -600,7 +600,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, } else { - if (!mf->SetPolicy(i->first, cmPolicies::NEW)) + if (!mf->SetPolicy(pid, cmPolicies::NEW)) { return false; } |