Fix various klocwork issues
[platform/core/uifw/dali-core.git] / dali / internal / event / common / object-impl.cpp
index be21c3c..a9605e9 100644 (file)
@@ -358,7 +358,7 @@ Property::Type Object::GetPropertyType( Property::Index index ) const
   CustomPropertyMetadata* custom = FindCustomProperty( index );
   if( custom )
   {
-    return custom->type;
+    return custom->GetType();
   }
   return Property::NONE;
 }
@@ -537,12 +537,6 @@ Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Prop
       break;
     }
 
-    case Property::UNSIGNED_INTEGER:
-    {
-      newProperty = new AnimatableProperty<unsigned int>( propertyValue.Get<unsigned int>() );
-      break;
-    }
-
     case Property::FLOAT:
     {
       newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
@@ -640,7 +634,7 @@ Property::Index Object::RegisterProperty( const std::string& name, const Propert
 
 Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode)
 {
-  Property::Index index = Property::INVALID_INDEX;
+  Property::Index index; // No need to initialise as it's overridden anyway
 
   if(Property::ANIMATABLE == accessMode)
   {
@@ -825,7 +819,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const
   {
     BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
 
-    switch ( entry->type )
+    switch ( entry->GetType() )
     {
       case Property::BOOLEAN:
       {
@@ -845,15 +839,6 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const
         break;
       }
 
-      case Property::UNSIGNED_INTEGER:
-      {
-        const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        value = (*property)[ bufferIndex ];
-        break;
-      }
-
       case Property::FLOAT:
       {
         const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
@@ -975,7 +960,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const
 
 void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value )
 {
-  switch ( entry.type )
+  switch ( entry.GetType() )
   {
     case Property::BOOLEAN:
     {
@@ -997,16 +982,6 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
       break;
     }
 
-    case Property::UNSIGNED_INTEGER:
-    {
-      const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
-
-      // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<unsigned int>( GetEventThreadServices(), *property, value.Get<unsigned int>() );
-      break;
-    }
-
     case Property::FLOAT:
     {
       const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
@@ -1278,7 +1253,7 @@ AnimatablePropertyMetadata* Object::RegisterAnimatableProperty(Property::Index i
       if(basePropertyIndex == Property::INVALID_INDEX)
       {
         // If the property is not a component of a base property, register the whole property itself.
-        index = RegisterSceneGraphProperty(typeInfo->GetPropertyName(index), index, Property::Value(typeInfo->GetPropertyType(index)));
+        RegisterSceneGraphProperty(typeInfo->GetPropertyName(index), index, Property::Value(typeInfo->GetPropertyType(index)));
       }
       else
       {
@@ -1296,7 +1271,7 @@ AnimatablePropertyMetadata* Object::RegisterAnimatableProperty(Property::Index i
         if(animatableProperty)
         {
           // Create the metadata for the property component.
-          mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->type, animatableProperty->GetSceneGraphProperty() ) );
+          mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->GetType(), animatableProperty->GetSceneGraphProperty() ) );
         }
       }