Enable -Wold-style-cast to ensure more consideration is given to types and their... 07/129707/5
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 17 May 2017 16:57:34 +0000 (17:57 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 18 May 2017 14:35:31 +0000 (14:35 +0000)
Change-Id: I8b8e92f09434e52ad62353d54a2846fae96fb3c3

28 files changed:
build/tizen/configure.ac
dali/devel-api/images/distance-field.cpp
dali/devel-api/scripting/scripting.h
dali/integration-api/file.list
dali/integration-api/platform-abstraction.h
dali/integration-api/resource-declarations.h [deleted file]
dali/integration-api/resource-types.h
dali/internal/event/animation/path-impl.cpp
dali/internal/event/common/object-impl.cpp
dali/internal/event/events/hover-event-processor.cpp
dali/internal/event/events/touch-event-processor.cpp
dali/internal/event/events/wheel-event-processor.cpp
dali/internal/event/images/encoded-buffer-image-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.cpp
dali/internal/event/rendering/sampler-impl.cpp
dali/internal/render/data-providers/property-buffer-data-provider.h
dali/internal/render/data-providers/uniform-map-data-provider.h
dali/internal/render/gl-resources/context.h
dali/internal/render/renderers/render-frame-buffer.h
dali/internal/render/renderers/render-property-buffer.cpp
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/shaders/program.cpp
dali/internal/update/gestures/scene-graph-pan-gesture.cpp
dali/internal/update/manager/render-instruction-processor.h
dali/internal/update/manager/update-manager.h
dali/public-api/common/dali-common.cpp
dali/public-api/common/dali-vector.cpp
dali/public-api/math/quaternion.cpp

index d4b85ef..ca4dd8e 100644 (file)
@@ -31,7 +31,7 @@ AC_SUBST(DALI_VERSION)
 DALI_CFLAGS=-DPLATFORM_TIZEN
 
 # Use C++ 11
-DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual"
+DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast"
 
 AC_ARG_ENABLE(exportall,
               [AC_HELP_STRING([--enable-exportall],
index bb4224a..6e4346d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -196,8 +196,8 @@ void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size
   {
     for ( int x = 0; x < paddedWidth; ++x)
     {
-      if( y < (int)fieldBorder || y >= (paddedHeight - (int)fieldBorder) ||
-          x < (int)fieldBorder || x >= (paddedWidth - (int)fieldBorder) )
+      if( y < static_cast< int >( fieldBorder ) || y >= ( paddedHeight - static_cast< int >( fieldBorder ) ) ||
+          x < static_cast< int >( fieldBorder ) || x >= ( paddedWidth - static_cast< int >( fieldBorder ) ) )
       {
         outside[ y * paddedWidth + x ] = MAX_DISTANCE;
         inside[ y * paddedWidth + x ] = 0.0f;
index 3216df4..6149155 100644 (file)
@@ -245,7 +245,7 @@ const char* GetEnumerationName( T value, const StringEnum* table, unsigned int t
 template< typename T >
 const char * GetLinearEnumerationName( T value, const StringEnum* table, unsigned int tableCount )
 {
-  if ( table && ( value > 0 || value <= (int)tableCount ) )
+  if ( table && ( value > 0 || value <= static_cast<int>( tableCount ) ) )
   {
     return table[value].string;
   }
index 614ea22..afcc494 100644 (file)
@@ -31,7 +31,6 @@ platform_abstraction_header_files = \
    $(platform_abstraction_src_dir)/bitmap.h \
    $(platform_abstraction_src_dir)/resource-policies.h \
    $(platform_abstraction_src_dir)/resource-types.h \
-   $(platform_abstraction_src_dir)/resource-declarations.h \
    $(platform_abstraction_src_dir)/gl-abstraction.h \
    $(platform_abstraction_src_dir)/gl-defines.h \
    $(platform_abstraction_src_dir)/gl-sync-abstraction.h \
index ad79582..db2586b 100644 (file)
@@ -30,7 +30,7 @@ namespace Dali
 
 namespace Integration
 {
-
+typedef unsigned int ResourceId;
 typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
 
 /**
diff --git a/dali/integration-api/resource-declarations.h b/dali/integration-api/resource-declarations.h
deleted file mode 100644 (file)
index a17af2e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
-#define __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-/**
- * @brief Used to identify a resource loading operation.
- *
- * These unique ResourceId values can be used to identify a resource loading
- * transaction in core-adaptor communication.
- * A resource transaction is asynchronous and many can be in-flight
- * concurrently.
- * A ResourceId allows the core to track a resource transaction over its
- * lifetime and match an asynchronous completion notification to the
- * corresponding load request or to cancel the operation early.
- *
- * A resource transaction begins with a call to PlatformAbstraction::LoadResource()
- * Later asynchronous status notifications obtained by polling
- * PlatformAbstraction::GetResources() can be mapped to corresponding
- * LoadResource() invocations using the ResourceId value.
- * It is the core's responsibility to ensure that each invocation of
- * PlatformAbstraction::LoadResource() passes in a Request object with a unique
- * integer ResourceId.
- *
- * @sa Dali::Integration::PlatformAbstraction::LoadResource
- * Dali::Integration::PlatformAbstraction::GetResources
- * Dali::Integration::ResourceCache
- */
-typedef unsigned int ResourceId;
-const ResourceId InvalidResourceId = (ResourceId)-1;
-
-/**
- * Used to inform the current loading status
- */
-enum LoadStatus
-{
-  RESOURCE_LOADING,            ///< There are missing resources, being loaded
-  RESOURCE_PARTIALLY_LOADED,   ///< Enough resource has been loaded to start low quality rendering
-  RESOURCE_COMPLETELY_LOADED,  ///< The resource has been completely loaded
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
index db03510..d793a0c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_RESOURCE_TYPES_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
 #include <dali/public-api/images/image-operations.h>
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/math/vector2.h>
-#include <dali/integration-api/resource-declarations.h>
 
 namespace Dali
 {
index 6242e66..865c4fa 100644 (file)
@@ -348,7 +348,7 @@ void Path::FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal
   {
     segment = t * numSegs;
     float segLength = 1.0f / numSegs;
-    float segStart  = (float)segment * segLength;
+    float segStart  = static_cast<float>( segment ) * segLength;
     tLocal = (t - segStart) * numSegs;
   }
 }
index 344e72c..da2f58d 100644 (file)
@@ -1448,7 +1448,7 @@ CustomPropertyMetadata* Object::FindCustomProperty( Property::Index index ) cons
     int arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
     if( arrayIndex >= 0 )
     {
-      if( arrayIndex < (int)mCustomProperties.Count() ) // we can only access the first 2 billion custom properties
+      if( arrayIndex < static_cast<int>( mCustomProperties.Count() ) ) // we can only access the first 2 billion custom properties
       {
         property = static_cast<CustomPropertyMetadata*>(mCustomProperties[ arrayIndex ]);
       }
@@ -1459,7 +1459,8 @@ CustomPropertyMetadata* Object::FindCustomProperty( Property::Index index ) cons
 
 AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
 {
-  for ( int arrayIndex = 0; arrayIndex < (int)mAnimatableProperties.Count(); arrayIndex++ )
+  const PropertyMetadataLookup::SizeType count = mAnimatableProperties.Count();
+  for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
   {
     AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( mAnimatableProperties[ arrayIndex ] );
     if( property->index == index )
@@ -1531,7 +1532,8 @@ void Object::ResolveChildProperties()
     if( parentTypeInfo )
     {
       // Go through each custom property
-      for ( int arrayIndex = 0; arrayIndex < (int)mCustomProperties.Count(); arrayIndex++ )
+      const PropertyMetadataLookup::SizeType count = mCustomProperties.Count();
+      for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
       {
         CustomPropertyMetadata* customProperty = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
 
index 964ad87..a19da0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -245,7 +245,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
                    TOUCH_POINT_STATE[iter->GetState()], iter->GetScreenPosition().x, iter->GetScreenPosition().y,
-                   ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+                   ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
                    ( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
                    hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
 
@@ -269,8 +269,8 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   Dali::Actor primaryHitActor = primaryPoint.hitActor;
   TouchPoint::State primaryPointState = primaryPoint.state;
 
-  DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor:     (%p) %s\n", primaryPoint.hitActor ? (void*)&primaryPoint.hitActor.GetBaseObject() : NULL, primaryPoint.hitActor ? primaryPoint.hitActor.GetName().c_str() : "" );
-  DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor:       (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor:     (%p) %s\n", primaryPoint.hitActor ? reinterpret_cast< void* >( &primaryPoint.hitActor.GetBaseObject() ) : NULL, primaryPoint.hitActor ? primaryPoint.hitActor.GetName().c_str() : "" );
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor:       (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
 
   if ( ( primaryPointState == TouchPoint::Started ) &&
        ( hoverEvent.GetPointCount() == 1 ) &&
@@ -299,7 +299,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
         {
           if ( lastPrimaryHitActor->GetLeaveRequired() )
           {
-            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit):     (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
             leaveEventConsumer = EmitHoverSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Leave );
           }
         }
@@ -307,7 +307,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
         {
           // At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
-          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit):     (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
           leaveEventConsumer = EmitHoverSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Interrupted );
         }
       }
@@ -325,7 +325,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
         {
           if( lastConsumedActor->GetLeaveRequired() )
           {
-            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
             EmitHoverSignals( lastConsumedActor, lastRenderTaskImpl, hoverEvent, TouchPoint::Leave );
           }
         }
@@ -333,7 +333,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
         {
           // At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
-          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume):     (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume):     (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
           EmitHoverSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Interrupted );
         }
       }
index b9c305c..871d851 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -258,7 +258,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
                    TOUCH_POINT_STATE[iter->GetState()], iter->GetScreenPosition().x, iter->GetScreenPosition().y,
-                   ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+                   ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
                    ( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
                    hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
 
@@ -282,8 +282,8 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   Dali::Actor primaryHitActor = primaryPoint.GetHitActor();
   PointState::Type primaryPointState = primaryPoint.GetState();
 
-  DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor:     (%p) %s\n", primaryHitActor ? (void*)&primaryHitActor.GetBaseObject() : NULL, primaryHitActor ? primaryHitActor.GetName().c_str() : "" );
-  DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor:       (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor:     (%p) %s\n", primaryHitActor ? reinterpret_cast< void* >( &primaryHitActor.GetBaseObject() ) : NULL, primaryHitActor ? primaryHitActor.GetName().c_str() : "" );
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor:       (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
 
   if ( ( primaryPointState == PointState::DOWN ) &&
        ( touchEvent.GetPointCount() == 1 ) &&
@@ -312,7 +312,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
         {
           if ( lastPrimaryHitActor->GetLeaveRequired() )
           {
-            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit):     (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
             leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
           }
         }
@@ -320,7 +320,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
         {
           // At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
-          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit):     (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit):     (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
           leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
         }
       }
@@ -338,7 +338,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
         {
           if( lastConsumedActor->GetLeaveRequired() )
           {
-            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+            DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
             EmitTouchSignals( lastConsumedActor, lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
           }
         }
@@ -346,7 +346,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
         {
           // At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one.
           // An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
-          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume):     (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+          DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume):     (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
           EmitTouchSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
         }
       }
index 6d08325..0dcdb2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -142,15 +142,15 @@ void WheelEventProcessor::ProcessWheelEvent(const Integration::WheelEvent& event
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
                    event.point.x, event.point.y,
-                   ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+                   ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
                    ( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
                    hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
 
     // Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
     Dali::Actor consumedActor = EmitWheelSignals( hitTestResults.actor, wheelEvent );
 
-    DALI_LOG_INFO( gLogFilter, Debug::Concise, "HitActor:      (%p) %s\n", hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL, hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" );
-    DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "HitActor:      (%p) %s\n", hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL, hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" );
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
   }
   else
   {
index 6696f4d..6666656 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -70,8 +70,8 @@ EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImag
   // Get image size from buffer
   Dali::Integration::PlatformAbstraction& platformAbstraction = Internal::ThreadLocalStorage::Get().GetPlatformAbstraction();
   const ImageDimensions expectedSize = platformAbstraction.GetClosestImageSize( buffer, size, fittingMode, samplingMode, orientationCorrection );
-  image->mWidth = (unsigned int) expectedSize.GetWidth();
-  image->mHeight = (unsigned int) expectedSize.GetHeight();
+  image->mWidth = static_cast<unsigned int>( expectedSize.GetWidth() );
+  image->mHeight = static_cast<unsigned int>( expectedSize.GetHeight() );
 
   // Load the image synchronously
   Integration::BitmapPtr bitmap = platformAbstraction.DecodeBuffer( resourceType, &(buffer->GetVector()[0]), encodedImageByteCount );
index c2cfc80..20d09d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,8 +59,8 @@ void FrameBuffer::Initialize()
 
 void FrameBuffer::AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer )
 {
-  if( (unsigned int)( texture->GetWidth() / ( 1 << mipmapLevel ) ) == mWidth &&
-      (unsigned int)( texture->GetHeight() / ( 1 << mipmapLevel ) ) == mHeight )
+  if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) &&
+      ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) )
   {
     mColor = texture;
     AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
index ecec053..8f4f25b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ void Sampler::SetFilterMode( Dali::FilterMode::Type minFilter, Dali::FilterMode:
 {
   if( NULL != mRenderObject )
   {
-    SetFilterModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, (unsigned int)minFilter, (unsigned int)magFilter );
+    SetFilterModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( minFilter ), static_cast< unsigned int >( magFilter ) );
   }
 }
 
@@ -47,7 +47,7 @@ void Sampler::SetWrapMode( Dali::WrapMode::Type rWrap, Dali::WrapMode::Type sWra
 {
   if( NULL != mRenderObject )
   {
-    SetWrapModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, (unsigned int)rWrap, (unsigned int)sWrap, (unsigned int)tWrap );
+    SetWrapModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( rWrap ), static_cast< unsigned int >( sWrap ), static_cast< unsigned int >( tWrap ) );
   }
 }
 
index 61e1e30..51c8f64 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/property.h>
-#include <dali/integration-api/resource-declarations.h>
 #include <dali/internal/common/buffer-index.h>
 
 namespace Dali
index 97bcd39..7d7e120 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
  * limitations under the License.
  */
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/integration-api/resource-declarations.h>
 #include <dali/internal/common/buffer-index.h>
 
 namespace Dali
index 28afbfd..59ed396 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CONTEXT_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ public:
    */
   void PrintGlString(const char* stringName, GLenum stringId)
   {
-    DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, (const char *)GetString( stringId ) );
+    DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, reinterpret_cast< const char * >( GetString( stringId ) ) );
   }
 
   /****************************************************************************************
index 00d2996..942e5b3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDER_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
 #include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/renderers/render-sampler.h>
 #include <dali/integration-api/gl-defines.h>
-#include <dali/integration-api/resource-declarations.h>
 
 namespace Dali
 {
index 6be4623..ccbd2d0 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <dali/internal/render/renderers/render-property-buffer.h>
 #include <dali/internal/event/common/property-buffer-impl.h>  // Dali::Internal::PropertyBuffer
@@ -183,7 +199,7 @@ unsigned int PropertyBuffer::EnableVertexAttributes( Context& context, Vector<GL
                                    GetPropertyImplementationGlType(attributeType),
                                    GL_FALSE,  // Not normalized
                                    elementSize,
-                                   (void*)attributeOffset );
+                                   reinterpret_cast< void* >( attributeOffset ) );
     }
   }
 
index 97f45ee..593316f 100644 (file)
@@ -535,7 +535,7 @@ void Renderer::Render( Context& context,
   Program* program = mRenderDataProvider->GetShader().GetProgram();
   if( !program )
   {
-    DALI_LOG_ERROR( "Failed to get program for shader at address %p.\n", (void*)&mRenderDataProvider->GetShader() );
+    DALI_LOG_ERROR( "Failed to get program for shader at address %p.\n", reinterpret_cast< void* >( &mRenderDataProvider->GetShader() ) );
     return;
   }
 
index 5739f18..451de0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -258,7 +258,7 @@ void Program::GetActiveSamplerUniforms()
 
     for( int i=0; i<numberOfActiveUniforms; ++i )
     {
-      mGlAbstraction.GetActiveUniform( mProgramId, (GLuint)i, uniformMaxNameLength,
+      mGlAbstraction.GetActiveUniform( mProgramId, static_cast< GLuint >( i ), uniformMaxNameLength,
                                        &nameLength, &number, &type, name );
 
       if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE || type == GL_SAMPLER_EXTERNAL_OES )
index 596a391..6218102 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -137,7 +137,7 @@ void PanGesture::PredictiveAlgorithm1(int eventsThisFrame, PanInfo& gestureOut,
       ++iter;
       continue;
     }
-    float previousValueWeight = (float)(MAX_GESTURE_AGE - (lastVSyncTime - lastTime)) / (float)MAX_GESTURE_AGE;
+    float previousValueWeight = ( static_cast< float >( MAX_GESTURE_AGE ) - (lastVSyncTime - lastTime) ) / static_cast< float >( MAX_GESTURE_AGE );
     float velMag = currentGesture.screen.velocity.Length();
     float velDiff = velMag - screenVelocity.Length();
     float acceleration = 0.0f;
index ecdb451..95cc818 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_PROCESSOR_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/internal/common/buffer-index.h>
 #include <dali/internal/update/manager/sorted-layers.h>
-#include <dali/integration-api/resource-declarations.h>
 #include <dali/public-api/common/dali-vector.h>
 
 namespace Dali
index 6496987..4f92d2c 100644 (file)
@@ -22,8 +22,6 @@
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/common/dali-common.h>
 
-#include <dali/integration-api/resource-declarations.h>
-
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/common/shader-saver.h>
index c2c16cc..78dd20d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ std::string Demangle(const char* symbol)
       size_t tokenLength = endOfToken - startOfToken;
 
       // Allocate space for symbol
-      char *mangledSymbol = (char*)malloc(tokenLength+1u);
+      char *mangledSymbol = reinterpret_cast< char* >( malloc( tokenLength + 1u ) );
       if(mangledSymbol != NULL)
       {
         strncpy(mangledSymbol, startOfToken, tokenLength);
index 9dd7d8c..2e2bd8f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ void VectorBase::Reserve( SizeType capacity, SizeType elementSize )
   if( capacity > oldCapacity )
   {
     const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
-    void* wholeData = (void*) new unsigned char[ wholeAllocation ];
+    void* wholeData = reinterpret_cast< void* >( new unsigned char[ wholeAllocation ] );
     DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
 
 #if defined( DEBUG_ENABLED )
index cfa8fa9..19546b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -302,12 +302,12 @@ bool Quaternion::operator!=( const Quaternion& rhs ) const
 
 float Quaternion::Length() const
 {
-  return (float)sqrt(mVector.w * mVector.w + mVector.Dot(mVector));
+  return static_cast< float >( sqrt(mVector.w * mVector.w + mVector.Dot(mVector) ) );
 }
 
 float Quaternion::LengthSquared() const
 {
-  return (float)(mVector.w * mVector.w + mVector.Dot(mVector));
+  return static_cast< float >( mVector.w * mVector.w + mVector.Dot(mVector) );
 }
 
 void Quaternion::Normalize()