From 1889a5ca33ac1253ce1b220f667bf0ea94515a1b Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 15 Jan 2015 02:16:21 +0100 Subject: fixed clang warnings and errors --- src/core/managed/Events.hpp | 3 ++- src/core/managed/ManagedContainer.hpp | 15 ++++++--------- src/core/managed/Manager.cpp | 2 +- src/core/model/Node.cpp | 4 ++-- src/core/model/Node.hpp | 23 ++++++++++------------- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/core/managed/Events.hpp b/src/core/managed/Events.hpp index a69c363..e433c6d 100644 --- a/src/core/managed/Events.hpp +++ b/src/core/managed/Events.hpp @@ -84,7 +84,8 @@ using EventHandler = void (*)(const Event &event, Managed *owner, void *data); * The Event class and its child classes are responsible for containing the * actual event data which further describes the event to the event handlers. */ -struct Event { +class Event { +public: /** * Actual event type. */ diff --git a/src/core/managed/ManagedContainer.hpp b/src/core/managed/ManagedContainer.hpp index 6952964..13038f9 100644 --- a/src/core/managed/ManagedContainer.hpp +++ b/src/core/managed/ManagedContainer.hpp @@ -552,8 +552,7 @@ public: /* Insert and delete operations */ template - iterator insert(iterator position, InputIterator first, - InputIterator last) + iterator insert(iterator position, InputIterator first, InputIterator last) { bool atStart = true; iterator pos = position; @@ -680,9 +679,8 @@ class ManagedVector : public ManagedGenericList>, ListAccessor>, Listener> { public: - using Base = ManagedGenericList>, - ListAccessor>, Listener>; - using Base::ManagedGenericList; + using ManagedGenericList>, ListAccessor>, + Listener>::ManagedGenericList; }; /** @@ -694,10 +692,9 @@ class ManagedMap : public ManagedGenericMap>, MapAccessor>>, Listener> { public: - using Base = - ManagedGenericMap>, - MapAccessor>>, Listener>; - using Base::ManagedGenericMap; + using ManagedGenericMap>, + MapAccessor>>, + Listener>::ManagedGenericMap; }; } diff --git a/src/core/managed/Manager.cpp b/src/core/managed/Manager.cpp index 60f7332..c6d7f93 100644 --- a/src/core/managed/Manager.cpp +++ b/src/core/managed/Manager.cpp @@ -318,7 +318,7 @@ void Manager::sweep() // Perform a breadth-first search starting from the current Managed bool isReachable = false; - std::unordered_set visited{{curManaged}}; + std::unordered_set visited{curManaged}; std::queue queue{{curManaged}}; while (!queue.empty() && !isReachable) { // Pop the next element from the queue, remove the element from diff --git a/src/core/model/Node.cpp b/src/core/model/Node.cpp index 7f684ce..54512d5 100644 --- a/src/core/model/Node.cpp +++ b/src/core/model/Node.cpp @@ -36,8 +36,8 @@ namespace ousia { struct VisitorHash { size_t operator()(const std::pair &p) const { - const std::hash nodeHash; - const std::hash intHash; + std::hash nodeHash; + std::hash intHash; return nodeHash(p.first) + 37 * intHash(p.second); } }; diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp index 68a6ec7..e8adbaa 100644 --- a/src/core/model/Node.hpp +++ b/src/core/model/Node.hpp @@ -41,7 +41,7 @@ namespace ousia { // Forward declarations class RttiType; -template +template class Rtti; /** @@ -82,7 +82,7 @@ struct ResolutionResult { }; // Forward declaration -struct ResolutionState; +class ResolutionState; /** * The Node class builds the base class for any Node within the DOM graph. A @@ -219,7 +219,7 @@ protected: */ template bool continueResolveComposita(T &container, const Index &index, - ResolutionState &state) + ResolutionState &state) { if (continueResolveIndex(index, state)) { return true; @@ -232,7 +232,7 @@ protected: /** * Tries to search for the requested node in another subtree to which a - * reference exists from this node. + * reference exists from this node. * * @param h is a handle pointing at the node in the subtree. * @param state is used internally to manage the resolution process. @@ -243,7 +243,7 @@ protected: /** * Tries to search for the requested node in another subtree to which a - * reference exists from this node. + * reference exists from this node. * * @param h is a handle pointing at the node in the subtree. * @param state is used internally to manage the resolution process. @@ -378,9 +378,8 @@ class NodeVector : public ManagedGenericList>, ListAccessor>, Listener> { public: - using Base = ManagedGenericList>, - ListAccessor>, Listener>; - using Base::ManagedGenericList; + using ManagedGenericList>, ListAccessor>, + Listener>::ManagedGenericList; /** * Returns the reference to the internal index. @@ -391,7 +390,6 @@ public: * Returns the reference to the internal index. */ Index &getIndex() { return this->listener; } - }; /** @@ -410,10 +408,9 @@ class NodeMap : public ManagedGenericMap>, MapAccessor>>, Listener> { public: - using Base = - ManagedGenericMap>, - MapAccessor>>, Listener>; - using Base::ManagedGenericMap; + using ManagedGenericMap>, + MapAccessor>>, + Listener>::ManagedGenericMap; /** * Returns the reference to the internal index. -- cgit v1.2.3