diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-15 02:16:21 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-15 02:16:21 +0100 |
commit | 1889a5ca33ac1253ce1b220f667bf0ea94515a1b (patch) | |
tree | 16e8e517c0c84c2fa89d61f77273aa13327c5a7b /src/core | |
parent | e99a307bf76689e4e86f8ac1a4c545bcebbdb7ab (diff) |
fixed clang warnings and errors
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/managed/Events.hpp | 3 | ||||
-rw-r--r-- | src/core/managed/ManagedContainer.hpp | 15 | ||||
-rw-r--r-- | src/core/managed/Manager.cpp | 2 | ||||
-rw-r--r-- | src/core/model/Node.cpp | 4 | ||||
-rw-r--r-- | 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 <class InputIterator> - 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<T, std::vector<Handle<T>>, ListAccessor<Handle<T>>, Listener> { public: - using Base = ManagedGenericList<T, std::vector<Handle<T>>, - ListAccessor<Handle<T>>, Listener>; - using Base::ManagedGenericList; + using ManagedGenericList<T, std::vector<Handle<T>>, ListAccessor<Handle<T>>, + Listener>::ManagedGenericList; }; /** @@ -694,10 +692,9 @@ class ManagedMap : public ManagedGenericMap<K, T, std::map<K, Handle<T>>, MapAccessor<std::pair<K, Handle<T>>>, Listener> { public: - using Base = - ManagedGenericMap<K, T, std::map<K, Handle<T>>, - MapAccessor<std::pair<K, Handle<T>>>, Listener>; - using Base::ManagedGenericMap; + using ManagedGenericMap<K, T, std::map<K, Handle<T>>, + MapAccessor<std::pair<K, Handle<T>>>, + 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<Managed *> visited{{curManaged}}; + std::unordered_set<Managed *> visited{curManaged}; std::queue<Managed *> 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<const Node *, int> &p) const { - const std::hash<const Node *> nodeHash; - const std::hash<int> intHash; + std::hash<const Node *> nodeHash; + std::hash<int> 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<class T> +template <class T> 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 <class T> 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<T, std::vector<Handle<T>>, ListAccessor<Handle<T>>, Listener> { public: - using Base = ManagedGenericList<T, std::vector<Handle<T>>, - ListAccessor<Handle<T>>, Listener>; - using Base::ManagedGenericList; + using ManagedGenericList<T, std::vector<Handle<T>>, ListAccessor<Handle<T>>, + 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<K, T, std::map<K, Handle<T>>, MapAccessor<std::pair<K, Handle<T>>>, Listener> { public: - using Base = - ManagedGenericMap<K, T, std::map<K, Handle<T>>, - MapAccessor<std::pair<K, Handle<T>>>, Listener>; - using Base::ManagedGenericMap; + using ManagedGenericMap<K, T, std::map<K, Handle<T>>, + MapAccessor<std::pair<K, Handle<T>>>, + Listener>::ManagedGenericMap; /** * Returns the reference to the internal index. |