Fix various Klocwork errors 35/51635/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 11 Nov 2015 12:32:07 +0000 (12:32 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 11 Nov 2015 12:35:10 +0000 (12:35 +0000)
Change-Id: I34c5e2b4471d9c22fe3596b7c5417371573d84eb

dali-toolkit/internal/controls/bubble-effect/bubble-actor.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/model3d-view/obj-loader.cpp
dali-toolkit/internal/controls/popup/confirmation-popup-impl.h
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/renderers/image/image-renderer.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/feedback/feedback-style.cpp
dali-toolkit/internal/scripting/script-impl.cpp

index 0b3a186..e1ef66c 100644 (file)
@@ -35,7 +35,15 @@ namespace Internal
 
 BubbleActor::BubbleActor( unsigned int numberOfBubble,
                           const Vector2& movementArea)
 
 BubbleActor::BubbleActor( unsigned int numberOfBubble,
                           const Vector2& movementArea)
-: mMovementArea( movementArea ),
+: mActor(),
+  mRenderer(),
+  mMovementArea( movementArea ),
+  mIndicesOffset(),
+  mIndiceStartEndPos(),
+  mIndicesPercentage(),
+  mIndexGravity( Property::INVALID_INDEX ),
+  mIndexDynamicScale( Property::INVALID_INDEX ),
+  mIndexInvertedMovementArea( Property::INVALID_INDEX ),
   mNumBubble( numberOfBubble ),
   mRandomSeed( 0 )
 {
   mNumBubble( numberOfBubble ),
   mRandomSeed( 0 )
 {
index aeb1de2..8b248ce 100644 (file)
@@ -32,16 +32,19 @@ namespace
 {
 struct Vertex
 {
 {
 struct Vertex
 {
-  float index;
-  Dali::Vector2 position;
-  Dali::Vector2 textureCoord;
-
   Vertex()
   Vertex()
-  {}
+  : index( 0.0f ), position(), textureCoord()
+  {
+  }
 
   Vertex( float index, const Dali::Vector2& position, const Dali::Vector2& textureCoord )
   : index( index ), position( position ), textureCoord( textureCoord )
 
   Vertex( float index, const Dali::Vector2& position, const Dali::Vector2& textureCoord )
   : index( index ), position( position ), textureCoord( textureCoord )
-  {}
+  {
+  }
+
+  float index;
+  Dali::Vector2 position;
+  Dali::Vector2 textureCoord;
 };
 
 /**
 };
 
 /**
index f0450f1..396ac48 100644 (file)
@@ -259,7 +259,7 @@ bool ObjLoader::Load(char* objBuffer, std::streampos fileSize, std::string& mate
   std::string line;
   std::getline(ss, line);
 
   std::string line;
   std::getline(ss, line);
 
-   while (std::getline(ss, line))
+  while (std::getline(ss, line))
   {
     std::istringstream isline(line, std::istringstream::in);
     std::string tag;
   {
     std::istringstream isline(line, std::istringstream::in);
     std::string tag;
@@ -419,16 +419,8 @@ bool ObjLoader::Load(char* objBuffer, std::streampos fileSize, std::string& mate
 
   if (iniObj)
   {
 
   if (iniObj)
   {
-    pntAcum += (int)mPoints.Size();
-    texAcum += (int)mTextures.Size();
-    nrmAcum += (int)mNormals.Size();
-
     CenterAndScale(true, mPoints);
     CenterAndScale(true, mPoints);
-
-    face = 0;
-
     mSceneLoaded = true;
     mSceneLoaded = true;
-
     return true;
   }
 
     return true;
   }
 
index 45f23a9..804b93f 100644 (file)
@@ -36,13 +36,8 @@ namespace Toolkit
 namespace Internal
 {
 
 namespace Internal
 {
 
-namespace
-{
-
 #define MAXIMUM_NUMBER_OF_CONTROLS 2
 
 #define MAXIMUM_NUMBER_OF_CONTROLS 2
 
-}
-
 /**
  * ConfirmationPopup implementation class.
  *
 /**
  * ConfirmationPopup implementation class.
  *
index 031f0fa..7a84f4e 100755 (executable)
@@ -221,21 +221,39 @@ Dali::Toolkit::Popup Popup::New()
 
 Popup::Popup()
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
 
 Popup::Popup()
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
-  // Main variables:
+  mTouchedOutsideSignal(),
+  mShowingSignal(),
+  mShownSignal(),
+  mHidingSignal(),
+  mHiddenSignal(),
+  mLayer(),
+  mPopupLayout(),
+  mBacking(),
+  mPreviousFocusedActor(),
+  mTailImage(),
+  mPopupContainer(),
+  mAnimation(),
   mAlterAddedChild( false ),
   mLayoutDirty( true ),
   mAlterAddedChild( false ),
   mLayoutDirty( true ),
+  mAutoHideTimer(),
   mTouchTransparent( false ),
   mTouchTransparent( false ),
-
-  // Property variables:
+  mTitle(),
+  mContent(),
+  mFooter(),
   mDisplayState( Toolkit::Popup::HIDDEN ), // Hidden until shown with SetDisplayState()
   mTailVisible( false ),
   mTailPosition( DEFAULT_TAIL_POSITION ),
   mContextualMode( Toolkit::Popup::NON_CONTEXTUAL ),
   mAnimationDuration( DEFAULT_POPUP_ANIMATION_DURATION ),
   mAnimationMode( Toolkit::Popup::FADE ),
   mDisplayState( Toolkit::Popup::HIDDEN ), // Hidden until shown with SetDisplayState()
   mTailVisible( false ),
   mTailPosition( DEFAULT_TAIL_POSITION ),
   mContextualMode( Toolkit::Popup::NON_CONTEXTUAL ),
   mAnimationDuration( DEFAULT_POPUP_ANIMATION_DURATION ),
   mAnimationMode( Toolkit::Popup::FADE ),
+  mEntryAnimationData(),
+  mExitAnimationData(),
   mAutoHideDelay( 0 ),
   mBackingEnabled( true ),
   mBackingColor( DEFAULT_BACKING_COLOR ),
   mAutoHideDelay( 0 ),
   mBackingEnabled( true ),
   mBackingColor( DEFAULT_BACKING_COLOR ),
+  mPopupBackgroundImage(),
+  mBackgroundOuterBorder(),
+  mMargin(),
   mTailUpImage( DEFAULT_TAIL_UP_IMAGE_PATH ),
   mTailDownImage( DEFAULT_TAIL_DOWN_IMAGE_PATH ),
   mTailLeftImage( DEFAULT_TAIL_LEFT_IMAGE_PATH ),
   mTailUpImage( DEFAULT_TAIL_UP_IMAGE_PATH ),
   mTailDownImage( DEFAULT_TAIL_DOWN_IMAGE_PATH ),
   mTailLeftImage( DEFAULT_TAIL_LEFT_IMAGE_PATH ),
index b07a17f..ca833f0 100644 (file)
@@ -743,10 +743,10 @@ void ImageRenderer::OnImageLoaded( ResourceImage image )
 {
   if( image.GetLoadingState() == Dali::ResourceLoadingFailed )
   {
 {
   if( image.GetLoadingState() == Dali::ResourceLoadingFailed )
   {
-    Image image = RendererFactory::GetBrokenRendererImage();
+    Image brokenImage = RendererFactory::GetBrokenRendererImage();
     if( mImpl->mRenderer )
     {
     if( mImpl->mRenderer )
     {
-      ApplyImageToSampler( image );
+      ApplyImageToSampler( brokenImage );
     }
   }
 }
     }
   }
 }
index fb97e6e..a730e40 100644 (file)
@@ -1197,8 +1197,8 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
       if( childMap )
       {
         Property::Value* policy = childMap->Find( "policy" );
       if( childMap )
       {
         Property::Value* policy = childMap->Find( "policy" );
-        Property::Value* value = childMap->Find( "value" );
-        if( policy && value )
+        Property::Value* childMapValue = childMap->Find( "value" );
+        if( policy && childMapValue )
         {
           std::string policyValue;
           policy->Get( policyValue );
         {
           std::string policyValue;
           policy->Get( policyValue );
@@ -1210,11 +1210,11 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
           {
             if( policy == Toolkit::TableView::FIXED  )
             {
           {
             if( policy == Toolkit::TableView::FIXED  )
             {
-              (tableViewImpl.*funcFixed)( index, value->Get<float>() );
+              (tableViewImpl.*funcFixed)( index, childMapValue->Get<float>() );
             }
             else if( policy == Toolkit::TableView::RELATIVE )
             {
             }
             else if( policy == Toolkit::TableView::RELATIVE )
             {
-              (tableViewImpl.*funcRelative)( index, value->Get<float>() );
+              (tableViewImpl.*funcRelative)( index, childMapValue->Get<float>() );
             }
             else if( policy == Toolkit::TableView::FIT )
             {
             }
             else if( policy == Toolkit::TableView::FIT )
             {
index da2f055..e02dbc1 100644 (file)
@@ -195,7 +195,7 @@ const FeedbackStyleInfo& FeedbackStyle::GetStyleInfo( const string& type ) const
 
 void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali::StyleChange::Type styleChange )
 {
 
 void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali::StyleChange::Type styleChange )
 {
-  if( StyleChange::THEME_CHANGE )
+  if( styleChange == StyleChange::THEME_CHANGE )
   {
     string userDefinedTheme;
 
   {
     string userDefinedTheme;
 
index a84ee70..9cc0d24 100644 (file)
@@ -36,17 +36,11 @@ namespace
 const char* PLUGIN_FILE = "libdali-script-plugin-v8.so";
 }
 
 const char* PLUGIN_FILE = "libdali-script-plugin-v8.so";
 }
 
-Script::Script(void) : mPlugin(NULL)
+Script::Script()
+: mPlugin( NULL )
 {
   ScriptPluginProxy *plugin = new ScriptPluginProxy( PLUGIN_FILE );
 
 {
   ScriptPluginProxy *plugin = new ScriptPluginProxy( PLUGIN_FILE );
 
-  if( mPlugin )
-  {
-    DALI_LOG_WARNING("Reloading script plugin %s, is this what you wanted to do?",PLUGIN_FILE);
-    delete mPlugin;
-    mPlugin = NULL;
-  }
-
   if( plugin->IsInitialized() )
   {
     mPlugin = plugin;
   if( plugin->IsInitialized() )
   {
     mPlugin = plugin;
@@ -55,7 +49,6 @@ Script::Script(void) : mPlugin(NULL)
   {
     delete plugin;
   }
   {
     delete plugin;
   }
-
 }
 
 bool Script::ExecuteFile( const std::string& filename )
 }
 
 bool Script::ExecuteFile( const std::string& filename )