Browse Source

Fix more header warnings that could leak to an Urho3D application using maximum MSVC warning level.

Lasse Öörni 11 years ago
parent
commit
5f0ed3fcf8

+ 1 - 1
Source/Engine/Core/WorkQueue.cpp

@@ -323,7 +323,7 @@ void WorkQueue::PurgeCompleted(unsigned priority)
 
 void WorkQueue::PurgePool()
 {
-    unsigned int currentSize = poolItems_.Size();
+    unsigned currentSize = poolItems_.Size();
     int difference = lastSize_ - currentSize;
 
     // Difference tolerance, should be fairly significant to reduce the pool size.

+ 13 - 0
Source/Engine/Graphics/Drawable.cpp

@@ -124,6 +124,10 @@ void Drawable::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryRe
     }
 }
 
+void Drawable::Update(const FrameInfo& frame)
+{
+}
+
 void Drawable::UpdateBatches(const FrameInfo& frame)
 {
     const BoundingBox& worldBoundingBox = GetWorldBoundingBox();
@@ -143,6 +147,10 @@ void Drawable::UpdateBatches(const FrameInfo& frame)
         lodDistance_ = newLodDistance;
 }
 
+void Drawable::UpdateGeometry(const FrameInfo& frame)
+{
+}
+
 Geometry* Drawable::GetLodGeometry(unsigned batchIndex, unsigned level)
 {
     // By default return the visible batch geometry
@@ -152,6 +160,11 @@ Geometry* Drawable::GetLodGeometry(unsigned batchIndex, unsigned level)
         return 0;
 }
 
+bool Drawable::DrawOcclusion(OcclusionBuffer* buffer)
+{
+    return true;
+}
+
 void Drawable::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
 {
     if (debug && IsEnabledEffective())

+ 3 - 3
Source/Engine/Graphics/Drawable.h

@@ -120,11 +120,11 @@ public:
     /// Process octree raycast. May be called from a worker thread.
     virtual void ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results);
     /// Update before octree reinsertion. Is called from a worker thread.
-    virtual void Update(const FrameInfo& frame) {}
+    virtual void Update(const FrameInfo& frame);
     /// Calculate distance and prepare batches for rendering. May be called from worker thread(s), possibly re-entrantly.
     virtual void UpdateBatches(const FrameInfo& frame);
     /// Prepare geometry for rendering.
-    virtual void UpdateGeometry(const FrameInfo& frame) {}
+    virtual void UpdateGeometry(const FrameInfo& frame);
     /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
     virtual UpdateGeometryType GetUpdateGeometryType() { return UPDATE_NONE; }
     /// Return the geometry for a specific LOD level.
@@ -132,7 +132,7 @@ public:
     /// Return number of occlusion geometry triangles.
     virtual unsigned GetNumOccluderTriangles() { return 0; }
     /// Draw to occlusion buffer. Return true if did not run out of triangles.
-    virtual bool DrawOcclusion(OcclusionBuffer* buffer) { return true; }
+    virtual bool DrawOcclusion(OcclusionBuffer* buffer);
     /// Visualize the component as debug geometry.
     virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest);
     

+ 6 - 0
Source/Engine/Graphics/OctreeQuery.h

@@ -236,6 +236,12 @@ public:
     float maxDistance_;
     /// Raycast detail level.
     RayQueryLevel level_;
+    
+private:
+    /// Prevent copy construction.
+    RayOctreeQuery(const RayOctreeQuery& rhs);
+    /// Prevent assignment.
+    RayOctreeQuery& operator = (const RayOctreeQuery& rhs);
 };
 
 }

+ 9 - 0
Source/Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -592,6 +592,10 @@ void Graphics::SetSRGB(bool enable)
     }
 }
 
+void Graphics::SetFlushGPU(bool enable)
+{
+}
+
 void Graphics::SetOrientations(const String& orientations)
 {
     orientations_ = orientations.Trimmed();
@@ -2115,6 +2119,11 @@ RenderSurface* Graphics::GetRenderTarget(unsigned index) const
     return index < MAX_RENDERTARGETS ? renderTargets_[index] : 0;
 }
 
