فهرست منبع

Fixed warnings reported by Xcode.

Lasse Öörni 13 سال پیش
والد
کامیت
a77a685f4c

+ 0 - 1
Engine/Core/Profiler.cpp

@@ -106,7 +106,6 @@ void Profiler::GetData(ProfilerBlock* block, String& output, unsigned depth, uns
     char line[LINE_MAX_LENGTH];
     char indentedName[LINE_MAX_LENGTH];
     
-    unsigned frames = Max(totalFrames_, 1);
     unsigned intervalFrames = Max(intervalFrames_, 1);
     
     if (depth >= maxDepth)

+ 5 - 6
Engine/Graphics/BillboardSet.cpp

@@ -52,19 +52,19 @@ OBJECTTYPESTATIC(BillboardSet);
 
 BillboardSet::BillboardSet(Context* context) :
     Drawable(context),
-    geometry_(new Geometry(context)),
-    vertexBuffer_(new VertexBuffer(context_)),
-    indexBuffer_(new IndexBuffer(context_)),
     animationLodBias_(1.0f),
     animationLodTimer_(0.0f),
     relative_(true),
     scaled_(true),
     sorted_(false),
+    geometry_(new Geometry(context)),
+    vertexBuffer_(new VertexBuffer(context_)),
+    indexBuffer_(new IndexBuffer(context_)),
     bufferSizeDirty_(true),
     bufferDirty_(true),
     forceUpdate_(false),
-    previousOffset_(Vector3::ZERO),
-    sortFrameNumber_(0)
+    sortFrameNumber_(0),
+    previousOffset_(Vector3::ZERO)
 {
     drawableFlags_ = DRAWABLE_GEOMETRY;
     
@@ -415,7 +415,6 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
     if (sorted_)
         Sort(sortedBillboards_.Begin(), sortedBillboards_.End(), CompareBillboards);
     
-    Graphics* graphics = vertexBuffer_->GetGraphics();
     float* dest = (float*)vertexBuffer_->Lock(0, enabledBillboards * 4, true);
     if (!dest)
         return;

+ 0 - 3
Engine/Graphics/Drawable.cpp

@@ -353,8 +353,5 @@ void Drawable::AddToOctree()
 void Drawable::RemoveFromOctree()
 {
     if (octant_)
-    {
-        Octree* octree = octant_->GetRoot();
         octant_->RemoveDrawable(this);
-    }
 }

+ 2 - 2
Engine/Graphics/Geometry.cpp

@@ -41,8 +41,8 @@ Geometry::Geometry(Context* context) :
     indexCount_(0),
     vertexStart_(0),
     vertexCount_(0),
-    lodDistance_(0.0f),
-    positionBufferIndex_(M_MAX_UNSIGNED)
+    positionBufferIndex_(M_MAX_UNSIGNED),
+    lodDistance_(0.0f)
 {
     SetNumVertexBuffers(1);
 }

+ 3 - 3
Engine/Graphics/OctreeQuery.h

@@ -177,10 +177,10 @@ public:
         float maxDistance = M_INFINITY, unsigned char drawableFlags = DRAWABLE_ANY, unsigned viewMask = DEFAULT_VIEWMASK) :
         result_(result),
         ray_(ray),
-        level_(level),
-        maxDistance_(maxDistance),
         drawableFlags_(drawableFlags),
-        viewMask_(viewMask)
+        viewMask_(viewMask),
+        maxDistance_(maxDistance),
+        level_(level)
     {
     }
     

+ 2 - 2
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -146,9 +146,9 @@ Graphics::Graphics(Context* context_) :
     numPrimitives_(0),
     numBatches_(0),
     maxScratchBufferRequest_(0),
-    defaultTextureFilterMode_(FILTER_BILINEAR),
     shadowMapFormat_(GL_DEPTH_COMPONENT16),
-    hiresShadowMapFormat_(GL_DEPTH_COMPONENT24)
+    hiresShadowMapFormat_(GL_DEPTH_COMPONENT24),
+    defaultTextureFilterMode_(FILTER_BILINEAR)
 {
     SetTextureUnitMappings();
     ResetCachedState();

+ 2 - 2
Engine/Graphics/OpenGL/OGLGraphicsImpl.h

@@ -65,9 +65,9 @@ struct FrameBufferObject
 {
     FrameBufferObject() :
         fbo_(0),
+        depthAttachment_(0),
         readBuffers_(M_MAX_UNSIGNED),
-        drawBuffers_(M_MAX_UNSIGNED),
-        depthAttachment_(0)
+        drawBuffers_(M_MAX_UNSIGNED)
     {
         for (unsigned i = 0; i < MAX_RENDERTARGETS; ++i)
             colorAttachments_[i] = 0;

+ 3 - 3
Engine/Graphics/Skeleton.h

@@ -40,12 +40,12 @@ struct Bone
     /// Construct with defaults.
     Bone() :
         parentIndex_(0),
-        collisionMask_(0),
-        radius_(0.0f),
         initialPosition_(Vector3::ZERO),
         initialRotation_(Quaternion::IDENTITY),
         initialScale_(Vector3::ONE),
-        animated_(true)
+        animated_(true),
+        collisionMask_(0),
+        radius_(0.0f)
     {
     }
     

+ 1 - 1
Engine/IO/FileSystem.cpp

@@ -524,7 +524,7 @@ void FileSystem::ScanDirInternal(Vector<String>& result, String path, const Stri
     dir = opendir(GetNativePath(path).CString());
     if (dir)
     {
-        while (de = readdir(dir))
+        while ((de = readdir(dir)))
         {
             /// \todo Filename may be unnormalized Unicode on Mac OS X. Re-normalize as necessary
             String fileName(de->d_name);

+ 1 - 0
Engine/IO/FileWatcher.cpp

@@ -87,6 +87,7 @@ bool FileWatcher::StartWatching(const String& pathName, bool watchSubDirs)
 #else
     /// \todo Implement on Unix-like systems
     LOGERROR("FileWatcher not implemented, can not start watching path " + pathName);
+    return false;
 #endif
 }
 

+ 1 - 2
Engine/Network/Connection.cpp

@@ -61,8 +61,8 @@ OBJECTTYPESTATIC(Connection);
 
 Connection::Connection(Context* context, bool isClient, kNet::SharedPtr<kNet::MessageConnection> connection) :
     Object(context),
-    connection_(connection),
     position_(Vector3::ZERO),
+    connection_(connection),
     isClient_(isClient),
     connectPending_(false),
     sceneLoaded_(false),
@@ -497,7 +497,6 @@ void Connection::ProcessSceneUpdate(int msgID, MemoryBuffer& msg)
             
             // Read initial user variables
             unsigned numVars = msg.ReadVLE();
-            const VariantMap& vars = node->GetVars();
             while (numVars)
             {
                 ShortStringHash key = msg.ReadShortStringHash();

+ 1 - 1
Engine/Scene/Scene.cpp

@@ -51,9 +51,9 @@ Scene::Scene(Context* context) :
     replicatedComponentID_(FIRST_REPLICATED_ID),
     localNodeID_(FIRST_LOCAL_ID),
     localComponentID_(FIRST_LOCAL_ID),
+    checksum_(0),
     smoothingConstant_(DEFAULT_SMOOTHING_CONSTANT),
     snapThreshold_(DEFAULT_SNAP_THRESHOLD),
-    checksum_(0),
     active_(true),
     asyncLoading_(false),
     threadedUpdate_(false)

+ 2 - 2
Engine/Scene/Scene.h

@@ -211,10 +211,10 @@ private:
     Mutex sceneMutex_;
     /// Next free non-local node ID.
     unsigned replicatedNodeID_;
-    /// Next free local node ID.
-    unsigned localNodeID_;
     /// Next free non-local component ID.
     unsigned replicatedComponentID_;
+    /// Next free local node ID.
+    unsigned localNodeID_;
     /// Next free local component ID.
     unsigned localComponentID_;
     /// Scene source file checksum.

+ 0 - 3
Engine/Script/Addons.cpp

@@ -32,9 +32,6 @@
 // Adapted from Angelscript's scriptarray & scriptstdstring add-ons, but with garbage collection disabled
 using namespace std;
 
-static void RegisterScriptArray_Native(asIScriptEngine *engine);
-static void RegisterScriptArray_Generic(asIScriptEngine *engine);
-
 /// %Script array buffer.
 struct SArrayBuffer
 {

+ 2 - 2
Engine/UI/FileSelector.cpp

@@ -52,8 +52,8 @@ OBJECTTYPESTATIC(FileSelector);
 
 FileSelector::FileSelector(Context* context) :
     Object(context),
-    ignoreEvents_(false),
-    directoryMode_(false)
+    directoryMode_(false),
+    ignoreEvents_(false)
 {
     window_ = new Window(context_);
     window_->SetLayout(LM_VERTICAL);

+ 1 - 2
Engine/UI/LineEdit.cpp

@@ -399,8 +399,7 @@ void LineEdit::OnChar(unsigned c, int buttons, int qualifiers)
     {
         String charStr;
         charStr.AppendUTF8(c);
-        unsigned utf8Length = line_.LengthUTF8();
-        
+
         if (!text_->GetSelectionLength())
         {
             if (cursorPosition_ == line_.LengthUTF8())

+ 1 - 1
Engine/UI/UI.cpp

@@ -727,7 +727,7 @@ void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
     mouseButtons_ = eventData[P_BUTTONS].GetInt();
     qualifiers_ = eventData[P_QUALIFIERS].GetInt();
     
-    if (cursor_ && (cursor_->IsVisible()) || (dragElement_))
+    if (cursor_ && (cursor_->IsVisible() || dragElement_))
     {
         IntVector2 pos = cursor_->GetPosition();
         

+ 3 - 4
Engine/UI/UIElement.cpp

@@ -78,15 +78,15 @@ UIElement::UIElement(Context* context) :
     parent_(0),
     clipBorder_(IntRect::ZERO),
     priority_(0),
-    opacity_(1.0f),
     bringToFront_(false),
     bringToBack_(true),
     clipChildren_(false),
+    sortChildren_(true),
     active_(false),
-    focusMode_(FM_NOTFOCUSABLE),
     selected_(false),
     visible_(true),
     hovering_(false),
+    focusMode_(FM_NOTFOCUSABLE),
     dragDropMode_(DD_DISABLED),
     layoutMode_(LM_FREE),
     layoutSpacing_(0),
@@ -101,11 +101,11 @@ UIElement::UIElement(Context* context) :
     childOffset_(IntVector2::ZERO),
     horizontalAlignment_(HA_LEFT),
     verticalAlignment_(VA_TOP),
+    opacity_(1.0f),
     positionDirty_(true),
     opacityDirty_(true),
     derivedColorDirty_(true),
     sortOrderDirty_(false),
-    sortChildren_(true),
     colorGradient_(false)
 {
 }
@@ -691,7 +691,6 @@ void UIElement::UpdateLayout()
     if (layoutMode_ == LM_VERTICAL)
     {
         int minChildWidth = 0;
-        int maxChildWidth = M_MAX_INT;
         
         for (unsigned i = 0; i < children_.Size(); ++i)
         {