From 0c3eba998b4ee024a30ad3bc2209f69d9f538b9c Mon Sep 17 00:00:00 2001 From: codereader Date: Sat, 4 Mar 2017 20:44:54 +0100 Subject: [PATCH] Fix first truckload of clang warnings, mostly due to missing override keywords and type conversions. --- libs/math/FloatTools.h | 2 +- libs/scene/Node.h | 48 ++++++++++---------- libs/wxutil/TreeModel.cpp | 2 +- libs/wxutil/TreeModel.h | 25 +++++----- libs/wxutil/TreeModelFilter.cpp | 2 +- plugins/archivezip/ZipArchive.cpp | 2 - plugins/eclassmgr/EClassManager.h | 4 +- plugins/entity/EntityCreator.h | 8 ++-- plugins/entity/EntityNode.h | 40 ++++++++-------- plugins/entity/doom3group/Doom3GroupNode.h | 30 ++++++------ plugins/entity/eclassmodel/EclassModelNode.h | 8 ++-- plugins/entity/generic/GenericEntityNode.h | 12 ++--- plugins/entity/light/LightNode.h | 32 ++++++------- plugins/entity/speaker/SpeakerNode.h | 18 ++++---- radiant/camera/CamWnd.h | 8 ++-- radiant/map/AutoSaver.cpp | 2 +- radiant/map/Map.h | 2 +- radiant/map/RootNode.h | 10 ++-- radiant/model/NullModelNode.h | 8 ++-- radiant/ui/mousetool/BindToolDialog.cpp | 2 - radiant/xyview/XYWnd.h | 18 ++++---- 21 files changed, 141 insertions(+), 142 deletions(-) diff --git a/libs/math/FloatTools.h b/libs/math/FloatTools.h index d9dd4fa489..9c89107995 100644 --- a/libs/math/FloatTools.h +++ b/libs/math/FloatTools.h @@ -65,7 +65,7 @@ inline Element float_mid(const Element& self, const Element& other) template inline int float_to_integer(const Element& f) { - return lrint(f); + return static_cast(lrint(f)); } /// \brief Returns \p f rounded to the nearest multiple of \p snap. diff --git a/libs/scene/Node.h b/libs/scene/Node.h index 156c610559..92886008c2 100644 --- a/libs/scene/Node.h +++ b/libs/scene/Node.h @@ -84,12 +84,12 @@ class Node : static unsigned long getNewId(); // Default name for generic nodes - std::string name() const { return "node"; } + std::string name() const override { return "node"; } - void setSceneGraph(const GraphPtr& sceneGraph); + void setSceneGraph(const GraphPtr& sceneGraph) override; - bool isRoot() const; - void setIsRoot(bool isRoot); + bool isRoot() const override; + void setIsRoot(bool isRoot) override; void enable(unsigned int state) override; void disable(unsigned int state) override; @@ -102,34 +102,35 @@ class Node : void setForcedVisibility(bool forceVisible, bool includeChildren) override; // Layered implementation - virtual void addToLayer(int layerId); - virtual void removeFromLayer(int layerId); - virtual void moveToLayer(int layerId); - virtual LayerList getLayers() const; - virtual void assignToLayers(const LayerList& newLayers); + virtual void addToLayer(int layerId) override; + virtual void removeFromLayer(int layerId) override; + virtual void moveToLayer(int layerId) override; + virtual LayerList getLayers() const override; + virtual void assignToLayers(const LayerList& newLayers) override; virtual void addChildNode(const INodePtr& node) override; virtual void addChildNodeToFront(const INodePtr& node) override; virtual void removeChildNode(const INodePtr& node) override; virtual bool hasChildNodes() const override; - virtual void traverse(NodeVisitor& visitor); - virtual void traverseChildren(NodeVisitor& visitor) const; - virtual bool foreachNode(const VisitorFunc& functor) const; + virtual void traverse(NodeVisitor& visitor) override; + virtual void traverseChildren(NodeVisitor& visitor) const override; + virtual bool foreachNode(const VisitorFunc& functor) const override; - virtual void setParent(const INodePtr& parent); - virtual scene::INodePtr getParent() const; + virtual void setParent(const INodePtr& parent) override; + virtual scene::INodePtr getParent() const override; - const AABB& worldAABB() const; + const AABB& worldAABB() const override; const AABB& childBounds() const; - virtual void boundsChanged(); + virtual void boundsChanged() override; /** * Return the filtered status of this Instance. */ - virtual bool isFiltered() const { + virtual bool isFiltered() const override + { return (_state & eFiltered) != 0; } @@ -137,7 +138,8 @@ class Node : * Set the filtered status of this Node. Setting filtered to true will * prevent the node from being rendered. */ - virtual void setFiltered(bool filtered) { + virtual void setFiltered(bool filtered) override + { if (filtered) { _state |= eFiltered; } @@ -146,11 +148,11 @@ class Node : } } - const Matrix4& localToWorld() const; + const Matrix4& localToWorld() const override; void transformChangedLocal() override; - void transformChanged(); + void transformChanged() override; void setTransformChangedCallback(const Callback& callback); @@ -164,7 +166,7 @@ class Node : virtual void onRemoveFromScene(IMapRootNode& root) override; // Returns TRUE if this node is inserted in the scene, FALSE otherwise - bool inScene() const + bool inScene() const override { return _instantiated; } @@ -177,7 +179,7 @@ class Node : scene::Path getPath(); // Returns a shared reference to this node - scene::INodePtr getSelf(); + scene::INodePtr getSelf() override; IRenderEntity* getRenderEntity() const override { @@ -192,7 +194,7 @@ class Node : // Base renderable implementation virtual RenderSystemPtr getRenderSystem() const; - virtual void setRenderSystem(const RenderSystemPtr& renderSystem); + virtual void setRenderSystem(const RenderSystemPtr& renderSystem) override; protected: // Method for subclasses to check whether this node is forcedly visible diff --git a/libs/wxutil/TreeModel.cpp b/libs/wxutil/TreeModel.cpp index 8f8b568be6..4af1cbeb2d 100644 --- a/libs/wxutil/TreeModel.cpp +++ b/libs/wxutil/TreeModel.cpp @@ -623,7 +623,7 @@ unsigned int TreeModel::GetChildren(const wxDataViewItem& item, wxDataViewItemAr children.Add((*iter)->item); } - return owningNode->children.size(); + return static_cast(owningNode->children.size()); } wxDataViewItem TreeModel::GetRoot() diff --git a/libs/wxutil/TreeModel.h b/libs/wxutil/TreeModel.h index be53dcc31a..b29e736f36 100644 --- a/libs/wxutil/TreeModel.h +++ b/libs/wxutil/TreeModel.h @@ -218,7 +218,7 @@ class TreeModel : int getInteger() const { - return getVariant().GetInteger(); + return static_cast(getVariant().GetInteger()); } double getDouble() const @@ -435,30 +435,31 @@ class TreeModel : // Base class implementation / overrides - virtual bool HasDefaultCompare() const; - virtual unsigned int GetColumnCount() const; + virtual bool HasDefaultCompare() const override; + virtual unsigned int GetColumnCount() const override; // return type as reported by wxVariant - virtual wxString GetColumnType(unsigned int col) const; + virtual wxString GetColumnType(unsigned int col) const override; // get value into a wxVariant virtual void GetValue(wxVariant &variant, - const wxDataViewItem &item, unsigned int col) const; + const wxDataViewItem &item, unsigned int col) const override; virtual bool SetValue(const wxVariant &variant, const wxDataViewItem &item, - unsigned int col); + unsigned int col) override; - virtual bool GetAttr(const wxDataViewItem& item, unsigned int col, wxDataViewItemAttr& attr) const; + virtual bool GetAttr(const wxDataViewItem& item, unsigned int col, wxDataViewItemAttr& attr) const override; - virtual wxDataViewItem GetParent(const wxDataViewItem &item) const; - virtual bool IsContainer(const wxDataViewItem& item) const; + virtual wxDataViewItem GetParent(const wxDataViewItem &item) const override; + virtual bool IsContainer(const wxDataViewItem& item) const override; - virtual unsigned int GetChildren(const wxDataViewItem& item, wxDataViewItemArray& children) const; + virtual unsigned int GetChildren(const wxDataViewItem& item, wxDataViewItemArray& children) const override; virtual wxDataViewItem GetRoot(); - virtual bool IsListModel() const; + virtual bool IsListModel() const override; - virtual int Compare(const wxDataViewItem& item1, const wxDataViewItem& item2, unsigned int column, bool ascending) const; + virtual int Compare(const wxDataViewItem& item1, const wxDataViewItem& item2, + unsigned int column, bool ascending) const override; protected: // Returns a reference to the actual rootnode, only allowed for use in subclasses diff --git a/libs/wxutil/TreeModelFilter.cpp b/libs/wxutil/TreeModelFilter.cpp index 9f6b71d16f..5d59c8690a 100644 --- a/libs/wxutil/TreeModelFilter.cpp +++ b/libs/wxutil/TreeModelFilter.cpp @@ -213,7 +213,7 @@ unsigned int TreeModelFilter::GetChildren(const wxDataViewItem& item, wxDataView } }); - return children.size(); + return static_cast(children.size()); } } // namespace diff --git a/plugins/archivezip/ZipArchive.cpp b/plugins/archivezip/ZipArchive.cpp index 79f9e2fe97..fd5d04f322 100644 --- a/plugins/archivezip/ZipArchive.cpp +++ b/plugins/archivezip/ZipArchive.cpp @@ -79,8 +79,6 @@ ArchiveTextFilePtr ZipArchive::openTextFile(const std::string& name) { ZipRecord* file = i->second.file(); - FileInputStream::size_type position = 0; - { // Guard against concurrent access std::lock_guard lock(_streamLock); diff --git a/plugins/eclassmgr/EClassManager.h b/plugins/eclassmgr/EClassManager.h index 96c7893644..c1645ad1f1 100644 --- a/plugins/eclassmgr/EClassManager.h +++ b/plugins/eclassmgr/EClassManager.h @@ -67,8 +67,8 @@ class EClassManager : void unrealise() override; // VFS::Observer implementation - virtual void onFileSystemInitialise(); - virtual void onFileSystemShutdown(); + virtual void onFileSystemInitialise() override; + virtual void onFileSystemShutdown() override; // Find the modeldef with the given name virtual IModelDefPtr findModel(const std::string& name) override; diff --git a/plugins/entity/EntityCreator.h b/plugins/entity/EntityCreator.h index 85b739c331..ef0f7011f4 100644 --- a/plugins/entity/EntityCreator.h +++ b/plugins/entity/EntityCreator.h @@ -18,10 +18,10 @@ class Doom3EntityCreator : ITargetManagerPtr createTargetManager() override; // RegisterableModule implementation - virtual const std::string& getName() const; - virtual const StringSet& getDependencies() const; - virtual void initialiseModule(const ApplicationContext& ctx); - virtual void shutdownModule(); + virtual const std::string& getName() const override; + virtual const StringSet& getDependencies() const override; + virtual void initialiseModule(const ApplicationContext& ctx) override; + virtual void shutdownModule() override; }; typedef std::shared_ptr Doom3EntityCreatorPtr; diff --git a/plugins/entity/EntityNode.h b/plugins/entity/EntityNode.h index 716e34befd..d6a2296bcb 100644 --- a/plugins/entity/EntityNode.h +++ b/plugins/entity/EntityNode.h @@ -85,37 +85,37 @@ class EntityNode : virtual ~EntityNode(); // IEntityNode implementation - Entity& getEntity(); - virtual void refreshModel(); + Entity& getEntity() override; + virtual void refreshModel() override; // RenderEntity implementation - virtual float getShaderParm(int parmNum) const; - virtual const Vector3& getDirection() const; + virtual float getShaderParm(int parmNum) const override; + virtual const Vector3& getDirection() const override; // SelectionTestable implementation - virtual void testSelect(Selector& selector, SelectionTest& test); + virtual void testSelect(Selector& selector, SelectionTest& test) override; // Namespaced implementation // Gets/sets the namespace of this named object - std::string getName() const; - void setNamespace(INamespace* space); - INamespace* getNamespace() const; - void connectNameObservers(); - void disconnectNameObservers(); - void changeName(const std::string& newName); + std::string getName() const override; + void setNamespace(INamespace* space) override; + INamespace* getNamespace() const override; + void connectNameObservers() override; + void disconnectNameObservers() override; + void changeName(const std::string& newName) override; - void attachNames(); - void detachNames(); + void attachNames() override; + void detachNames() override; virtual void onInsertIntoScene(scene::IMapRootNode& root) override; virtual void onRemoveFromScene(scene::IMapRootNode& root) override; // Sets/clears render entity references on child nodes - virtual void onChildAdded(const scene::INodePtr& child); - virtual void onChildRemoved(const scene::INodePtr& child); + virtual void onChildAdded(const scene::INodePtr& child) override; + virtual void onChildRemoved(const scene::INodePtr& child) override; - virtual std::string name() const; - Type getNodeType() const; + virtual std::string name() const override; + Type getNodeType() const override; // Renderable implementation, can be overridden by subclasses virtual void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -133,11 +133,11 @@ class EntityNode : ModelKey& getModelKey(); // needed by the Doom3Group class, could be a fixme - const ShaderPtr& getWireShader() const; + const ShaderPtr& getWireShader() const override; const ShaderPtr& getFillShader() const; - virtual void onPostUndo(); - virtual void onPostRedo(); + virtual void onPostUndo() override; + virtual void onPostRedo() override; protected: virtual void onModelKeyChanged(const std::string& value); diff --git a/plugins/entity/doom3group/Doom3GroupNode.h b/plugins/entity/doom3group/Doom3GroupNode.h index f0b9b679e0..d92982916d 100644 --- a/plugins/entity/doom3group/Doom3GroupNode.h +++ b/plugins/entity/doom3group/Doom3GroupNode.h @@ -50,20 +50,20 @@ class Doom3GroupNode : virtual ~Doom3GroupNode(); // CurveNode implementation - virtual bool hasEmptyCurve(); - virtual void appendControlPoints(unsigned int numPoints); - virtual void removeSelectedControlPoints(); - virtual void insertControlPointsAtSelected(); - virtual void convertCurveType(); + virtual bool hasEmptyCurve() override; + virtual void appendControlPoints(unsigned int numPoints) override; + virtual void removeSelectedControlPoints() override; + virtual void insertControlPointsAtSelected() override; + virtual void convertCurveType() override; // Bounded implementation - virtual const AABB& localAABB() const; + virtual const AABB& localAABB() const override; /** greebo: Tests the contained Doom3Group for selection. * * Note: This can be successful in vertex mode only, func_statics do not use this method. */ - void testSelect(Selector& selector, SelectionTest& test); + void testSelect(Selector& selector, SelectionTest& test) override; // ComponentSelectionTestable implementation bool isSelectedComponents() const override; @@ -76,23 +76,23 @@ class Doom3GroupNode : virtual void onRemoveFromScene(scene::IMapRootNode& root) override; // ComponentEditable implementation - const AABB& getSelectedComponentsBounds() const; + const AABB& getSelectedComponentsBounds() const override; // ComponentSnappable implementation - void snapComponents(float snap); + void snapComponents(float snap) override; // Snappable implementation - virtual void snapto(float snap); + virtual void snapto(float snap) override; void selectionChangedComponent(const ISelectable& selectable); - scene::INodePtr clone() const; + scene::INodePtr clone() const override; /** greebo: Call this right before map save to let the child * brushes have their origin recalculated. */ - void addOriginToChildren(); - void removeOriginFromChildren(); + void addOriginToChildren() override; + void removeOriginFromChildren() override; // Renderable implementation void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -116,10 +116,10 @@ class Doom3GroupNode : void _applyTransformation() override; // Model Key changed signal - void onModelKeyChanged(const std::string& value); + void onModelKeyChanged(const std::string& value) override; // Override EntityNode::construct() - virtual void construct(); + virtual void construct() override; private: void evaluateTransform(); diff --git a/plugins/entity/eclassmodel/EclassModelNode.h b/plugins/entity/eclassmodel/EclassModelNode.h index f0ca8989ff..222e4f329b 100644 --- a/plugins/entity/eclassmodel/EclassModelNode.h +++ b/plugins/entity/eclassmodel/EclassModelNode.h @@ -55,12 +55,12 @@ class EclassModelNode : virtual ~EclassModelNode(); // Snappable implementation - virtual void snapto(float snap); + virtual void snapto(float snap) override; // Bounded implementation - virtual const AABB& localAABB() const; + virtual const AABB& localAABB() const override; - scene::INodePtr clone() const; + scene::INodePtr clone() const override; // Renderable implementation void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -80,7 +80,7 @@ class EclassModelNode : void _applyTransformation() override; // Override EntityNode::construct() - void construct(); + void construct() override; private: void translate(const Vector3& translation); diff --git a/plugins/entity/generic/GenericEntityNode.h b/plugins/entity/generic/GenericEntityNode.h index 6bdbc9f194..ecd27347fd 100644 --- a/plugins/entity/generic/GenericEntityNode.h +++ b/plugins/entity/generic/GenericEntityNode.h @@ -44,15 +44,15 @@ class GenericEntityNode : static GenericEntityNodePtr Create(const IEntityClassPtr& eclass); // Snappable implementation - virtual void snapto(float snap); + virtual void snapto(float snap) override; // Bounded implementation - virtual const AABB& localAABB() const; + virtual const AABB& localAABB() const override; // SelectionTestable implementation - void testSelect(Selector& selector, SelectionTest& test); + void testSelect(Selector& selector, SelectionTest& test) override; - scene::INodePtr clone() const; + scene::INodePtr clone() const override; // Renderable implementation void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -61,7 +61,7 @@ class GenericEntityNode : SolidAAABBRenderMode getSolidAABBRenderMode() const; // Override EntityNode::getDirection() - const Vector3& getDirection() const; + const Vector3& getDirection() const override; // Returns the original "origin" value const Vector3& getUntransformedOrigin() override; @@ -79,7 +79,7 @@ class GenericEntityNode : void _applyTransformation() override; // Override EntityNode::construct() - void construct(); + void construct() override; }; } // namespace entity diff --git a/plugins/entity/light/LightNode.h b/plugins/entity/light/LightNode.h index 278c819d66..49283a7279 100644 --- a/plugins/entity/light/LightNode.h +++ b/plugins/entity/light/LightNode.h @@ -51,22 +51,22 @@ class LightNode : static LightNodePtr Create(const IEntityClassPtr& eclass); // RenderEntity implementation - virtual float getShaderParm(int parmNum) const; + virtual float getShaderParm(int parmNum) const override; // Bounded implementation - virtual const AABB& localAABB() const; + virtual const AABB& localAABB() const override; // override scene::Inode methods to deselect the child components virtual void onInsertIntoScene(scene::IMapRootNode& root) override; virtual void onRemoveFromScene(scene::IMapRootNode& root) override; // Snappable implementation - virtual void snapto(float snap); + virtual void snapto(float snap) override; /** greebo: Returns the AABB of the small diamond representation. * (use this to select the light against an AABB selectiontest like CompleteTall or similar). */ - AABB getSelectAABB(); + AABB getSelectAABB() override; /*greebo: This is a callback function that gets connected in the constructor * Don't know exactly what it does, but it seems to notify the shader cache that the light has moved or @@ -81,14 +81,14 @@ class LightNode : * * If one or more components is/are selected, ONLY those are snapped to the grid. */ - void snapComponents(float snap); + void snapComponents(float snap) override; // PlaneSelectable implementation - void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback); - void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes); + void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) override; + void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) override; // Test the light volume for selection, this just passes the call on to the contained Light class - void testSelect(Selector& selector, SelectionTest& test); + void testSelect(Selector& selector, SelectionTest& test) override; // greebo: Returns true if drag planes or the light center is selected (both are components) bool isSelectedComponents() const override; @@ -102,9 +102,9 @@ class LightNode : * distinguishes between projected and point lights and stretches the AABB accordingly. */ // ComponentEditable implementation - const AABB& getSelectedComponentsBounds() const; + const AABB& getSelectedComponentsBounds() const override; - scene::INodePtr clone() const; + scene::INodePtr clone() const override; void selectedChangedComponent(const ISelectable& selectable); @@ -117,12 +117,12 @@ class LightNode : void renderComponents(RenderableCollector& collector, const VolumeTest& volume) const override; // RendererLight implementation - const Vector3& worldOrigin() const; - Matrix4 getLightTextureTransformation() const; - const ShaderPtr& getShader() const; - bool intersectsAABB(const AABB& other) const; + const Vector3& worldOrigin() const override; + Matrix4 getLightTextureTransformation() const override; + const ShaderPtr& getShader() const override; + bool intersectsAABB(const AABB& other) const override; - Vector3 getLightOrigin() const; + Vector3 getLightOrigin() const override; const Matrix4& rotation() const; // Returns the original "origin" value @@ -138,7 +138,7 @@ class LightNode : void _applyTransformation() override; // Override EntityNode::construct() - void construct(); + void construct() override; private: void renderInactiveComponents(RenderableCollector& collector, const VolumeTest& volume, const bool selected) const; diff --git a/plugins/entity/speaker/SpeakerNode.h b/plugins/entity/speaker/SpeakerNode.h index f67ba16bff..8081e32dde 100644 --- a/plugins/entity/speaker/SpeakerNode.h +++ b/plugins/entity/speaker/SpeakerNode.h @@ -65,8 +65,8 @@ class SpeakerNode : SpeakerNode(const SpeakerNode& other); void translate(const Vector3& translation); void rotate(const Quaternion& rotation); - void revertTransform(); - void freezeTransform(); + void revertTransform() override; + void freezeTransform() override; void updateTransform(); void updateAABB(); void originChanged(); @@ -86,14 +86,14 @@ class SpeakerNode : ~SpeakerNode(); // Snappable implementation - void snapto(float snap); + void snapto(float snap) override; // Bounded implementation - const AABB& localAABB() const; + const AABB& localAABB() const override; // PlaneSelectable implementation - void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback); - void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes); + void selectPlanes(Selector& selector, SelectionTest& test, const PlaneCallback& selectedPlaneCallback) override; + void selectReversedPlanes(Selector& selector, const SelectedPlanes& selectedPlanes) override; // ComponentSelectionTestable implementation bool isSelectedComponents() const override; @@ -102,9 +102,9 @@ class SpeakerNode : void testSelectComponents(Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode) override; // SelectionTestable implementation - void testSelect(Selector& selector, SelectionTest& test); + void testSelect(Selector& selector, SelectionTest& test) override; - scene::INodePtr clone() const; + scene::INodePtr clone() const override; // Renderable implementation void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -122,7 +122,7 @@ class SpeakerNode : void _applyTransformation() override; // Called after the constructor is done, overrides EntityNode - void construct(); + void construct() override; private: void evaluateTransform(); diff --git a/radiant/camera/CamWnd.h b/radiant/camera/CamWnd.h index 79f42d3246..b50f7b6861 100644 --- a/radiant/camera/CamWnd.h +++ b/radiant/camera/CamWnd.h @@ -101,7 +101,7 @@ class CamWnd : void update(); // The callback when the scene gets changed - void onSceneGraphChange(); + void onSceneGraphChange() override; static void captureStates(); static void releaseStates(); @@ -129,9 +129,9 @@ class CamWnd : wxutil::GLWidget* getwxGLWidget() const { return _wxGLWidget; } wxWindow* getMainWidget() const; - void enableFreeMove(); - void disableFreeMove(); - bool freeMoveEnabled() const; + void enableFreeMove() override; + void disableFreeMove() override; + bool freeMoveEnabled() const override; void jumpToObject(SelectionTest& selectionTest); diff --git a/radiant/map/AutoSaver.cpp b/radiant/map/AutoSaver.cpp index 8f76715168..fb167e377c 100644 --- a/radiant/map/AutoSaver.cpp +++ b/radiant/map/AutoSaver.cpp @@ -83,7 +83,7 @@ void AutoMapSaver::startTimer() { if (!_timer) return; - _timer->Start(_interval * 1000); + _timer->Start(static_cast(_interval * 1000)); } void AutoMapSaver::stopTimer() diff --git a/radiant/map/Map.h b/radiant/map/Map.h index c3c2aa8cb2..d12f2e69c9 100644 --- a/radiant/map/Map.h +++ b/radiant/map/Map.h @@ -84,7 +84,7 @@ class Map : /** greebo: Returns the name of this class */ - std::string getMapName() const; + std::string getMapName() const override; /** * greebo: Saves the current map, doesn't ask for any filenames, diff --git a/radiant/map/RootNode.h b/radiant/map/RootNode.h index 0d5828fffa..3e1a78b14f 100644 --- a/radiant/map/RootNode.h +++ b/radiant/map/RootNode.h @@ -58,19 +58,19 @@ class RootNode : return Highlight::NoHighlight; // never highlighted } - std::string name() const; - Type getNodeType() const; + std::string name() const override; + Type getNodeType() const override; void setName(const std::string& name); // Override scene::Node methods - virtual void onChildAdded(const scene::INodePtr& child); - virtual void onChildRemoved(const scene::INodePtr& child); + virtual void onChildAdded(const scene::INodePtr& child) override; + virtual void onChildRemoved(const scene::INodePtr& child) override; virtual void onInsertIntoScene(IMapRootNode& root) override; virtual void onRemoveFromScene(IMapRootNode& root) override; - const AABB& localAABB() const + const AABB& localAABB() const override { return _emptyAABB; } diff --git a/radiant/model/NullModelNode.h b/radiant/model/NullModelNode.h index 9a128dda39..bae236d6b2 100644 --- a/radiant/model/NullModelNode.h +++ b/radiant/model/NullModelNode.h @@ -24,8 +24,8 @@ class NullModelNode : // Alternative constructor, uses the given nullModel NullModelNode(const NullModelPtr& nullModel); - std::string name() const; - Type getNodeType() const; + std::string name() const override; + Type getNodeType() const override; // Accessor to the singleton instance static NullModelNodePtr InstancePtr(); @@ -34,7 +34,7 @@ class NullModelNode : IModel& getIModel() override; bool hasModifiedScale() override; - void testSelect(Selector& selector, SelectionTest& test); + void testSelect(Selector& selector, SelectionTest& test) override; void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override; void renderWireframe(RenderableCollector& collector, const VolumeTest& volume) const override; @@ -46,7 +46,7 @@ class NullModelNode : } // Bounded implementation - virtual const AABB& localAABB() const; + virtual const AABB& localAABB() const override; }; } // namespace model diff --git a/radiant/ui/mousetool/BindToolDialog.cpp b/radiant/ui/mousetool/BindToolDialog.cpp index 4727e884ba..6d74fe5af9 100644 --- a/radiant/ui/mousetool/BindToolDialog.cpp +++ b/radiant/ui/mousetool/BindToolDialog.cpp @@ -13,8 +13,6 @@ namespace ui namespace { - const int BINDTOOLDIALOG_DEFAULT_SIZE_X = 300; - const int BINDTOOLDIALOG_DEFAULT_SIZE_Y = 250; const char* const TOOLMAPPING_WINDOW_TITLE = N_("Select new Binding: %s"); } diff --git a/radiant/xyview/XYWnd.h b/radiant/xyview/XYWnd.h index 48f919bf65..a0c21b2d26 100644 --- a/radiant/xyview/XYWnd.h +++ b/radiant/xyview/XYWnd.h @@ -116,7 +116,7 @@ class XYWnd : void positionView(const Vector3& position); const Vector3& getOrigin(); void setOrigin(const Vector3& origin); - void scroll(int x, int y); + void scroll(int x, int y) override; Vector4 getWindowCoordinates(); void draw(); @@ -125,38 +125,38 @@ class XYWnd : void drawGrid(); Vector3 convertXYToWorld(int x, int y); - void snapToGrid(Vector3& point); + void snapToGrid(Vector3& point) override; void mouseToPoint(int x, int y, Vector3& point); void beginMove(); void endMove(); - void zoomIn(); - void zoomOut(); + void zoomIn() override; + void zoomOut() override; void setActive(bool b); bool isActive() const; - void setCursorType(IOrthoView::CursorType type); + void setCursorType(IOrthoView::CursorType type) override; void updateModelview(); void updateProjection(); virtual void setViewType(EViewType n); - EViewType getViewType() const; + EViewType getViewType() const override; void setScale(float f); - float getScale() const; + float getScale() const override; int getWidth() const; int getHeight() const; // greebo: CameraObserver implementation; gets called when the camera is moved - void cameraMoved(); + void cameraMoved() override; // greebo: This gets called upon scene change - void onSceneGraphChange(); + void onSceneGraphChange() override; protected: // Disconnects all widgets and unsubscribes as observer