+unsigned Graphics::GetStreamFrequency(unsigned index) const
+{
+    return 0;
+}
+
 IntVector2 Graphics::GetRenderTargetDimensions() const
 {
     int width, height;

+ 2 - 2
Source/Engine/Graphics/OpenGL/OGLGraphics.h

@@ -101,7 +101,7 @@ public:
     /// Set whether the main window uses sRGB conversion on write.
     void SetSRGB(bool enable);
     /// Set whether to flush the GPU command buffer to prevent multiple frames being queued and uneven frame timesteps. Not yet implemented on OpenGL.
-    void SetFlushGPU(bool enable) {}
+    void SetFlushGPU(bool enable);
     /// Set allowed screen orientations as a space-separated list of "LandscapeLeft", "LandscapeRight", "Portrait" and "PortraitUpsideDown". Affects currently only iOS platform.
     void SetOrientations(const String& orientations);
     /// Toggle between full screen and windowed mode. Return true if successful.
@@ -370,7 +370,7 @@ public:
     /// Return whether a custom clipping plane is in use.
     bool GetUseClipPlane() const { return useClipPlane_; }
     /// Return stream frequency by vertex buffer index. Always returns 0 on OpenGL.
-    unsigned GetStreamFrequency(unsigned index) const { return 0; }
+    unsigned GetStreamFrequency(unsigned index) const;
     /// Return rendertarget width and height.
     IntVector2 GetRenderTargetDimensions() const;
     /// Return force Shader Model 2 flag. Always false on OpenGL.

+ 5 - 0
Source/Engine/Network/HttpRequest.cpp

@@ -248,6 +248,11 @@ unsigned HttpRequest::Read(void* dest, unsigned size)
     return totalRead;
 }
 
+unsigned HttpRequest::Seek(unsigned position)
+{
+    return position_;
+}
+
 String HttpRequest::GetError() const
 {
     MutexLock lock(mutex_);

+ 1 - 1
Source/Engine/Network/HttpRequest.h

@@ -55,7 +55,7 @@ public:
     /// Read response data from the HTTP connection and return number of bytes actually read. While the connection is open, will block while trying to read the specified size. To avoid blocking, only read up to as many bytes as GetAvailableSize() returns.
     virtual unsigned Read(void* dest, unsigned size);
     /// Set position from the beginning of the stream. Not supported.
-    virtual unsigned Seek(unsigned position) { return position_; }
+    virtual unsigned Seek(unsigned position);
     
     /// Return URL used in the request.
     const String& GetURL() const { return url_; }

+ 8 - 0
Source/Engine/Physics/PhysicsWorld.cpp

@@ -219,6 +219,14 @@ void PhysicsWorld::reportErrorWarning(const char* warningString)
     LOGWARNING("Physics: " + String(warningString));
 }
 
+void PhysicsWorld::drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color)
+{
+}
+
+void PhysicsWorld::draw3dText(const btVector3& location, const char* textString)
+{ 
+}
+
 void PhysicsWorld::Update(float timeStep)
 {
     PROFILE(UpdatePhysics);

+ 2 - 2
Source/Engine/Physics/PhysicsWorld.h

@@ -116,9 +116,9 @@ public:
     /// Log warning from the physics engine.
     virtual void reportErrorWarning(const char* warningString);
     /// Draw a physics debug contact point. Not implemented.
-    virtual void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color) {}
+    virtual void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color);
     /// Draw physics debug 3D text. Not implemented.
-    virtual void draw3dText(const btVector3& location,const char* textString) {}
+    virtual void draw3dText(const btVector3& location,const char* textString);
     /// Set debug draw flags.
     virtual void setDebugMode(int debugMode) { debugMode_ = debugMode; }
     /// Return debug draw flags.

+ 3 - 3
Source/Engine/Resource/Decompress.cpp

@@ -291,8 +291,8 @@ misrepresented as being the original software.
 
 #define _CLAMP_(X,Xmin,Xmax) ( (X)<(Xmax) ? ( (X)<(Xmin)?(Xmin):(X) ) : (Xmax) )
 
