Commit df3c45cddb344117449d0cb29f5b51d24720aeca
1 parent
1a27a252
SVACE errors fixed
Change-Id: I0e611e9af67fa110d157da0689eda699cbaa21e4
Showing
3 changed files
with
31 additions
and
24 deletions
examples/reflection-demo/gltf-scene.cpp
| @@ -185,7 +185,7 @@ void glTF::LoadFromFile( const std::string& filename ) | @@ -185,7 +185,7 @@ void glTF::LoadFromFile( const std::string& filename ) | ||
| 185 | } | 185 | } |
| 186 | else | 186 | else |
| 187 | { | 187 | { |
| 188 | - GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(mBuffer.size())); | 188 | + GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(jsonBuffer.size())); |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | // Abort if errors | 191 | // Abort if errors |
| @@ -412,12 +412,18 @@ glTF_Buffer glTF::LoadFile( const std::string& filename ) | @@ -412,12 +412,18 @@ glTF_Buffer glTF::LoadFile( const std::string& filename ) | ||
| 412 | std::vector<unsigned char> buffer; | 412 | std::vector<unsigned char> buffer; |
| 413 | if( fin ) | 413 | if( fin ) |
| 414 | { | 414 | { |
| 415 | - fseek( fin, 0, SEEK_END ); | 415 | + if( fseek( fin, 0, SEEK_END ) ) |
| 416 | + { | ||
| 417 | + return {}; | ||
| 418 | + } | ||
| 416 | auto size = ftell(fin); | 419 | auto size = ftell(fin); |
| 417 | - fseek( fin, 0, SEEK_SET ); | 420 | + if( fseek( fin, 0, SEEK_SET ) ) |
| 421 | + { | ||
| 422 | + return {}; | ||
| 423 | + } | ||
| 418 | buffer.resize(unsigned(size)); | 424 | buffer.resize(unsigned(size)); |
| 419 | auto result = fread( buffer.data(), 1, size_t(size), fin ); | 425 | auto result = fread( buffer.data(), 1, size_t(size), fin ); |
| 420 | - if( result < 0 ) | 426 | + if( result != size_t(size) ) |
| 421 | { | 427 | { |
| 422 | GLTF_LOG("LoadFile: Result: %d", int(result)); | 428 | GLTF_LOG("LoadFile: Result: %d", int(result)); |
| 423 | // return empty buffer | 429 | // return empty buffer |
examples/reflection-demo/pico-json.h
| @@ -132,8 +132,8 @@ public: | @@ -132,8 +132,8 @@ public: | ||
| 132 | object* object_; | 132 | object* object_; |
| 133 | }; | 133 | }; |
| 134 | protected: | 134 | protected: |
| 135 | - int type_; | ||
| 136 | - _storage u_; | 135 | + int type_{}; |
| 136 | + _storage u_ {}; | ||
| 137 | public: | 137 | public: |
| 138 | value(); | 138 | value(); |
| 139 | value(int type, bool); | 139 | value(int type, bool); |
examples/reflection-demo/reflection-example.cpp
| @@ -639,30 +639,31 @@ private: | @@ -639,30 +639,31 @@ private: | ||
| 639 | } | 639 | } |
| 640 | 640 | ||
| 641 | private: | 641 | private: |
| 642 | + | ||
| 642 | Application& mApplication; | 643 | Application& mApplication; |
| 643 | 644 | ||
| 644 | - Layer mLayer3D; | 645 | + Layer mLayer3D{}; |
| 645 | 646 | ||
| 646 | - std::vector<Actor> mActors; | ||
| 647 | - std::vector<CameraActor> mCameras; | ||
| 648 | - std::vector<std::unique_ptr<Model>> mModels; | ||
| 649 | - std::vector<TextureSet> mTextureSets; | 647 | + std::vector<Actor> mActors {}; |
| 648 | + std::vector<CameraActor> mCameras {}; | ||
| 649 | + std::vector<std::unique_ptr<Model>> mModels {}; | ||
| 650 | + std::vector<TextureSet> mTextureSets {}; | ||
| 650 | 651 | ||
| 651 | - Animation mAnimation; | ||
| 652 | - float mMockTime = 0.0f; | ||
| 653 | - float mKFactor = 0.0f; | ||
| 654 | - Property::Index mSunTimeUniformIndex; | ||
| 655 | - Property::Index mSunKFactorUniformIndex; | ||
| 656 | - PanGestureDetector mPanGestureDetector; | 652 | + Animation mAnimation {}; |
| 653 | + float mMockTime { 0.0f }; | ||
| 654 | + float mKFactor { 0.0f }; | ||
| 655 | + Property::Index mSunTimeUniformIndex {}; | ||
| 656 | + Property::Index mSunKFactorUniformIndex {}; | ||
| 657 | + PanGestureDetector mPanGestureDetector {}; | ||
| 657 | 658 | ||
| 658 | - Vector3 mCameraPos; | ||
| 659 | - Vector3 mLightDir; | ||
| 660 | - Timer mTickTimer; | 659 | + Vector3 mCameraPos { Vector3::ZERO }; |
| 660 | + Vector3 mLightDir { Vector3::ZERO }; | ||
| 661 | + Timer mTickTimer {}; | ||
| 661 | 662 | ||
| 662 | - CameraActor mCamera3D; | ||
| 663 | - CameraActor mReflectionCamera3D; | ||
| 664 | - Actor mCenterActor; | ||
| 665 | - Actor mCenterHorizActor; | 663 | + CameraActor mCamera3D {}; |
| 664 | + CameraActor mReflectionCamera3D {}; | ||
| 665 | + Actor mCenterActor {}; | ||
| 666 | + Actor mCenterHorizActor {}; | ||
| 666 | }; | 667 | }; |
| 667 | 668 | ||
| 668 | int DALI_EXPORT_API main( int argc, char **argv ) | 669 | int DALI_EXPORT_API main( int argc, char **argv ) |