cmMakefile: Constify policies accessors.

This commit is contained in:
Stephen Kelly 2014-01-22 14:58:58 +01:00
parent 2a6e56e078
commit d6d4eaac06
2 changed files with 8 additions and 7 deletions

View File

@ -4287,7 +4287,7 @@ std::vector<cmSourceFile*> cmMakefile::GetQtUiFilesWithOptions() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmPolicies::PolicyStatus cmPolicies::PolicyStatus
cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
{ {
// Get the current setting of the policy. // Get the current setting of the policy.
cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id); cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id);
@ -4315,10 +4315,10 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmPolicies::PolicyStatus cmPolicies::PolicyStatus
cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
{ {
// Is the policy set in our stack? // 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) psi != this->PolicyStack.rend(); ++psi)
{ {
PolicyStackEntry::const_iterator pse = psi->find(id); PolicyStackEntry::const_iterator pse = psi->find(id);
@ -4468,7 +4468,7 @@ bool cmMakefile::SetPolicyVersion(const char *version)
ApplyPolicyVersion(this,version); ApplyPolicyVersion(this,version);
} }
cmPolicies *cmMakefile::GetPolicies() cmPolicies *cmMakefile::GetPolicies() const
{ {
if (!this->GetCMakeInstance()) if (!this->GetCMakeInstance())
{ {

View File

@ -356,7 +356,7 @@ public:
*/ */
bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
bool SetPolicy(const char *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); bool SetPolicyVersion(const char *version);
void RecordPolicies(cmPolicies::PolicyMap& pm); void RecordPolicies(cmPolicies::PolicyMap& pm);
//@} //@}
@ -379,7 +379,7 @@ public:
/** /**
* Get the Policies Instance * Get the Policies Instance
*/ */
cmPolicies *GetPolicies(); cmPolicies *GetPolicies() const;
/** /**
* Add an auxiliary directory to the build. * Add an auxiliary directory to the build.
@ -1031,7 +1031,8 @@ private:
typedef std::vector<PolicyStackEntry> PolicyStackType; typedef std::vector<PolicyStackEntry> PolicyStackType;
PolicyStackType PolicyStack; PolicyStackType PolicyStack;
std::vector<PolicyStackType::size_type> PolicyBarriers; std::vector<PolicyStackType::size_type> PolicyBarriers;
cmPolicies::PolicyStatus GetPolicyStatusInternal(cmPolicies::PolicyID id); cmPolicies::PolicyStatus
GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
bool CheckCMP0000; bool CheckCMP0000;