From: David Steele Date: Tue, 20 Dec 2022 10:23:11 +0000 (+0000) Subject: Fixing static analysis bugs X-Git-Tag: dali_2.2.7~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95a78bd1fd957ef34782961e7b6c93c9e587a072;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Fixing static analysis bugs Change-Id: I58dbff61812fe6e3ab2ec7cd1b5bc238b3e22f8b --- diff --git a/dali/internal/accessibility/bridge/bridge-impl.cpp b/dali/internal/accessibility/bridge/bridge-impl.cpp index b4df08e..215e0fb 100644 --- a/dali/internal/accessibility/bridge/bridge-impl.cpp +++ b/dali/internal/accessibility/bridge/bridge-impl.cpp @@ -30,17 +30,17 @@ #include #include #include +#include #include #include #include -#include #include +#include #include #include #include #include #include -#include #include #include #include @@ -49,7 +49,6 @@ using namespace Dali::Accessibility; namespace // unnamed namespace { - const int RETRY_INTERVAL = 1000; } // unnamed namespace @@ -72,15 +71,15 @@ class BridgeImpl : public virtual BridgeBase, public BridgeHyperlink, public BridgeSocket { - DBus::DBusClient mAccessibilityStatusClient; - DBus::DBusClient mRegistryClient; - DBus::DBusClient mDirectReadingClient; - bool mIsScreenReaderEnabled = false; - bool mIsEnabled = false; - std::unordered_map> mDirectReadingCallbacks; + DBus::DBusClient mAccessibilityStatusClient{}; + DBus::DBusClient mRegistryClient{}; + DBus::DBusClient mDirectReadingClient{}; + bool mIsScreenReaderEnabled{false}; + bool mIsEnabled{false}; + std::unordered_map> mDirectReadingCallbacks{}; Dali::Actor mHighlightedActor; - std::function mHighlightClearAction; - Dali::CallbackBase* mIdleCallback = NULL; + std::function mHighlightClearAction{nullptr}; + Dali::CallbackBase* mIdleCallback{}; Dali::Timer mInitializeTimer; Dali::Timer mReadIsEnabledTimer; Dali::Timer mReadScreenReaderEnabledTimer; @@ -88,9 +87,7 @@ class BridgeImpl : public virtual BridgeBase, std::string mPreferredBusName; public: - BridgeImpl() - { - } + BridgeImpl() = default; /** * @copydoc Dali::Accessibility::Bridge::Emit() @@ -148,7 +145,7 @@ public: LOG() << "Direct reading command failed (" << msg.getError().message << ")\n"; } }, - true); + true); } /** @@ -167,7 +164,7 @@ public: LOG() << "Direct reading command failed (" << msg.getError().message << ")\n"; } }, - false); + false); } /** @@ -186,7 +183,7 @@ public: LOG() << "Direct reading command failed (" << msg.getError().message << ")\n"; } }, - alsoNonDiscardable); + alsoNonDiscardable); } /** @@ -209,8 +206,8 @@ public: mDirectReadingCallbacks.emplace(std::get<2>(msg), callback); } }, - text, - discardable); + text, + discardable); } /** @@ -235,8 +232,8 @@ public: mHighlightedActor = {}; mHighlightClearAction = {}; BridgeAccessible::ForceDown(); - mRegistryClient = {}; - mDirectReadingClient = {}; + mRegistryClient = {}; + mDirectReadingClient = {}; mDirectReadingCallbacks.clear(); mApplication.mChildren.clear(); ClearTimer(); @@ -289,9 +286,9 @@ public: { Dali::Adaptor::Get().RemoveIdle(mIdleCallback); } - mAccessibilityStatusClient = {}; - mDbusServer = {}; - mConnectionPtr = {}; + mAccessibilityStatusClient = {}; + mDbusServer = {}; + mConnectionPtr = {}; } bool ForceUpTimerCallback() @@ -624,7 +621,7 @@ public: void ReadScreenReaderEnabledProperty() { // can be true because of SuppressScreenReader before init - if (!mAccessibilityStatusClient) + if(!mAccessibilityStatusClient) { return; } @@ -658,7 +655,7 @@ public: void EmitScreenReaderEnabledSignal() { - if (mIsScreenReaderEnabled) + if(mIsScreenReaderEnabled) { mScreenReaderEnabledSignal.Emit(); } @@ -690,7 +687,7 @@ public: { mAccessibilityStatusClient = DBus::DBusClient{A11yDbusName, A11yDbusPath, A11yDbusStatusInterface, DBus::ConnectionType::SESSION}; - if (!mAccessibilityStatusClient) + if(!mAccessibilityStatusClient) { DALI_LOG_ERROR("Accessibility Status DbusClient is not ready\n"); return false; @@ -701,7 +698,7 @@ public: bool InitializeTimerCallback() { - if ( InitializeAccessibilityStatusClient() ) + if(InitializeAccessibilityStatusClient()) { ReadAndListenProperties(); return false; @@ -711,7 +708,7 @@ public: bool OnIdleSignal() { - if ( InitializeAccessibilityStatusClient() ) + if(InitializeAccessibilityStatusClient()) { ReadAndListenProperties(); mIdleCallback = NULL; @@ -734,20 +731,20 @@ public: */ void Initialize() override { - if ( InitializeAccessibilityStatusClient() ) + if(InitializeAccessibilityStatusClient()) { ReadAndListenProperties(); return; } // Initialize failed. Try it again on Idle - if( Dali::Adaptor::IsAvailable() ) + if(Dali::Adaptor::IsAvailable()) { Dali::Adaptor& adaptor = Dali::Adaptor::Get(); - if( NULL == mIdleCallback ) + if(NULL == mIdleCallback) { - mIdleCallback = MakeCallback( this, &BridgeImpl::OnIdleSignal ); - adaptor.AddIdle( mIdleCallback, true ); + mIdleCallback = MakeCallback(this, &BridgeImpl::OnIdleSignal); + adaptor.AddIdle(mIdleCallback, true); } } } @@ -860,7 +857,6 @@ private: namespace // unnamed namespace { - bool INITIALIZED_BRIDGE = false; /** diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index a3d81ac..d32f881 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -536,7 +536,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() uint64_t timeToSleepUntil = 0; int extraFramesDropped = 0; - const uint64_t memPoolInterval = mEnvironmentOptions.GetMemoryPoolInterval() * NANOSECONDS_PER_SECOND; + const uint64_t memPoolInterval = 1e9 * float(mEnvironmentOptions.GetMemoryPoolInterval()); const unsigned int renderToFboInterval = mEnvironmentOptions.GetRenderToFboInterval(); const bool renderToFboEnabled = 0u != renderToFboInterval; diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller.h b/dali/internal/graphics/gles-impl/egl-graphics-controller.h index 1db48a2..33918b5 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.h @@ -835,7 +835,7 @@ private: GLES::TextureDependencyChecker mTextureDependencyChecker; // Checks if FBO textures need syncing GLES::SyncPool mSyncPool; - std::size_t mCapacity; ///< Memory Usage (of command buffers) + std::size_t mCapacity{0u}; ///< Memory Usage (of command buffers) }; } // namespace Graphics