-unsigned int ETC_FLIP =  0x01000000;
-unsigned int ETC_DIFF = 0x02000000;
+unsigned ETC_FLIP =  0x01000000;
+unsigned ETC_DIFF = 0x02000000;
 const int mod[8][4]={{2, 8,-2,-8},
                     {5, 17, -5, -17},
                     {9, 29, -9, -29},
@@ -819,7 +819,7 @@ void DecompressImagePVRTC(unsigned char* dest, const void *blocks, int width, in
     
     int Mod, DoPT;
     
-    unsigned int uPosition;
+    unsigned uPosition;
     
     // Local neighbourhood of blocks
     AMTC_BLOCK_STRUCT *pBlocks[2][2];

+ 2 - 2
Source/Engine/Resource/ResourceCache.cpp

@@ -86,7 +86,7 @@ ResourceCache::~ResourceCache()
     backgroundLoader_.Reset();
 }
 
-bool ResourceCache::AddResourceDir(const String& pathName, unsigned int priority)
+bool ResourceCache::AddResourceDir(const String& pathName, unsigned priority)
 {
     MutexLock lock(resourceMutex_);
     
@@ -125,7 +125,7 @@ bool ResourceCache::AddResourceDir(const String& pathName, unsigned int priority
     return true;
 }
 
-void ResourceCache::AddPackageFile(PackageFile* package, unsigned int priority)
+void ResourceCache::AddPackageFile(PackageFile* package, unsigned priority)
 {
     MutexLock lock(resourceMutex_);
     

+ 3 - 3
Source/Engine/Resource/ResourceCache.h

@@ -36,7 +36,7 @@ class FileWatcher;
 class PackageFile;
 
 /// Sets to priority so that a package or file is pushed to the end of the vector.
-static const unsigned int PRIORITY_LAST = -1;
+static const unsigned PRIORITY_LAST = 0xffffffff;
 
 /// Container of resources with specific type.
 struct ResourceGroup
@@ -68,9 +68,9 @@ public:
     virtual ~ResourceCache();
     
     /// Add a resource load directory. Optional priority parameter which will control search order.
-    bool AddResourceDir(const String& pathName, unsigned int priority = PRIORITY_LAST );
+    bool AddResourceDir(const String& pathName, unsigned priority = PRIORITY_LAST );
     /// Add a package file for loading resources from. Optional priority parameter which will control search order.
-    void AddPackageFile(PackageFile* package, unsigned int priority = PRIORITY_LAST );
+    void AddPackageFile(PackageFile* package, unsigned priority = PRIORITY_LAST );
     /// Add a manually created resource. Must be uniquely named.
     bool AddManualResource(Resource* resource);
     /// Remove a resource load directory.

+ 1 - 1
Source/Engine/Scene/Animatable.cpp

@@ -320,7 +320,7 @@ void Animatable::OnObjectAnimationRemoved(ObjectAnimation* objectAnimation)
             names.Push(i->first_);
     }
 
-    for (unsigned int i = 0; i < names.Size(); ++i)
+    for (unsigned i = 0; i < names.Size(); ++i)
         SetObjectAttributeAnimation(names[i], 0, WM_LOOP, 1.0f);
 }
 

+ 20 - 0
Source/Engine/Scene/Component.cpp

@@ -82,6 +82,14 @@ void Component::MarkNetworkUpdate()
     }
 }
 
+void Component::GetDependencyNodes(PODVector<Node*>& dest)
+{
+}
+
+void Component::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
+{
+}
+
 void Component::SetEnabled(bool enable)
 {
     if (enable != enabled_)
@@ -205,6 +213,18 @@ void Component::OnAttributeAnimationRemoved()
         UnsubscribeFromEvent(GetScene(), E_ATTRIBUTEANIMATIONUPDATE);
 }
 
