X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=blobdiff_plain;f=dali%2Fpublic-api%2Fsignals%2Fbase-signal.cpp;h=b03f9d0f62a9932f6b13e5f08fd03568d10b8072;hp=c84393ac60bc392657070b92c986de0067560f53;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hpb=b41db98148be41ef5928f4335e985bf62252dde7 diff --git a/dali/public-api/signals/base-signal.cpp b/dali/public-api/signals/base-signal.cpp index c84393a..b03f9d0 100644 --- a/dali/public-api/signals/base-signal.cpp +++ b/dali/public-api/signals/base-signal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -27,7 +27,7 @@ namespace { -const int INVALID_CALLBACK_INDEX = -1; +const int32_t INVALID_CALLBACK_INDEX = -1; } // unnamed namespace @@ -120,7 +120,7 @@ void BaseSignal::OnConnect( CallbackBase* callback ) { DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" ); - int index = FindCallback( callback ); + int32_t index = FindCallback( callback ); // Don't double-connect the same callback if( INVALID_CALLBACK_INDEX == index ) @@ -141,7 +141,7 @@ void BaseSignal::OnDisconnect( CallbackBase* callback ) { DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" ); - int index = FindCallback( callback ); + int32_t index = FindCallback( callback ); if( index > INVALID_CALLBACK_INDEX ) { @@ -157,7 +157,7 @@ void BaseSignal::OnConnect( ConnectionTrackerInterface* tracker, CallbackBase* c DALI_ASSERT_ALWAYS( NULL != tracker && "Invalid ConnectionTrackerInterface pointer passed to Connect()" ); DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" ); - int index = FindCallback( callback ); + int32_t index = FindCallback( callback ); // Don't double-connect the same callback if( INVALID_CALLBACK_INDEX == index ) @@ -182,7 +182,7 @@ void BaseSignal::OnDisconnect( ConnectionTrackerInterface* tracker, CallbackBase DALI_ASSERT_ALWAYS( NULL != tracker && "Invalid ConnectionTrackerInterface pointer passed to Disconnect()" ); DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" ); - int index = FindCallback( callback ); + int32_t index = FindCallback( callback ); if( index > INVALID_CALLBACK_INDEX ) { @@ -239,23 +239,22 @@ CallbackBase* BaseSignal::GetCallback( std::size_t connectionIndex ) const return callback; } -int BaseSignal::FindCallback( CallbackBase* callback ) +int32_t BaseSignal::FindCallback( CallbackBase* callback ) { - int index( INVALID_CALLBACK_INDEX ); + int32_t index( INVALID_CALLBACK_INDEX ); // A signal can have multiple slots connected to it. // We need to search for the slot which has the same call back function (if it's static) // Or the same object / member function (for non-static) - const std::size_t count( mSignalConnections.Count() ); - for( std::size_t i=0; i < count; ++i ) + const std::size_t count = mSignalConnections.Count(); + for( std::size_t i = 0; i < count; ++i ) { const CallbackBase* connectionCallback = GetCallback( i ); // Note that values are set to NULL in DeleteConnection - if( connectionCallback && - ( *connectionCallback == *callback ) ) + if( connectionCallback && ( *connectionCallback == *callback ) ) { - index = i; + index = static_cast( i ); // only 2,147,483,647 connections supported, no error check break; } }