Fix svace/coverity issue at chipmunk app 06/296506/2
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 31 Jul 2023 01:32:04 +0000 (10:32 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 31 Jul 2023 01:33:44 +0000 (10:33 +0900)
Change-Id: Iea8ee57c49c15cf0f27bf165d6078a6a6f1934a5
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
examples/chipmunk-physics/physics-demo-controller.cpp
examples/chipmunk-physics/physics-impl.h

index 2faa3f8..14a9b0f 100644 (file)
@@ -340,10 +340,10 @@ private:
 
   PhysicsImpl   mPhysicsImpl;
   Actor         mPhysicsRoot;
-  cpBody*       mMouseBody;
-  cpBody*       mPickedBody;
-  int           mPickedSavedState;
-  cpConstraint* mPickedConstraint;
+  cpBody*       mMouseBody{nullptr};
+  cpBody*       mPickedBody{nullptr};
+  cpConstraint* mPickedConstraint{nullptr};
+  int           mPickedSavedState = -1; /// 0 : Active, 1 : Sleeping
 
   bool mCtrlDown{false};
   bool mAltDown{false};
index 519a7b9..9420fa4 100644 (file)
@@ -158,7 +158,7 @@ public:
   bool mPhysicsIntegrateState{true};
   bool mPhysicsDebugState{true};
 
-  cpSpace* mSpace;
+  cpSpace* mSpace{nullptr};
   cpShape* mLeftBound{nullptr};
   cpShape* mRightBound{nullptr};
   cpShape* mTopBound{nullptr};
@@ -169,7 +169,7 @@ public:
 
   Dali::Actor mPhysicsRoot;
   Dali::Vector2 mWorldOffset;
-  FrameCallback* mFrameCallback;
+  FrameCallback* mFrameCallback{nullptr};
 };
 
 #endif // DALI_PHYSICS_DEMO_PHYSICS_IMPL_H