+void Component::OnNodeSet(Node* node)
+{
+}
+
+void Component::OnMarkedDirty(Node* node)
+{
+}
+
+void Component::OnNodeSetEnabled(Node* node)
+{
+}
+
 void Component::SetID(unsigned id)
 {
     id_ = id;

+ 5 - 5
Source/Engine/Scene/Component.h

@@ -57,9 +57,9 @@ public:
     /// Mark for attribute check on the next network update.
     virtual void MarkNetworkUpdate();
     /// Return the depended on nodes to order network updates.
-    virtual void GetDependencyNodes(PODVector<Node*>& dest) {};
+    virtual void GetDependencyNodes(PODVector<Node*>& dest);
     /// Visualize the component as debug geometry.
-    virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest) {};
+    virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest);
 
     /// Set enabled/disabled state.
     void SetEnabled(bool enable);
@@ -98,11 +98,11 @@ protected:
     /// Handle attribute animation removed.
     virtual void OnAttributeAnimationRemoved();
     /// Handle scene node being assigned at creation.
-    virtual void OnNodeSet(Node* node) {};
+    virtual void OnNodeSet(Node* node);
     /// Handle scene node transform dirtied.
-    virtual void OnMarkedDirty(Node* node) {};
+    virtual void OnMarkedDirty(Node* node);
     /// Handle scene node enabled status changing.
-    virtual void OnNodeSetEnabled(Node* node) {};
+    virtual void OnNodeSetEnabled(Node* node);
     /// Set ID. Called by Scene.
     void SetID(unsigned id);
     /// Set scene node. Called by Node when creating the component.

+ 16 - 0
Source/Engine/Scene/LogicComponent.cpp

@@ -50,6 +50,22 @@ void LogicComponent::OnSetEnabled()
     UpdateEventSubscription();
 }
 
+void LogicComponent::Update(float timeStep)
+{
+}
+
+void LogicComponent::PostUpdate(float timeStep)
+{
+}
+
+void LogicComponent::FixedUpdate(float timeStep)
+{
+}
+
+void LogicComponent::FixedPostUpdate(float timeStep)
+{
+}
+
 void LogicComponent::SetUpdateEventMask(unsigned char mask)
 {
     if (updateEventMask_ != mask)

+ 4 - 4
Source/Engine/Scene/LogicComponent.h

@@ -55,13 +55,13 @@ class URHO3D_API LogicComponent : public Component
     /// Called when the component is detached from a scene node, usually on destruction.
     virtual void Stop() {}
     /// Called on scene update, variable timestep.
-    virtual void Update(float timeStep) {}
+    virtual void Update(float timeStep);
     /// Called on scene post-update, variable timestep.
-    virtual void PostUpdate(float timeStep) {}
+    virtual void PostUpdate(float timeStep);
     /// Called on physics update, fixed timestep.
-    virtual void FixedUpdate(float timeStep) {}
+    virtual void FixedUpdate(float timeStep);
     /// Called on physics post-update, fixed timestep.
-    virtual void FixedPostUpdate(float timeStep) {}
+    virtual void FixedPostUpdate(float timeStep);
     
     /// Set what update events should be subscribed to. Use this for optimization: by default all are in use. Note that this is not an attribute and is not saved or network-serialized, therefore it should always be called eg. in the subclass constructor.
     void SetUpdateEventMask(unsigned char mask);

+ 4 - 0
Source/Engine/Scene/ValueAnimationInfo.cpp

@@ -103,6 +103,10 @@ Object* ValueAnimationInfo::GetTarget() const
     return target_;
 }
 
