summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmPolicies.cxx13
-rw-r--r--Source/cmPolicies.h3
2 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index f8d61db..3498adc 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -343,11 +343,6 @@ cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id)
return e.str();
}
-cmPolicies::PolicyMap::PolicyMap()
-{
- this->UNDEFINED.set();
-}
-
cmPolicies::PolicyStatus
cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id) const
{
@@ -375,8 +370,8 @@ cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id) const
void cmPolicies::PolicyMap::Set(cmPolicies::PolicyID id,
cmPolicies::PolicyStatus status)
{
- this->UNDEFINED.reset(id);
this->OLD[id] = (status == cmPolicies::OLD);
+ this->WARN[id] = (status == cmPolicies::WARN);
this->NEW[id] = (status == cmPolicies::NEW);
this->REQUIRED_ALWAYS[id] = (status == cmPolicies::REQUIRED_ALWAYS);
this->REQUIRED_IF_USED[id] = (status == cmPolicies::REQUIRED_IF_USED);
@@ -384,10 +379,12 @@ void cmPolicies::PolicyMap::Set(cmPolicies::PolicyID id,
bool cmPolicies::PolicyMap::IsDefined(cmPolicies::PolicyID id) const
{
- return !this->UNDEFINED[id];
+ return this->OLD[id] || this->WARN[id] || this->NEW[id]
+ || this->REQUIRED_ALWAYS[id] || this->REQUIRED_IF_USED[id];
}
bool cmPolicies::PolicyMap::IsEmpty() const
{
- return !this->UNDEFINED.none();
+ return this->OLD.none() && this->WARN.none() && this->NEW.none()
+ && this->REQUIRED_ALWAYS.none() && this->REQUIRED_IF_USED.none();
}
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 00d857a..8c72dfe 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -281,15 +281,14 @@ public:
/** Represent a set of policy values. */
struct PolicyMap
{
- PolicyMap();
PolicyStatus Get(PolicyID id) const;
void Set(PolicyID id, PolicyStatus status);
bool IsDefined(PolicyID id) const;
bool IsEmpty() const;
private:
- std::bitset<cmPolicies::CMPCOUNT> UNDEFINED;
std::bitset<cmPolicies::CMPCOUNT> OLD;
+ std::bitset<cmPolicies::CMPCOUNT> WARN;
std::bitset<cmPolicies::CMPCOUNT> NEW;
std::bitset<cmPolicies::CMPCOUNT> REQUIRED_IF_USED;
std::bitset<cmPolicies::CMPCOUNT> REQUIRED_ALWAYS;