From df3c45cddb344117449d0cb29f5b51d24720aeca Mon Sep 17 00:00:00 2001 From: "adam.b" Date: Mon, 30 Mar 2020 15:18:46 +0100 Subject: [PATCH] SVACE errors fixed Change-Id: I0e611e9af67fa110d157da0689eda699cbaa21e4 --- examples/reflection-demo/gltf-scene.cpp | 14 +++++++--- examples/reflection-demo/pico-json.h | 4 +-- examples/reflection-demo/reflection-example.cpp | 37 +++++++++++++------------ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/examples/reflection-demo/gltf-scene.cpp b/examples/reflection-demo/gltf-scene.cpp index 424ffa2..46e39cf 100644 --- a/examples/reflection-demo/gltf-scene.cpp +++ b/examples/reflection-demo/gltf-scene.cpp @@ -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 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 diff --git a/examples/reflection-demo/pico-json.h b/examples/reflection-demo/pico-json.h index c1cde44..e4f28e9 100644 --- a/examples/reflection-demo/pico-json.h +++ b/examples/reflection-demo/pico-json.h @@ -132,8 +132,8 @@ public: object* object_; }; protected: - int type_; - _storage u_; + int type_{}; + _storage u_ {}; public: value(); value(int type, bool); diff --git a/examples/reflection-demo/reflection-example.cpp b/examples/reflection-demo/reflection-example.cpp index c0eb880..3bf189f 100644 --- a/examples/reflection-demo/reflection-example.cpp +++ b/examples/reflection-demo/reflection-example.cpp @@ -639,30 +639,31 @@ private: } private: + Application& mApplication; - Layer mLayer3D; + Layer mLayer3D{}; - std::vector mActors; - std::vector mCameras; - std::vector> mModels; - std::vector mTextureSets; + std::vector mActors {}; + std::vector mCameras {}; + std::vector> mModels {}; + std::vector 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 ) -- 2.7.4