+void ValueAnimationInfo::ApplyValue(const Variant& newValue)
+{
+}
+
 float ValueAnimationInfo::CalculateScaledTime(float currentTime, bool& finished) const
 {
     float beginTime = animation_->GetBeginTime();

+ 1 - 1
Source/Engine/Scene/ValueAnimationInfo.h

@@ -63,7 +63,7 @@ public:
 
 protected:
     /// Apply new animation value to the target object. Called by Update().
-    virtual void ApplyValue(const Variant& newValue) {}
+    virtual void ApplyValue(const Variant& newValue);
     /// Calculate scaled time.
     float CalculateScaledTime(float currentTime, bool& finished) const;
     /// Return event frames.

+ 4 - 0
Source/Engine/Script/APITemplates.h

@@ -42,6 +42,10 @@
 #include <angelscript.h>
 #include <cstring>
 
+#ifdef _MSC_VER
+#pragma warning(disable:4505)
+#endif
+
 namespace Urho3D
 {
 

+ 1 - 1
Source/Engine/Script/Addons.cpp

@@ -2262,7 +2262,7 @@ static void DestructString(String* ptr)
     ptr->~String();
 }
 
-static char* StringCharAt(unsigned int i, String& str)
+static char* StringCharAt(unsigned i, String& str)
 {
     if (i >= str.Length())
     {

+ 46 - 0
Source/Engine/UI/UIElement.cpp

@@ -485,6 +485,52 @@ void UIElement::OnHover(const IntVector2& position, const IntVector2& screenPosi
     hovering_ = true;
 }
 
+void UIElement::OnClickBegin(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor)
+{
+}
+
+void UIElement::OnClickEnd(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor, UIElement* beginElement)
+{
+}
+
+void UIElement::OnDoubleClick(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor)
+{
+}
+
+void UIElement::OnDragBegin(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor)
+{
+}
+
+void UIElement::OnDragMove(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor)
+{
+}
+
+void UIElement::OnDragEnd(const IntVector2& position, const IntVector2& screenPosition, Cursor* cursor)
+{
+}
+
+bool UIElement::OnDragDropTest(UIElement* source)
+{
+    return true;
+}
+
+bool UIElement::OnDragDropFinish(UIElement* source)
+{
+    return true;
+}
+
+void UIElement::OnWheel(int delta, int buttons, int qualifiers)
+{
+}
+
+void UIElement::OnKey(int key, int buttons, int qualifiers)
+{
+}
+
+void UIElement::OnTextInput(const String& text, int buttons, int qualifiers)
+{
+}
+
 bool UIElement::LoadXML(Deserializer& source)
 {
     SharedPtr<XMLFile> xml(new XMLFile(context_));

+ 11 - 11
Source/Engine/UI/UIElement.h

@@ -148,27 +148,27 @@ public:
     /// React to mouse hover.
     virtual void OnHover(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse click begin.
-    virtual void OnClickBegin(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor) {}
+    virtual void OnClickBegin(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse click end.
-    virtual void OnClickEnd(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor, UIElement* beginElement) {}
+    virtual void OnClickEnd(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor, UIElement* beginElement);
     /// React to double mouse click.
-    virtual void OnDoubleClick(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor) {}
+    virtual void OnDoubleClick(const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse drag begin.
-    virtual void OnDragBegin(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor) {}
+    virtual void OnDragBegin(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse drag motion.
-    virtual void OnDragMove(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor) {}
+    virtual void OnDragMove(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse drag end.
-    virtual void OnDragEnd(const IntVector2& position, const IntVector2& screenPosition, Cursor* cursor) {}
+    virtual void OnDragEnd(const IntVector2& position, const IntVector2& screenPosition, Cursor* cursor);
     /// React to drag and drop test. Return true to signal that the drop is acceptable.
-    virtual bool OnDragDropTest(UIElement* source) { return true; }
+    virtual bool OnDragDropTest(UIElement* source);
     /// React to drag and drop finish. Return true to signal that the drop was accepted.
-    virtual bool OnDragDropFinish(UIElement* source) { return true; }
+    virtual bool OnDragDropFinish(UIElement* source);
     /// React to mouse wheel.
-    virtual void OnWheel(int delta, int buttons, int qualifiers) {}
+    virtual void OnWheel(int delta, int buttons, int qualifiers);
     /// React to a key press.
-    virtual void OnKey(int key, int buttons, int qualifiers) {}
+    virtual void OnKey(int key, int buttons, int qualifiers);
     /// React to text input event.
-    virtual void OnTextInput(const String& text, int buttons, int qualifiers) {}
+    virtual void OnTextInput(const String& text, int buttons, int qualifiers);
     /// React to resize.
     virtual void OnResize() {}
     /// React to position change.