From d6d4eaac0659b1efea785888f2aab759a1b6b557 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 Jan 2014 14:58:58 +0100 Subject: cmMakefile: Constify policies accessors. --- Source/cmMakefile.cxx | 8 ++++---- Source/cmMakefile.h | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6266f82..99aad51 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4287,7 +4287,7 @@ std::vector cmMakefile::GetQtUiFilesWithOptions() const //---------------------------------------------------------------------------- cmPolicies::PolicyStatus -cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) +cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const { // Get the current setting of the policy. cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id); @@ -4315,10 +4315,10 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) //---------------------------------------------------------------------------- cmPolicies::PolicyStatus -cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) +cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const { // Is the policy set in our stack? - for(PolicyStackType::reverse_iterator psi = this->PolicyStack.rbegin(); + for(PolicyStackType::const_reverse_iterator psi = this->PolicyStack.rbegin(); psi != this->PolicyStack.rend(); ++psi) { PolicyStackEntry::const_iterator pse = psi->find(id); @@ -4468,7 +4468,7 @@ bool cmMakefile::SetPolicyVersion(const char *version) ApplyPolicyVersion(this,version); } -cmPolicies *cmMakefile::GetPolicies() +cmPolicies *cmMakefile::GetPolicies() const { if (!this->GetCMakeInstance()) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 4c7341e..1e90122 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -356,7 +356,7 @@ public: */ bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); bool SetPolicy(const char *id, cmPolicies::PolicyStatus status); - cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id); + cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const; bool SetPolicyVersion(const char *version); void RecordPolicies(cmPolicies::PolicyMap& pm); //@} @@ -379,7 +379,7 @@ public: /** * Get the Policies Instance */ - cmPolicies *GetPolicies(); + cmPolicies *GetPolicies() const; /** * Add an auxiliary directory to the build. @@ -1031,7 +1031,8 @@ private: typedef std::vector PolicyStackType; PolicyStackType PolicyStack; std::vector PolicyBarriers; - cmPolicies::PolicyStatus GetPolicyStatusInternal(cmPolicies::PolicyID id); + cmPolicies::PolicyStatus + GetPolicyStatusInternal(cmPolicies::PolicyID id) const; bool CheckCMP0000; -- cgit v0.12