diff --git a/frameworks/ims/input_event_listener_proxy.cpp b/frameworks/ims/input_event_listener_proxy.cpp index c821d77ee354fe89b722ed39135c9367e9560254..5282a9906b3496bd7a10f2770ca3c65d6db26a1f 100644 --- a/frameworks/ims/input_event_listener_proxy.cpp +++ b/frameworks/ims/input_event_listener_proxy.cpp @@ -107,9 +107,7 @@ bool InputEventListenerProxy::UnregisterInputEventListener() IpcIoInit(&io, tmpData, IMS_DEFAULT_IPC_SIZE, 1); int32_t ret = proxy_->Invoke(proxy_, LITEIMS_CLIENT_UNREGISTER, &io, NULL, NULL); if (ret == 0) { - if (listener_ != nullptr) { - listener_ = nullptr; - } + listener_ = nullptr; return true; } } diff --git a/frameworks/wms/lite_proxy_surface.h b/frameworks/wms/lite_proxy_surface.h index 36d69f263f6f4d3942fbc8fd641562a1ced4feac..8016d38a7b4f8cc1b3798af8a3fc29671972b52e 100644 --- a/frameworks/wms/lite_proxy_surface.h +++ b/frameworks/wms/lite_proxy_surface.h @@ -23,7 +23,7 @@ namespace OHOS { class LiteProxySurface : public ISurface { public: - LiteProxySurface(Surface* surface); + explicit LiteProxySurface(Surface* surface); virtual ~LiteProxySurface(); virtual void Lock(void** buf, void** phyMem, uint32_t* strideLen) override; diff --git a/frameworks/wms/lite_proxy_windows_manager.cpp b/frameworks/wms/lite_proxy_windows_manager.cpp index 7e1fe2ed6622bfd6fc9541c66672d9f4b8b3d5fa..d2d9888cace7071f46120250d318e9b82bfdaa92 100644 --- a/frameworks/wms/lite_proxy_windows_manager.cpp +++ b/frameworks/wms/lite_proxy_windows_manager.cpp @@ -40,11 +40,11 @@ IWindow* LiteProxyWindowsManager::CreateWindow(const LiteWinConfig& config) } } -void LiteProxyWindowsManager::RemoveWindow(IWindow* window) +void LiteProxyWindowsManager::RemoveWindow(IWindow* win) { - if (window != nullptr) { - int32_t id = window->GetWindowId(); - delete window; + if (win != nullptr) { + int32_t id = win->GetWindowId(); + delete win; LiteWMRequestor::GetInstance()->RemoveWindow(id); } } diff --git a/frameworks/wms/lite_win_requestor.cpp b/frameworks/wms/lite_win_requestor.cpp index f1471261c06332b2be3036465ff6b8fccb0223c1..652ef728ce3868c75ff7c125d44e8d7429128dcc 100644 --- a/frameworks/wms/lite_win_requestor.cpp +++ b/frameworks/wms/lite_win_requestor.cpp @@ -48,7 +48,7 @@ int LiteWinRequestor::Callback(void* owner, int code, IpcIo* reply) GRAPHIC_LOGD("Callback, funcId = %d", para->funcId); switch (para->funcId) { case LiteWMS_GetSurface: { - LiteWinRequestor* requestor = (LiteWinRequestor*)(para->data); + LiteWinRequestor* requestor = static_cast(para->data); int32_t ret; ReadInt32(reply, &ret); if ((ret == LiteWMS_EOK) && (requestor != nullptr)) { diff --git a/frameworks/wms/lite_win_requestor.h b/frameworks/wms/lite_win_requestor.h index bdbcb83c6ebcf7b6391377882428e1683bff81dc..d93ee5b2989c2aff820f9f08ec6a52c54cbea9e0 100644 --- a/frameworks/wms/lite_win_requestor.h +++ b/frameworks/wms/lite_win_requestor.h @@ -38,7 +38,7 @@ public: void Resize(int16_t width, int16_t height); void Update(); - int32_t GetWindowId() + int32_t GetWindowId() const { return id_; } diff --git a/services/ims/input_event_client_proxy.cpp b/services/ims/input_event_client_proxy.cpp index d8639187604c0c1be1d0278d0206671c6ea97f06..fe5486b3a157fe7cb9f0c2901f82caccc4914cd0 100644 --- a/services/ims/input_event_client_proxy.cpp +++ b/services/ims/input_event_client_proxy.cpp @@ -92,7 +92,7 @@ void InputEventClientProxy::OnRawEvent(const RawEvent& event) WriteRawData(&io, static_cast(&event), sizeof(RawEvent)); pthread_mutex_lock(&lock_); std::map::iterator it; - for (it = clientInfoMap_.begin(); it != clientInfoMap_.end(); it++) { + for (it = clientInfoMap_.begin(); it != clientInfoMap_.end(); ++it) { if (it->second.alwaysInvoke || (event.state != lastState_)) { MessageOption option; MessageOptionInit(&option); diff --git a/services/ims/input_event_hub.h b/services/ims/input_event_hub.h index 75287cfb70a36dbbbf8d530967d731a5c5800b4b..8080ae1d102df96327e4cfb057b7907bf5780706 100644 --- a/services/ims/input_event_hub.h +++ b/services/ims/input_event_hub.h @@ -50,7 +50,7 @@ public: * * @returns return -1: register callback failed; return 0: register success. */ - int32_t RegisterReadCallback(ReadCallback callback) + static int32_t RegisterReadCallback(const ReadCallback &callback) { if (callback == nullptr) { return -1; diff --git a/services/ims/input_manager_service.h b/services/ims/input_manager_service.h index 812439c8ea8184aea6ffdeb8ed02c2636ca1c670..ea21efca27b9f8421e1ce25b63b3f6cf042d5157 100644 --- a/services/ims/input_manager_service.h +++ b/services/ims/input_manager_service.h @@ -35,12 +35,12 @@ public: /** * Init input manager service. */ - void Run(); + static void Run(); /** * Delete input manager service. */ - void Stop(); + static void Stop(); /** * @brief Distribute task function. diff --git a/services/wms/lite_win.h b/services/wms/lite_win.h index b215338cd8c8ef898d053bdadef8a5196a6fa8ae..00f81bf0b3c1868381f69353e5a69f9aa6014ed6 100644 --- a/services/wms/lite_win.h +++ b/services/wms/lite_win.h @@ -38,7 +38,7 @@ public: return id_; } - const LiteWinConfig& GetConfig() + const LiteWinConfig& GetConfig() const { return config_; } @@ -54,7 +54,7 @@ public: isShow_ = isShow; } - bool GetIsShow() + bool GetIsShow() const { return isShow_; } @@ -64,17 +64,17 @@ public: pid_ = pid; } - pid_t GetPid() + pid_t GetPid() const { return pid_; } - bool IsCoverMode() + bool IsCoverMode() const { return config_.compositeMode == LiteWinConfig::COPY; } - bool NoNeedToDraw() + bool NoNeedToDraw() const { return config_.compositeMode == LiteWinConfig::BLEND && config_.opacity == OPA_TRANSPARENT; } @@ -90,7 +90,7 @@ public: void Resize(int16_t width, int16_t height); private: bool CreateSurface(); - void ReleaseSurface(); + static void ReleaseSurface(); void FlushWithModeCopy(const Rect& srcRect, const LiteSurfaceData* layerData, int16_t dx, int16_t dy); void FlushWithModeBlend(const Rect& srcRect, const LiteSurfaceData* layerData, int16_t dx, int16_t dy); diff --git a/services/wms/lite_wms.h b/services/wms/lite_wms.h index 8ee49eb2802a44586771c3ebabbd6fca5d1be532..bf9b6029f8abbbabaf0ec8956c352ad8ff8521d4 100644 --- a/services/wms/lite_wms.h +++ b/services/wms/lite_wms.h @@ -38,20 +38,20 @@ private: static int32_t SurfaceRequestHandler(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option); static void DeathCallback(void* arg); - void GetSurface(IpcIo* req, IpcIo* reply); - void Show(IpcIo* req, IpcIo* reply); - void Hide(IpcIo* req, IpcIo* reply); - void RaiseToTop(IpcIo* req, IpcIo* reply); - void LowerToBottom(IpcIo* req, IpcIo* reply); - void MoveTo(IpcIo* req, IpcIo* reply); - void Resize(IpcIo* req, IpcIo* reply); - void Update(IpcIo* req, IpcIo* reply); - void CreateWindow(IpcIo* req, IpcIo* reply); - void RemoveWindow(IpcIo* req, IpcIo* reply); - void GetEventData(IpcIo* req, IpcIo* reply); - void Screenshot(IpcIo* req, IpcIo* reply); - void ClientRegister(IpcIo* req, IpcIo* reply); - void GetLayerInfo(IpcIo* req, IpcIo* reply); + static void GetSurface(IpcIo* req, IpcIo* reply); + static void Show(IpcIo* req, IpcIo* reply); + static void Hide(IpcIo* req, IpcIo* reply); + static void RaiseToTop(IpcIo* req, IpcIo* reply); + static void LowerToBottom(IpcIo* req, IpcIo* reply); + static void MoveTo(IpcIo* req, IpcIo* reply); + static void Resize(IpcIo* req, IpcIo* reply); + static void Update(IpcIo* req, IpcIo* reply); + static void CreateWindow(IpcIo* req, IpcIo* reply); + static void RemoveWindow(IpcIo* req, IpcIo* reply); + static void GetEventData(IpcIo* req, IpcIo* reply); + static void Screenshot(IpcIo* req, IpcIo* reply); + static void ClientRegister(IpcIo* req, IpcIo* reply); + static void GetLayerInfo(IpcIo* req, IpcIo* reply); }; } // namespace OHOS #endif