From 055de0438aa78da994e63bc03c486f05cee430da Mon Sep 17 00:00:00 2001 From: Andrew Cox Date: Wed, 18 Feb 2015 21:45:39 +0000 Subject: [PATCH] Removed unnecessary includes such as and Patch reduced clean build time using `make -j 11` on desktop by 5% to 10% after a `make clean`. More improvements possible. Signed-off-by: Andrew Cox Change-Id: I34d674edc02d2f477acb774ae1d913431269031c --- .../dali-test-suite-utils/test-gl-abstraction.h | 11 +++---- dali/integration-api/core.cpp | 8 ++--- dali/integration-api/resource-types.h | 6 ++-- dali/internal/common/event-to-update.h | 2 +- dali/internal/common/image-sampler.cpp | 3 +- dali/internal/common/owner-pointer.h | 18 +++++------ dali/internal/event/common/property-input-impl.h | 4 +++ dali/internal/event/modeling/model-logger.cpp | 10 +++---- .../update/node-attachments/node-attachment.h | 12 ++++---- .../internal/update/queue/update-message-queue.cpp | 2 +- dali/internal/update/queue/update-message-queue.h | 2 +- dali/public-api/common/constants.cpp | 3 ++ dali/public-api/common/dali-common.h | 1 - dali/public-api/common/dali-vector.h | 7 +++-- dali/public-api/math/math-utils.h | 29 ++++++++++-------- dali/public-api/math/matrix.cpp | 9 +++--- dali/public-api/math/matrix.h | 3 -- dali/public-api/math/matrix3.cpp | 6 ++-- dali/public-api/math/quaternion.cpp | 13 ++++++++ dali/public-api/math/quaternion.h | 14 +-------- dali/public-api/math/vector2.cpp | 7 +++-- dali/public-api/math/vector2.h | 11 ++++--- dali/public-api/math/vector3.cpp | 7 +++-- dali/public-api/math/vector3.h | 15 ++++++---- dali/public-api/math/vector4.cpp | 7 +++-- dali/public-api/math/vector4.h | 19 +++++++----- dali/public-api/modeling/bone.h | 3 ++ dali/public-api/object/any.h | 35 +++++++++++----------- dali/public-api/signals/callback.cpp | 18 +++++------ dali/public-api/signals/callback.h | 22 +++++++------- .../public-api/signals/signal-slot-connections.cpp | 6 ++-- dali/public-api/text/utf8.cpp | 2 +- dali/public-api/text/utf8.h | 2 +- 33 files changed, 171 insertions(+), 146 deletions(-) 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 919405a..fe3cfdc 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 @@ -18,11 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include -#include -#include - // INTERNAL INCLUDES #include #include @@ -30,6 +25,12 @@ #include #include "test-trace-call-stack.h" +// EXTERNAL INCLUDES +#include +#include +#include +#include + namespace Dali { diff --git a/dali/integration-api/core.cpp b/dali/integration-api/core.cpp index 9824d8e..866897e 100644 --- a/dali/integration-api/core.cpp +++ b/dali/integration-api/core.cpp @@ -18,16 +18,16 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES #include #include #include #include +// EXTERNAL INCLUDES +#include +#include + namespace Dali { diff --git a/dali/integration-api/resource-types.h b/dali/integration-api/resource-types.h index 4174b0e..68ee185 100644 --- a/dali/integration-api/resource-types.h +++ b/dali/integration-api/resource-types.h @@ -18,8 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include // INTERNAL INCLUDES #include @@ -27,6 +25,10 @@ #include #include +// EXTERNAL INCLUDES +#include +#include + namespace Dali { diff --git a/dali/internal/common/event-to-update.h b/dali/internal/common/event-to-update.h index 8ca7f61..5a7dc08 100644 --- a/dali/internal/common/event-to-update.h +++ b/dali/internal/common/event-to-update.h @@ -59,7 +59,7 @@ public: * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update. * @return A pointer to the first char allocated for the message. */ - virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true ) = 0; + virtual unsigned int* ReserveMessageSlot( unsigned int size, bool updateScene = true ) = 0; /** * Retrieve the current event-buffer index. diff --git a/dali/internal/common/image-sampler.cpp b/dali/internal/common/image-sampler.cpp index 9c2ccc3..8dfa702 100644 --- a/dali/internal/common/image-sampler.cpp +++ b/dali/internal/common/image-sampler.cpp @@ -18,7 +18,8 @@ // CLASS HEADER #include -#include +// EXTERNAL INCLUDES +#include namespace Dali { diff --git a/dali/internal/common/owner-pointer.h b/dali/internal/common/owner-pointer.h index 360b282..9316845 100644 --- a/dali/internal/common/owner-pointer.h +++ b/dali/internal/common/owner-pointer.h @@ -36,7 +36,7 @@ public: */ OwnerPointer() { - mObject = NULL; + mObject = 0; } /** @@ -103,7 +103,7 @@ public: */ T& operator*() { - DALI_ASSERT_DEBUG( mObject != NULL ); + DALI_ASSERT_DEBUG( mObject != 0 ); return *mObject; } @@ -114,7 +114,7 @@ public: */ T& operator*() const { - DALI_ASSERT_DEBUG( mObject != NULL ); + DALI_ASSERT_DEBUG( mObject != 0 ); // Pointer semantics: A const pointer does not mean const data. return const_cast< T& >( *mObject ); @@ -153,10 +153,10 @@ public: */ void Reset() { - if ( mObject != NULL ) + if ( mObject != 0 ) { delete mObject; - mObject = NULL; + mObject = 0; } } @@ -167,7 +167,7 @@ public: T* Release() { T* tmp = mObject; - mObject = NULL; + mObject = 0; return tmp; } @@ -189,11 +189,11 @@ public: /** * Converts an object handle to a BooleanType. - * This is useful for checking whether the handle is NULL. + * This is useful for checking whether the handle is null. */ operator BooleanType() const { - return (mObject != NULL) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : NULL; + return (mObject != 0) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : 0; } private: @@ -213,7 +213,7 @@ private: void Init( OwnerPointer& ownerPointer ) { mObject = ownerPointer.mObject; - ownerPointer.mObject = NULL; + ownerPointer.mObject = 0; } // data diff --git a/dali/internal/event/common/property-input-impl.h b/dali/internal/event/common/property-input-impl.h index 367c28b..64d5022 100644 --- a/dali/internal/event/common/property-input-impl.h +++ b/dali/internal/event/common/property-input-impl.h @@ -28,6 +28,9 @@ #include #include +/// External Includes +#include + namespace Dali { @@ -311,6 +314,7 @@ public: * Print the property value using a stream. * @param[in] debugStream The output stream. * @param[in] bufferIndex The buffer to read from. + * @todo Place this far-too-large-to-be-inlined function in a cpp and remove header dependency from this file. */ void DebugPrint( std::ostream& debugStream, BufferIndex bufferIndex ) const { diff --git a/dali/internal/event/modeling/model-logger.cpp b/dali/internal/event/modeling/model-logger.cpp index c77aa4b..bed6b61 100644 --- a/dali/internal/event/modeling/model-logger.cpp +++ b/dali/internal/event/modeling/model-logger.cpp @@ -18,11 +18,6 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include -#include -#include - // INTERNAL INCLUDES #include #include @@ -37,6 +32,11 @@ #include #include +// EXTERNAL INCLUDES +#include +#include +#include + using std::cout; using std::endl; using std::string; diff --git a/dali/internal/update/node-attachments/node-attachment.h b/dali/internal/update/node-attachments/node-attachment.h index 43a9e2f..098aa69 100644 --- a/dali/internal/update/node-attachments/node-attachment.h +++ b/dali/internal/update/node-attachments/node-attachment.h @@ -71,21 +71,21 @@ public: /** * Retrieve the parent node of a NodeAttachment. - * @return The parent node, or NULL if the NodeAttachment has not been added to the scene-graph. + * @return The parent node, or null if the NodeAttachment has not been added to the scene-graph. */ Node& GetParent() { - DALI_ASSERT_DEBUG( mParent != NULL ); + DALI_ASSERT_DEBUG( mParent != 0 ); return *mParent; } /** * Retrieve the parent node of a NodeAttachment. - * @return The parent node, or NULL if the NodeAttachment has not been added to the scene-graph. + * @return The parent node, or null if the NodeAttachment has not been added to the scene-graph. */ Node& GetParent() const { - DALI_ASSERT_DEBUG( mParent != NULL ); + DALI_ASSERT_DEBUG( mParent != 0 ); return *mParent; } @@ -97,12 +97,12 @@ public: */ bool IsRenderable() { - return (GetRenderable() != NULL); + return (GetRenderable() != 0); } /** * Convert an attachment to a renderable attachment. - * @return A pointer to the renderable attachment, or NULL. + * @return A pointer to the renderable attachment, or null. */ virtual RenderableAttachment* GetRenderable() = 0; diff --git a/dali/internal/update/queue/update-message-queue.cpp b/dali/internal/update/queue/update-message-queue.cpp index a89a760..c96835c 100644 --- a/dali/internal/update/queue/update-message-queue.cpp +++ b/dali/internal/update/queue/update-message-queue.cpp @@ -147,7 +147,7 @@ void MessageQueue::EventProcessingStarted() mImpl->processingEvents = true; } -unsigned int* MessageQueue::ReserveMessageSlot( std::size_t requestedSize, bool updateScene ) +unsigned int* MessageQueue::ReserveMessageSlot( unsigned int requestedSize, bool updateScene ) { DALI_ASSERT_DEBUG( 0 != requestedSize ); diff --git a/dali/internal/update/queue/update-message-queue.h b/dali/internal/update/queue/update-message-queue.h index 56db217..7328c7d 100644 --- a/dali/internal/update/queue/update-message-queue.h +++ b/dali/internal/update/queue/update-message-queue.h @@ -70,7 +70,7 @@ public: /** * @copydoc Dali::Internal::EventToUpdate::ReserveMessageSlot() */ - virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene ); + virtual unsigned int* ReserveMessageSlot( unsigned int size, bool updateScene ); /** * @copydoc Dali::Internal::EventToUpdate::GetEventBufferIndex() diff --git a/dali/public-api/common/constants.cpp b/dali/public-api/common/constants.cpp index 22fb14f..60781d3 100644 --- a/dali/public-api/common/constants.cpp +++ b/dali/public-api/common/constants.cpp @@ -22,6 +22,9 @@ #include #include +// EXTERNAL INCLUDES +#include + namespace Dali { diff --git a/dali/public-api/common/dali-common.h b/dali/public-api/common/dali-common.h index c5920c1..a4d0c73 100644 --- a/dali/public-api/common/dali-common.h +++ b/dali/public-api/common/dali-common.h @@ -19,7 +19,6 @@ */ // EXTERNAL INCLUDES -#include #ifdef EMSCRIPTEN #include diff --git a/dali/public-api/common/dali-vector.h b/dali/public-api/common/dali-vector.h index c8ba06b..c677b5e 100644 --- a/dali/public-api/common/dali-vector.h +++ b/dali/public-api/common/dali-vector.h @@ -18,13 +18,14 @@ * */ -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include #include +// EXTERNAL INCLUDES +#include +#include + /** * @brief For DALi internal use asserts are enabled in debug builds. * diff --git a/dali/public-api/math/math-utils.h b/dali/public-api/math/math-utils.h index 2c74ea3..cb56fd5 100644 --- a/dali/public-api/math/math-utils.h +++ b/dali/public-api/math/math-utils.h @@ -18,9 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include // std::min & max - // INTERNAL INCLUDES #include #include @@ -76,7 +73,9 @@ inline bool IsPowerOfTwo( unsigned int i ) template< typename T > inline const T& Clamp( const T& value, const T& min, const T& max ) { - return std::max( std::min( value, max ), min ); + const T& constrainedUpper = value < max ? value : max; + const T& constrainedUpperAndLower = constrainedUpper > min ? constrainedUpper : min; + return constrainedUpperAndLower; } /** @@ -89,7 +88,9 @@ inline const T& Clamp( const T& value, const T& min, const T& max ) template< typename T > inline void ClampInPlace( T& value, const T& min, const T& max ) { - value = std::max( std::min( value, max ), min ); + const T& constrainedUpper = value < max ? value : max; + const T& constrainedUpperAndLower = constrainedUpper > min ? constrainedUpper : min; + value = constrainedUpperAndLower; } @@ -115,29 +116,31 @@ inline const T Lerp( const float offset, const T& low, const T& high ) * @param[in] b the second value in the range. * @return a suitable epsilon */ -inline float GetRangedEpsilon(float a, float b) +inline float GetRangedEpsilon( float a, float b ) { - float abs_f = std::max(fabsf(a), fabsf(b)); - int abs_i = (int) abs_f; + const float absA = fabsf( a ); + const float absB = fabsf( b ); + const float absF = absA > absB ? absA : absB; + const int absI = absF; float epsilon = Math::MACHINE_EPSILON_10000; - if (abs_f < 0.1f) + if (absF < 0.1f) { return Math::MACHINE_EPSILON_0; } - else if (abs_i < 2) + else if (absI < 2) { return Math::MACHINE_EPSILON_1; } - else if (abs_i < 20) + else if (absI < 20) { return Math::MACHINE_EPSILON_10; } - else if (abs_i < 200) + else if (absI < 200) { return Math::MACHINE_EPSILON_100; } - else if (abs_i < 2000) + else if (absI < 2000) { return Math::MACHINE_EPSILON_1000; } diff --git a/dali/public-api/math/matrix.cpp b/dali/public-api/math/matrix.cpp index cdbc9f8..e2be143 100644 --- a/dali/public-api/math/matrix.cpp +++ b/dali/public-api/math/matrix.cpp @@ -18,10 +18,6 @@ // CLASS HEADERS #include -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES #include #include @@ -30,6 +26,11 @@ #include #include +// EXTERNAL INCLUDES +#include +#include +#include + namespace { const float ROTATION_EPSILON = 0.003f; // Deliberately large diff --git a/dali/public-api/math/matrix.h b/dali/public-api/math/matrix.h index 5e44903..15b8d7d 100644 --- a/dali/public-api/math/matrix.h +++ b/dali/public-api/math/matrix.h @@ -18,9 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include diff --git a/dali/public-api/math/matrix3.cpp b/dali/public-api/math/matrix3.cpp index 773b6ee..bfc1a0a 100644 --- a/dali/public-api/math/matrix3.cpp +++ b/dali/public-api/math/matrix3.cpp @@ -18,11 +18,13 @@ // CLASS HEADER #include +// INTERNAL INCLUDES +#include + // EXTERNAL INCLUDES #include +#include -// INTERNAL INCLUDES -#include #define S00 0 #define S01 1 diff --git a/dali/public-api/math/quaternion.cpp b/dali/public-api/math/quaternion.cpp index 167f51a..05140df 100644 --- a/dali/public-api/math/quaternion.cpp +++ b/dali/public-api/math/quaternion.cpp @@ -26,6 +26,9 @@ #include #include +// EXTERNAL INCLUDES +#include + namespace Dali { using Internal::PerformanceMonitor; @@ -135,6 +138,16 @@ Quaternion::~Quaternion() { } +bool Quaternion::IsIdentity() const +{ + // start from w as its unlikely that any real rotation has w == 1 + // Uses a relaxed epsilon, as composition of rotation introduces error + return ( ( fabsf( mVector.w - 1.0f ) < Math::MACHINE_EPSILON_10 )&& + ( fabsf( mVector.x ) < Math::MACHINE_EPSILON_10 )&& + ( fabsf( mVector.y ) < Math::MACHINE_EPSILON_10 )&& + ( fabsf( mVector.z ) < Math::MACHINE_EPSILON_10 ) ); +} + bool Quaternion::ToAxisAngle(Vector3 &axis, float &angle) const { angle = acosf(mVector.w); diff --git a/dali/public-api/math/quaternion.h b/dali/public-api/math/quaternion.h index 98dbb3c..2a4ac8c 100644 --- a/dali/public-api/math/quaternion.h +++ b/dali/public-api/math/quaternion.h @@ -18,10 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES #include #include @@ -136,15 +132,7 @@ public: * * @return true if this is identity quaternion */ - bool IsIdentity() const - { - // start from w as its unlikely that any real rotation has w == 1 - // Uses a relaxed epsilon, as composition of rotation introduces error - return ( ( fabsf( mVector.w - 1.0f ) < Math::MACHINE_EPSILON_10 )&& - ( fabsf( mVector.x ) < Math::MACHINE_EPSILON_10 )&& - ( fabsf( mVector.y ) < Math::MACHINE_EPSILON_10 )&& - ( fabsf( mVector.z ) < Math::MACHINE_EPSILON_10 ) ); - } + bool IsIdentity() const; /** * @brief Convert the quaternion to an axis/angle pair. diff --git a/dali/public-api/math/vector2.cpp b/dali/public-api/math/vector2.cpp index 52500ef..e50b073 100644 --- a/dali/public-api/math/vector2.cpp +++ b/dali/public-api/math/vector2.cpp @@ -18,15 +18,16 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include #include #include #include +// EXTERNAL INCLUDES +#include +#include + namespace Dali { diff --git a/dali/public-api/math/vector2.h b/dali/public-api/math/vector2.h index 267a8a4..b1df40d 100644 --- a/dali/public-api/math/vector2.h +++ b/dali/public-api/math/vector2.h @@ -18,13 +18,12 @@ * */ -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include + namespace Dali { @@ -442,7 +441,7 @@ DALI_IMPORT_API std::ostream& operator<< (std::ostream& o, const Vector2& vector */ inline Vector2 Min( const Vector2& a, const Vector2& b ) { - return Vector2( std::min(a.x,b.x), std::min(a.y,b.y) ); + return Vector2( a.x < b.x ? a.x : b.x , a.y < b.y ? a.y : b.y ); } /** @@ -455,7 +454,7 @@ inline Vector2 Min( const Vector2& a, const Vector2& b ) */ inline Vector2 Max( const Vector2& a, const Vector2& b ) { - return Vector2( std::max(a.x,b.x), std::max(a.y,b.y) ); + return Vector2( a.x > b.x ? a.x : b.x , a.y > b.y ? a.y : b.y ); } /** diff --git a/dali/public-api/math/vector3.cpp b/dali/public-api/math/vector3.cpp index 099a68c..9afb55b 100644 --- a/dali/public-api/math/vector3.cpp +++ b/dali/public-api/math/vector3.cpp @@ -19,9 +19,6 @@ #include #include -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include #include @@ -29,6 +26,10 @@ #include #include +// EXTERNAL INCLUDES +#include +#include + namespace Dali { using Internal::PerformanceMonitor; diff --git a/dali/public-api/math/vector3.h b/dali/public-api/math/vector3.h index d37217f..b6121ef 100644 --- a/dali/public-api/math/vector3.h +++ b/dali/public-api/math/vector3.h @@ -18,13 +18,12 @@ * */ -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include + namespace Dali { @@ -526,7 +525,9 @@ DALI_IMPORT_API std::ostream& operator<< (std::ostream& o, const Vector3& vector */ inline Vector3 Min( const Vector3& a, const Vector3& b ) { - return Vector3( std::min(a.x,b.x), std::min(a.y,b.y), std::min(a.z,b.z) ); + return Vector3( a.x < b.x ? a.x : b.x , + a.y < b.y ? a.y : b.y, + a.z < b.z ? a.z : b.z ); } /** @@ -539,7 +540,9 @@ inline Vector3 Min( const Vector3& a, const Vector3& b ) */ inline Vector3 Max( const Vector3& a, const Vector3& b ) { - return Vector3( std::max(a.x,b.x), std::max(a.y,b.y), std::max(a.z,b.z) ); + return Vector3( a.x > b.x ? a.x : b.x, + a.y > b.y ? a.y : b.y, + a.z > b.z ? a.z : b.z ); } /** diff --git a/dali/public-api/math/vector4.cpp b/dali/public-api/math/vector4.cpp index 1dbe51b..e0cbb59 100644 --- a/dali/public-api/math/vector4.cpp +++ b/dali/public-api/math/vector4.cpp @@ -18,9 +18,6 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include #include @@ -28,6 +25,10 @@ #include #include +// EXTERNAL INCLUDES +#include +#include + namespace Dali { diff --git a/dali/public-api/math/vector4.h b/dali/public-api/math/vector4.h index 473d8a4..d0a5b85 100644 --- a/dali/public-api/math/vector4.h +++ b/dali/public-api/math/vector4.h @@ -18,14 +18,12 @@ * */ -// EXTERNAL INCLUDES -#include -#include -#include - // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include + namespace Dali { struct Vector2; @@ -47,7 +45,6 @@ struct DALI_IMPORT_API Vector4 /** * @brief Default constructor, initializes the vector to 0. - * */ Vector4() : x(0.0f), @@ -531,7 +528,10 @@ DALI_IMPORT_API std::ostream& operator<<(std::ostream& o, const Vector4& vector) */ inline Vector4 Min( const Vector4& a, const Vector4& b ) { - return Vector4( std::min(a.x,b.x), std::min(a.y,b.y), std::min(a.z,b.z), std::min(a.w,b.w) ); + return Vector4( a.x < b.x ? a.x : b.x, + a.y < b.y ? a.y : b.y, + a.z < b.z ? a.z : b.z, + a.w < b.w ? a.w : b.w ); } /** @@ -544,7 +544,10 @@ inline Vector4 Min( const Vector4& a, const Vector4& b ) */ inline Vector4 Max( const Vector4& a, const Vector4& b ) { - return Vector4( std::max(a.x,b.x), std::max(a.y,b.y), std::max(a.z,b.z), std::max(a.w,b.w) ); + return Vector4( a.x > b.x ? a.x : b.x, + a.y > b.y ? a.y : b.y, + a.z > b.z ? a.z : b.z, + a.w > b.w ? a.w : b.w ); } /** diff --git a/dali/public-api/modeling/bone.h b/dali/public-api/modeling/bone.h index 7db2189..d90a7a8 100644 --- a/dali/public-api/modeling/bone.h +++ b/dali/public-api/modeling/bone.h @@ -23,6 +23,9 @@ #include #include +// EXTERNAL INCLUDES +#include + namespace Dali { diff --git a/dali/public-api/object/any.h b/dali/public-api/object/any.h index bede5f5..3268cb3 100644 --- a/dali/public-api/object/any.h +++ b/dali/public-api/object/any.h @@ -18,13 +18,12 @@ * */ -// EXTERNAL INCLUDES -#include // operator typeid - - // INTERNAL INCLUDES #include +// EXTERNAL INCLUDES +#include // operator typeid + namespace Dali { @@ -79,14 +78,14 @@ public: Any( const Any& any ) { // If container isn't empty then copy the container? - if ( NULL != any.mContainer ) + if ( 0 != any.mContainer ) { mContainer = any.mContainer->mCloneFunc( *any.mContainer ); } else { // Otherwise mark new container as empty - mContainer = NULL; + mContainer = 0; } } @@ -101,7 +100,7 @@ public: Any& operator=( const Type& value ) { // If the container is empty then assign the new value - if ( NULL == mContainer ) + if ( 0 == mContainer ) { mContainer = new AnyContainerImpl< Type >( value ); } @@ -160,9 +159,9 @@ public: const Type& Get() const { - if ( NULL == mContainer ) + if ( 0 == mContainer ) { - AssertAlways( "Any::Get(). mContainer is NULL" ); + AssertAlways( "Any::Get(). mContainer is null" ); } // Check if the value has the same value than the Any type. @@ -176,14 +175,14 @@ public: /** * @brief Return pointer of Type to the value stored * - * @return pointer to the value or NULL if no value is contained + * @return pointer to the value or null if no value is contained */ template Type* GetPointer() { - if( NULL == mContainer ) + if( 0 == mContainer ) { - return NULL; + return 0; } // Check if the value has the same value than the Any type. if( mContainer->GetType() != typeid( Type ) ) @@ -196,14 +195,14 @@ public: /** * @brief Return pointer of Type to the value stored * - * @return pointer to the value or NULL if no value is contained + * @return pointer to the value or null if no value is contained */ template const Type* GetPointer() const { - if( NULL == mContainer ) + if( 0 == mContainer ) { - return NULL; + return 0; } // Check if the value has the same value than the Any type. if( mContainer->GetType() != typeid( Type ) ) @@ -220,7 +219,7 @@ public: */ bool Empty() const { - return ( NULL == mContainer ) ? true : false; + return ( 0 == mContainer ) ? true : false; } struct AnyContainerBase; // Forward declaration for typedef @@ -377,7 +376,7 @@ public: */ /** - * @brief Extract a pointer to the held type of an Any object from a pointer to that Any object (NULL if empty ) + * @brief Extract a pointer to the held type of an Any object from a pointer to that Any object (null if empty ) * * @param any Pointer to an Any object * @@ -390,7 +389,7 @@ inline Type* AnyCast( Any* any ) } /** - * @brief Extract a const pointer to the held type of an Any object from a pointer to that Any object (NULL if empty ) + * @brief Extract a const pointer to the held type of an Any object from a pointer to that Any object (null if empty ) * * @param any const Pointer to an Any object * diff --git a/dali/public-api/signals/callback.cpp b/dali/public-api/signals/callback.cpp index ca9044d..7b61117 100644 --- a/dali/public-api/signals/callback.cpp +++ b/dali/public-api/signals/callback.cpp @@ -25,8 +25,8 @@ namespace Dali // CallbackBase CallbackBase::CallbackBase() -: mImpl( NULL ), - mFunction( NULL ) +: mImpl( 0 ), + mFunction( 0 ) { } @@ -36,7 +36,7 @@ CallbackBase::~CallbackBase() } CallbackBase::CallbackBase( Function function ) -: mImpl( NULL ), +: mImpl( 0 ), mFunction( function ) { } @@ -47,7 +47,7 @@ CallbackBase::CallbackBase( void* object, MemberFunction function, Dispatcher di mImpl = new CallbackBase::Impl; mImpl->mObjectPointer = object; mImpl->mMemberFunctionDispatcher = dispatcher; - mImpl->mDestructorDispatcher = NULL; // object is not owned + mImpl->mDestructorDispatcher = 0; // object is not owned } CallbackBase::CallbackBase( void* object, MemberFunction function, Dispatcher dispatcher, Destructor destructor ) @@ -72,18 +72,18 @@ void CallbackBase::Reset() } delete mImpl; - mImpl = NULL; + mImpl = 0; } - mFunction = NULL; + mFunction = 0; } // CallbackBase::Impl CallbackBase::Impl::Impl() -: mObjectPointer( NULL ), - mMemberFunctionDispatcher( NULL ), - mDestructorDispatcher( NULL ) +: mObjectPointer( 0 ), + mMemberFunctionDispatcher( 0 ), + mDestructorDispatcher( 0 ) { } diff --git a/dali/public-api/signals/callback.h b/dali/public-api/signals/callback.h index ca266de..5dbb60b 100644 --- a/dali/public-api/signals/callback.h +++ b/dali/public-api/signals/callback.h @@ -306,7 +306,7 @@ protected: // Constructors for deriving classes typedef void (*Dispatcher)( CallbackBase& base ); /** - * @brief Used to destroy mObjectPointer (NULL if not mObjectPointer is not owned) + * @brief Used to destroy mObjectPointer (null if not mObjectPointer is not owned) */ typedef void(*Destructor)(void* object); @@ -354,9 +354,9 @@ public: // Data for deriving classes & Dispatchers { Impl(); ///< Default constructor - void* mObjectPointer; ///< Object whose member function will be called. Not owned if mDestructorDispatcher is NULL. + void* mObjectPointer; ///< Object whose member function will be called. Not owned if mDestructorDispatcher is null. Dispatcher mMemberFunctionDispatcher; ///< Dispatcher for member functions - Destructor mDestructorDispatcher; ///< Destructor for owned objects. NULL if mDestructorDispatcher is not owned. + Destructor mDestructorDispatcher; ///< Destructor for owned objects. null if mDestructorDispatcher is not owned. }; Impl* mImpl; ///< Implementation pointer @@ -1081,7 +1081,7 @@ public: */ CallbackFunctor0( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher0::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1121,7 +1121,7 @@ public: */ CallbackFunctor1( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher1::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1162,7 +1162,7 @@ public: */ CallbackFunctor2( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher2::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1203,7 +1203,7 @@ public: */ CallbackFunctor3( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher3::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1245,7 +1245,7 @@ public: */ CallbackFunctorReturn0( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn0::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1286,7 +1286,7 @@ public: */ CallbackFunctorReturn1( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn1::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1327,7 +1327,7 @@ public: */ CallbackFunctorReturn2( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn2::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; @@ -1368,7 +1368,7 @@ public: */ CallbackFunctorReturn3( const T& object ) : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object - NULL, // uses operator() instead of member function + 0, // uses operator() instead of member function reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn3::Dispatch ), reinterpret_cast< CallbackBase::Destructor >( &Destroyer::Delete ) ) { } }; diff --git a/dali/public-api/signals/signal-slot-connections.cpp b/dali/public-api/signals/signal-slot-connections.cpp index 531d286..6007f69 100644 --- a/dali/public-api/signals/signal-slot-connections.cpp +++ b/dali/public-api/signals/signal-slot-connections.cpp @@ -45,7 +45,7 @@ SlotObserver* SlotConnection::GetSlotObserver() } SignalConnection::SignalConnection( CallbackBase* callback ) -: mSignalObserver( NULL ), +: mSignalObserver( 0 ), mCallback( callback ) { } @@ -68,12 +68,12 @@ void SignalConnection::Disconnect( SlotObserver* slotObserver ) { // tell the slot the signal wants to disconnect mSignalObserver->SignalDisconnected( slotObserver, mCallback ); - mSignalObserver = NULL; + mSignalObserver = 0; } // we own the callback, SignalObserver is expected to delete the SlotConnection on Disconnected so its pointer to our mCallback is no longer used delete mCallback; - mCallback = NULL; + mCallback = 0; } CallbackBase* SignalConnection::GetCallback() diff --git a/dali/public-api/text/utf8.cpp b/dali/public-api/text/utf8.cpp index 5142c68..9688c39 100644 --- a/dali/public-api/text/utf8.cpp +++ b/dali/public-api/text/utf8.cpp @@ -23,7 +23,7 @@ namespace Dali { -size_t Utf8SequenceLength(const unsigned char leadByte) +unsigned int Utf8SequenceLength(const unsigned char leadByte) { return Internal::UTF8SequenceLength( leadByte ); } diff --git a/dali/public-api/text/utf8.h b/dali/public-api/text/utf8.h index 0183a90..1c3553a 100644 --- a/dali/public-api/text/utf8.h +++ b/dali/public-api/text/utf8.h @@ -29,7 +29,7 @@ namespace Dali * @param[in] leadByte The lead byte of a UTF-8 character sequence * @return The length of the sequence, or zero if the UTF-8 character is invalid. */ -DALI_IMPORT_API size_t Utf8SequenceLength(const unsigned char leadByte); +DALI_IMPORT_API unsigned int Utf8SequenceLength(const unsigned char leadByte); } // namespace Dali -- 2.7.4