SVACE errors fixed 52/229252/1
authoradam.b <adam.b@samsung.com>
Mon, 30 Mar 2020 14:18:46 +0000 (15:18 +0100)
committeradam.b <adam.b@samsung.com>
Mon, 30 Mar 2020 14:22:25 +0000 (15:22 +0100)
Change-Id: I0e611e9af67fa110d157da0689eda699cbaa21e4

examples/reflection-demo/gltf-scene.cpp
examples/reflection-demo/pico-json.h
examples/reflection-demo/reflection-example.cpp

index 424ffa2..46e39cf 100644 (file)
@@ -185,7 +185,7 @@ void glTF::LoadFromFile( const std::string& filename )
   }
   else
   {
-    GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(mBuffer.size()));
+    GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(jsonBuffer.size()));
   }
 
   // Abort if errors
@@ -412,12 +412,18 @@ glTF_Buffer glTF::LoadFile( const std::string& filename )
   std::vector<unsigned char> buffer;
   if( fin )
   {
-    fseek( fin, 0, SEEK_END );
+    if( fseek( fin, 0, SEEK_END ) )
+    {
+      return {};
+    }
     auto size = ftell(fin);
-    fseek( fin, 0, SEEK_SET );
+    if( fseek( fin, 0, SEEK_SET ) )
+    {
+      return {};
+    }
     buffer.resize(unsigned(size));
     auto result = fread( buffer.data(), 1, size_t(size), fin );
-    if( result < 0 )
+    if( result != size_t(size) )
     {
       GLTF_LOG("LoadFile: Result: %d", int(result));
       // return empty buffer
index c1cde44..e4f28e9 100644 (file)
@@ -132,8 +132,8 @@ public:
     object* object_;
   };
 protected:
-  int type_;
-  _storage u_;
+  int type_{};
+  _storage u_ {};
 public:
   value();
   value(int type, bool);
index c0eb880..3bf189f 100644 (file)
@@ -639,30 +639,31 @@ private:
   }
 
 private:
+
   Application&  mApplication;
 
-  Layer mLayer3D;
+  Layer mLayer3D{};
 
-  std::vector<Actor>                      mActors;
-  std::vector<CameraActor>                mCameras;
-  std::vector<std::unique_ptr<Model>>     mModels;
-  std::vector<TextureSet>                 mTextureSets;
+  std::vector<Actor>                      mActors {};
+  std::vector<CameraActor>                mCameras {};
+  std::vector<std::unique_ptr<Model>>     mModels {};
+  std::vector<TextureSet>                 mTextureSets {};
 
-  Animation mAnimation;
-  float mMockTime = 0.0f;
-  float mKFactor = 0.0f;
-  Property::Index mSunTimeUniformIndex;
-  Property::Index mSunKFactorUniformIndex;
-  PanGestureDetector mPanGestureDetector;
+  Animation mAnimation {};
+  float mMockTime { 0.0f };
+  float mKFactor { 0.0f };
+  Property::Index mSunTimeUniformIndex {};
+  Property::Index mSunKFactorUniformIndex {};
+  PanGestureDetector mPanGestureDetector {};
 
-  Vector3 mCameraPos;
-  Vector3 mLightDir;
-  Timer mTickTimer;
+  Vector3 mCameraPos { Vector3::ZERO };
+  Vector3 mLightDir { Vector3::ZERO };
+  Timer mTickTimer {};
 
-  CameraActor mCamera3D;
-  CameraActor mReflectionCamera3D;
-  Actor mCenterActor;
-  Actor mCenterHorizActor;
+  CameraActor mCamera3D {};
+  CameraActor mReflectionCamera3D {};
+  Actor mCenterActor {};
+  Actor mCenterHorizActor {};
 };
 
 int DALI_EXPORT_API main( int argc, char **argv )