From 3de54497030b7d8f40f219c0fdfe991e2a9041be Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 3 May 2015 10:10:42 +0200 Subject: cmPolicies: Loop over all policies using enum constants. --- Source/cmPolicies.cxx | 16 ++++++++-------- 1 file 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 ancientPolicies; - for(std::map::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; } -- cgit v0.12