From 2dc409964858c96125948082a2c488bd573b8269 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Oct 2016 21:28:45 +0200 Subject: cmState: Move PolicyStackEntry to separate namespace --- Source/cmState.cxx | 19 ++++++++++--------- Source/cmState.h | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/cmState.cxx b/Source/cmState.cxx index c3e061b..080700e 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -29,9 +29,9 @@ struct cmStateDetail::SnapshotDataType { cmState::PositionType ScopeParent; cmState::PositionType DirectoryParent; - cmLinkedTree::iterator Policies; - cmLinkedTree::iterator PolicyRoot; - cmLinkedTree::iterator PolicyScope; + cmLinkedTree::iterator Policies; + cmLinkedTree::iterator PolicyRoot; + cmLinkedTree::iterator PolicyScope; cmState::SnapshotType SnapshotType; bool Keep; cmLinkedTree::iterator ExecutionListFile; @@ -45,7 +45,7 @@ struct cmStateDetail::SnapshotDataType std::vector::size_type CompileOptionsPosition; }; -struct cmState::PolicyStackEntry : public cmPolicies::PolicyMap +struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap { typedef cmPolicies::PolicyMap derived; PolicyStackEntry(bool w = false) @@ -1078,8 +1078,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackBottom() const void cmState::Snapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak) { PositionType pos = this->Position; - pos->Policies = this->State->PolicyStack.Push(pos->Policies, - PolicyStackEntry(entry, weak)); + pos->Policies = this->State->PolicyStack.Push( + pos->Policies, cmStateDetail::PolicyStackEntry(entry, weak)); } bool cmState::Snapshot::PopPolicy() @@ -1102,7 +1102,8 @@ void cmState::Snapshot::SetPolicy(cmPolicies::PolicyID id, { // Update the policy stack from the top to the top-most strong entry. bool previous_was_weak = true; - for (cmLinkedTree::iterator psi = this->Position->Policies; + for (cmLinkedTree::iterator psi = + this->Position->Policies; previous_was_weak && psi != this->Position->PolicyRoot; ++psi) { psi->Set(id, status); previous_was_weak = psi->Weak; @@ -1124,9 +1125,9 @@ cmPolicies::PolicyStatus cmState::Snapshot::GetPolicy( while (true) { assert(dir.IsValid()); - cmLinkedTree::iterator leaf = + cmLinkedTree::iterator leaf = dir->DirectoryEnd->Policies; - cmLinkedTree::iterator root = + cmLinkedTree::iterator root = dir->DirectoryEnd->PolicyRoot; for (; leaf != root; ++leaf) { if (leaf->IsDefined(id)) { diff --git a/Source/cmState.h b/Source/cmState.h index d733469..34f9fd0 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -26,11 +26,11 @@ class cmPropertyDefinition; namespace cmStateDetail { struct BuildsystemDirectoryStateType; struct SnapshotDataType; +struct PolicyStackEntry; } class cmState { - struct PolicyStackEntry; typedef cmLinkedTree::iterator PositionType; friend class Snapshot; friend struct cmStateDetail::BuildsystemDirectoryStateType; @@ -341,7 +341,7 @@ private: cmLinkedTree ExecutionListFiles; - cmLinkedTree PolicyStack; + cmLinkedTree PolicyStack; cmLinkedTree SnapshotData; cmLinkedTree VarTree; -- cgit v0.12