From: Adeel Kazmi Date: Fri, 11 Nov 2016 16:53:47 +0000 (+0000) Subject: Fix various SVACE errors X-Git-Tag: dali_1.2.15~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F97253%2F5;p=platform%2Fcore%2Fuifw%2Fdali-core.git Fix various SVACE errors Change-Id: I53d180d04995a78a1728bdf5fd740c048a7cac02 --- diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h index 10c3264..9bed832 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h @@ -956,10 +956,11 @@ public: inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { const std::string shaderSource = mShaderSources[shader]; - if( static_cast(shaderSource.length()) < bufsize ) + const int shaderSourceLength = static_cast(shaderSource.length()); + if( shaderSourceLength < bufsize ) { - strcpy(source, shaderSource.c_str()); - *length = shaderSource.length(); + strncpy( source, shaderSource.c_str(), shaderSourceLength ); + *length = shaderSourceLength; } else { diff --git a/dali/devel-api/animation/animation-data.h b/dali/devel-api/animation/animation-data.h index c429149..ebdad5a 100644 --- a/dali/devel-api/animation/animation-data.h +++ b/dali/devel-api/animation/animation-data.h @@ -2,7 +2,7 @@ #define __DALI_ANIMATION_DATA_H__ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -76,6 +76,7 @@ public: /** * @brief Adds one AnimationDataElement to the list to describe one animation. * @param[in] animationDataElement A pre-populated struct to add + * @note This class takes ownership of animationDataElement */ void Add( AnimationDataElement* animationDataElement ); diff --git a/dali/devel-api/images/distance-field.cpp b/dali/devel-api/images/distance-field.cpp index 134f9c4..bb4224a 100644 --- a/dali/devel-api/images/distance-field.cpp +++ b/dali/devel-api/images/distance-field.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -116,7 +116,7 @@ void DistanceTransform( float *source, float* dest, unsigned int length ) { ++rightmost; } - dest[i] = SQUARE( i - parabolas[rightmost] ) + source[parabolas[rightmost]]; + dest[i] = SQUARE( static_cast< int >( i ) - parabolas[rightmost] ) + source[parabolas[rightmost]]; } } diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index 485ec51..b3fce27 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -1386,6 +1386,8 @@ void Actor::SetRelayoutEnabled( bool relayoutEnabled ) { EnsureRelayoutData(); + DALI_ASSERT_DEBUG( mRelayoutData && "mRelayoutData not created" ); + mRelayoutData->relayoutEnabled = relayoutEnabled; } } @@ -1915,7 +1917,7 @@ Dali::Actor::OnRelayoutSignalType& Actor::OnRelayoutSignal() bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - Actor* actor = dynamic_cast< Actor* >( object ); + Actor* actor = static_cast< Actor* >( object ); // TypeRegistry guarantees that this is the correct type. if( 0 == signalName.compare( SIGNAL_TOUCHED ) ) { diff --git a/dali/internal/event/animation/animation-impl.cpp b/dali/internal/event/animation/animation-impl.cpp index ec49265..5a8ca0c 100644 --- a/dali/internal/event/animation/animation-impl.cpp +++ b/dali/internal/event/animation/animation-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -791,7 +791,7 @@ void Animation::EmitSignalFinish() bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - Animation* animation = dynamic_cast(object); + Animation* animation = static_cast< Animation* >(object); // TypeRegistry guarantees that this is the correct type. if( 0 == signalName.compare( SIGNAL_FINISHED ) ) { diff --git a/dali/internal/event/common/object-registry-impl.cpp b/dali/internal/event/common/object-registry-impl.cpp index 76c2cbe..f2ca897 100644 --- a/dali/internal/event/common/object-registry-impl.cpp +++ b/dali/internal/event/common/object-registry-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -78,7 +78,7 @@ void ObjectRegistry::UnregisterObject( Dali::BaseObject* object ) bool ObjectRegistry::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - ObjectRegistry* objectRegistry = dynamic_cast( object ); + ObjectRegistry* objectRegistry = static_cast< ObjectRegistry* >( object ); // TypeRegistry guarantees that this is the correct type. if( 0 == strcmp( signalName.c_str(), SIGNAL_OBJECT_CREATED ) ) { diff --git a/dali/internal/event/common/stage-impl.cpp b/dali/internal/event/common/stage-impl.cpp index bbdf7b0..a9abac8 100644 --- a/dali/internal/event/common/stage-impl.cpp +++ b/dali/internal/event/common/stage-impl.cpp @@ -520,7 +520,7 @@ void Stage::KeepRendering( float durationSeconds ) bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - Stage* stage = dynamic_cast(object); + Stage* stage = static_cast< Stage* >(object); // TypeRegistry guarantees that this is the correct type. if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) ) { diff --git a/dali/internal/event/events/long-press-gesture-detector-impl.cpp b/dali/internal/event/events/long-press-gesture-detector-impl.cpp index 441ba62..804e8d4 100644 --- a/dali/internal/event/events/long-press-gesture-detector-impl.cpp +++ b/dali/internal/event/events/long-press-gesture-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -143,7 +143,7 @@ void LongPressGestureDetector::EmitLongPressGestureSignal(Dali::Actor pressedAct bool LongPressGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - LongPressGestureDetector* gesture = dynamic_cast(object); + LongPressGestureDetector* gesture = static_cast< LongPressGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type. if ( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESS_DETECTED ) ) { diff --git a/dali/internal/event/events/pan-gesture-detector-impl.cpp b/dali/internal/event/events/pan-gesture-detector-impl.cpp index c819a82..a66e15f 100644 --- a/dali/internal/event/events/pan-gesture-detector-impl.cpp +++ b/dali/internal/event/events/pan-gesture-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -291,7 +291,7 @@ void PanGestureDetector::SetSceneObject( const SceneGraph::PanGesture* object ) bool PanGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - PanGestureDetector* gesture = dynamic_cast(object); + PanGestureDetector* gesture = static_cast< PanGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type. if ( 0 == strcmp( signalName.c_str(), SIGNAL_PAN_DETECTED ) ) { diff --git a/dali/internal/event/events/pinch-gesture-detector-impl.cpp b/dali/internal/event/events/pinch-gesture-detector-impl.cpp index aa717aa..e2b49ab 100644 --- a/dali/internal/event/events/pinch-gesture-detector-impl.cpp +++ b/dali/internal/event/events/pinch-gesture-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -77,7 +77,7 @@ void PinchGestureDetector::EmitPinchGestureSignal(Dali::Actor actor, const Pinch bool PinchGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - PinchGestureDetector* gesture = dynamic_cast(object); + PinchGestureDetector* gesture = static_cast< PinchGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type. if ( 0 == strcmp( signalName.c_str(), SIGNAL_PINCH_DETECTED ) ) { diff --git a/dali/internal/event/events/tap-gesture-detector-impl.cpp b/dali/internal/event/events/tap-gesture-detector-impl.cpp index 7df665b..7f65842 100644 --- a/dali/internal/event/events/tap-gesture-detector-impl.cpp +++ b/dali/internal/event/events/tap-gesture-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -148,7 +148,7 @@ void TapGestureDetector::EmitTapGestureSignal(Dali::Actor tappedActor, const Tap bool TapGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - TapGestureDetector* gesture = dynamic_cast(object); + TapGestureDetector* gesture = static_cast< TapGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type. if ( 0 == strcmp( signalName.c_str(), SIGNAL_TAP_DETECTED ) ) { diff --git a/dali/internal/event/images/bitmap-packed-pixel.h b/dali/internal/event/images/bitmap-packed-pixel.h index 5708a87..c6ca538 100644 --- a/dali/internal/event/images/bitmap-packed-pixel.h +++ b/dali/internal/event/images/bitmap-packed-pixel.h @@ -116,7 +116,7 @@ public: // unsigned int GetBufferSize() const virtual size_t GetBufferSize() const { - return mBufferWidth*mBytesPerPixel*mBufferHeight; + return static_cast< size_t >( mBufferWidth ) * mBytesPerPixel * mBufferHeight; // need to cast to size_t to avoid possibility of overflow } /** @@ -124,9 +124,6 @@ public: * @return The buffer stride (in bytes). */ virtual unsigned int GetBufferStride() const; - //{ - // return mBufferWidth*mBytesPerPixel; - //} /** * Get the pixel format diff --git a/dali/internal/event/render-tasks/render-task-impl.cpp b/dali/internal/event/render-tasks/render-task-impl.cpp index 09514c9..a1ad2b8 100644 --- a/dali/internal/event/render-tasks/render-task-impl.cpp +++ b/dali/internal/event/render-tasks/render-task-impl.cpp @@ -789,7 +789,7 @@ Dali::RenderTask::RenderTaskSignalType& RenderTask::FinishedSignal() bool RenderTask::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { bool connected( true ); - RenderTask* renderTask = dynamic_cast(object); + RenderTask* renderTask = static_cast< RenderTask* >(object); // TypeRegistry guarantees that this is the correct type. if ( 0 == strcmp( signalName.c_str(), SIGNAL_FINISHED ) ) { diff --git a/dali/internal/event/resources/resource-client.h b/dali/internal/event/resources/resource-client.h index 1de28df..7c10b7e 100644 --- a/dali/internal/event/resources/resource-client.h +++ b/dali/internal/event/resources/resource-client.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_RESOURCE_CLIENT_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -265,6 +265,10 @@ public: // Message methods void UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ); ///!< Issue #AHC01 private: + + ResourceClient( const ResourceClient& ); ///< Undefined + ResourceClient& operator=( const ResourceClient& ); ///< Undefined + ResourceManager& mResourceManager; ///< The resource manager EventThreadServices& mEventThreadServices; ///< Interface to send messages through diff --git a/dali/internal/render/shaders/program.h b/dali/internal/render/shaders/program.h index b818508..0d5f416 100644 --- a/dali/internal/render/shaders/program.h +++ b/dali/internal/render/shaders/program.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_PROGRAM_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -324,10 +324,9 @@ public: private: - // default constructor, not defined - Program(); - // assignment operator, not defined - Program& operator=( const Program& ); + Program(); ///< default constructor, not defined + Program( const Program& ); ///< copy constructor, not defined + Program& operator=( const Program& ); ///< assignment operator, not defined /** * Load the shader, from a precompiled binary if available, else from source code diff --git a/dali/internal/update/common/scene-graph-property-notification.cpp b/dali/internal/update/common/scene-graph-property-notification.cpp index 012b537..82464fc 100644 --- a/dali/internal/update/common/scene-graph-property-notification.cpp +++ b/dali/internal/update/common/scene-graph-property-notification.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -60,7 +60,8 @@ PropertyNotification::PropertyNotification(Object& object, mConditionType(condition), mArguments(arguments), mValid(false), - mNotifyMode( Dali::PropertyNotification::Disabled ) + mNotifyMode( Dali::PropertyNotification::Disabled ), + mConditionFunction(NULL) { SetNotifyMode(notifyMode); diff --git a/dali/internal/update/gestures/scene-graph-pan-gesture.h b/dali/internal/update/gestures/scene-graph-pan-gesture.h index 0185f72..c511f7c 100644 --- a/dali/internal/update/gestures/scene-graph-pan-gesture.h +++ b/dali/internal/update/gestures/scene-graph-pan-gesture.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -93,9 +93,12 @@ public: */ Info& operator=( const Info& rhs ) { - velocity = rhs.velocity; - displacement = rhs.displacement; - position = rhs.position; + if( this != &rhs ) + { + velocity = rhs.velocity; + displacement = rhs.displacement; + position = rhs.position; + } return *this; } @@ -134,10 +137,13 @@ public: */ PanInfo& operator=( const PanInfo& rhs ) { - time = rhs.time; - state = rhs.state; - local = rhs.local; - screen = rhs.screen; + if( this != &rhs ) + { + time = rhs.time; + state = rhs.state; + local = rhs.local; + screen = rhs.screen; + } return *this; } diff --git a/dali/public-api/events/gesture.cpp b/dali/public-api/events/gesture.cpp index 31c3b25..0ceaadf 100644 --- a/dali/public-api/events/gesture.cpp +++ b/dali/public-api/events/gesture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -30,9 +30,12 @@ Gesture::Gesture( const Gesture& rhs ) Gesture& Gesture::operator=( const Gesture& rhs ) { - type = rhs.type; - state = rhs.state; - time = rhs.time; + if( this != &rhs ) + { + type = rhs.type; + state = rhs.state; + time = rhs.time; + } return *this; } diff --git a/dali/public-api/events/long-press-gesture.cpp b/dali/public-api/events/long-press-gesture.cpp index b9dd141..e329c82 100644 --- a/dali/public-api/events/long-press-gesture.cpp +++ b/dali/public-api/events/long-press-gesture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -37,10 +37,13 @@ LongPressGesture::LongPressGesture( const LongPressGesture& rhs ) LongPressGesture& LongPressGesture::operator=( const LongPressGesture& rhs ) { - Gesture::operator=(rhs); - numberOfTouches = rhs.numberOfTouches; - screenPoint = rhs.screenPoint; - localPoint = rhs.localPoint; + if( this != &rhs ) + { + Gesture::operator=(rhs); + numberOfTouches = rhs.numberOfTouches; + screenPoint = rhs.screenPoint; + localPoint = rhs.localPoint; + } return *this; } diff --git a/dali/public-api/events/pan-gesture.cpp b/dali/public-api/events/pan-gesture.cpp index f6011ad..a2a8f44 100644 --- a/dali/public-api/events/pan-gesture.cpp +++ b/dali/public-api/events/pan-gesture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -50,14 +50,17 @@ PanGesture::PanGesture( const PanGesture& rhs ) PanGesture& PanGesture::operator=( const PanGesture& rhs ) { - Gesture::operator=(rhs); - velocity = rhs.velocity; - displacement = rhs.displacement; - position = rhs.position; - screenVelocity = rhs.screenVelocity; - screenDisplacement = rhs.screenDisplacement; - screenPosition = rhs.screenPosition; - numberOfTouches = rhs.numberOfTouches; + if( this != &rhs ) + { + Gesture::operator=(rhs); + velocity = rhs.velocity; + displacement = rhs.displacement; + position = rhs.position; + screenVelocity = rhs.screenVelocity; + screenDisplacement = rhs.screenDisplacement; + screenPosition = rhs.screenPosition; + numberOfTouches = rhs.numberOfTouches; + } return *this; } diff --git a/dali/public-api/events/pinch-gesture.cpp b/dali/public-api/events/pinch-gesture.cpp index d074efe..9c72c25 100644 --- a/dali/public-api/events/pinch-gesture.cpp +++ b/dali/public-api/events/pinch-gesture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -42,11 +42,14 @@ PinchGesture::PinchGesture( const PinchGesture& rhs ) PinchGesture& PinchGesture::operator=( const PinchGesture& rhs ) { - Gesture::operator=(rhs); - scale = rhs.scale; - speed = rhs.speed; - screenCenterPoint = rhs.screenCenterPoint; - localCenterPoint = rhs.localCenterPoint; + if( this != &rhs ) + { + Gesture::operator=(rhs); + scale = rhs.scale; + speed = rhs.speed; + screenCenterPoint = rhs.screenCenterPoint; + localCenterPoint = rhs.localCenterPoint; + } return *this; } diff --git a/dali/public-api/events/tap-gesture.cpp b/dali/public-api/events/tap-gesture.cpp index 3d9fed6..d20afc4 100644 --- a/dali/public-api/events/tap-gesture.cpp +++ b/dali/public-api/events/tap-gesture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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,11 +39,14 @@ TapGesture::TapGesture( const TapGesture& rhs ) TapGesture& TapGesture::operator=( const TapGesture& rhs ) { - Gesture::operator=(rhs); - numberOfTaps = rhs.numberOfTaps; - numberOfTouches = rhs.numberOfTouches; - screenPoint = rhs.screenPoint; - localPoint = rhs.localPoint; + if( this != &rhs ) + { + Gesture::operator=(rhs); + numberOfTaps = rhs.numberOfTaps; + numberOfTouches = rhs.numberOfTouches; + screenPoint = rhs.screenPoint; + localPoint = rhs.localPoint; + } return *this; } diff --git a/dali/public-api/object/property-value.cpp b/dali/public-api/object/property-value.cpp index ffd0f70..fd4058e 100644 --- a/dali/public-api/object/property-value.cpp +++ b/dali/public-api/object/property-value.cpp @@ -313,6 +313,7 @@ Property::Value::Value( Property::Map& mapValue ) } Property::Value::Value( Type type ) +: mImpl( NULL ) { switch (type) {