From 3e9db0b9521f1b0b4f8686602d909dd7b9852dbe Mon Sep 17 00:00:00 2001 From: houdisheng Date: Wed, 26 Oct 2022 15:38:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecppcheck=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/app_group_observer_napi.cpp | 2 +- frameworks/src/bundle_active_app_group_napi.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/src/app_group_observer_napi.cpp b/frameworks/src/app_group_observer_napi.cpp index 028b50d..fdc96fe 100644 --- a/frameworks/src/app_group_observer_napi.cpp +++ b/frameworks/src/app_group_observer_napi.cpp @@ -77,7 +77,7 @@ napi_value SetBundleGroupChangedData(const CallbackReceiveDataWorker *commonEven return BundleStateCommon::NapiGetNull(commonEventDataWorkerData->env); } -void UvQueueWorkOnAppGroupChanged(uv_work_t *work, int status) +void UvQueueWorkOnAppGroupChanged(uv_work_t *&work, int status) { BUNDLE_ACTIVE_LOGD("OnAppGroupChanged uv_work_t start"); if (!work) { diff --git a/frameworks/src/bundle_active_app_group_napi.cpp b/frameworks/src/bundle_active_app_group_napi.cpp index 9158974..6c277e1 100644 --- a/frameworks/src/bundle_active_app_group_napi.cpp +++ b/frameworks/src/bundle_active_app_group_napi.cpp @@ -60,9 +60,9 @@ napi_value ParseQueryAppGroupParameters(const napi_env &env, const napi_callback napi_valuetype valuetype = napi_undefined; NAPI_CALL(env, napi_typeof(env, argv[0], &valuetype)); if (valuetype == napi_function) { - napi_valuetype valuetype = napi_undefined; - NAPI_CALL(env, napi_typeof(env, argv[0], &valuetype)); - if (valuetype != napi_function) { + napi_valuetype inputValuetype = napi_undefined; + NAPI_CALL(env, napi_typeof(env, argv[0], &inputValuetype)); + if (inputValuetype != napi_function) { params.errorCode = ERR_CALL_BACK_TYPE; return BundleStateCommon::HandleParamErr(env, ERR_CALL_BACK_TYPE, ""); } -- Gitee From 53d1e17f0c4701e421bf30d9e2bbc77f3593c92a Mon Sep 17 00:00:00 2001 From: houdisheng Date: Wed, 26 Oct 2022 15:42:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecppcheck=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/bundle_active_app_group_napi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/src/bundle_active_app_group_napi.cpp b/frameworks/src/bundle_active_app_group_napi.cpp index 6c277e1..e75894b 100644 --- a/frameworks/src/bundle_active_app_group_napi.cpp +++ b/frameworks/src/bundle_active_app_group_napi.cpp @@ -60,9 +60,9 @@ napi_value ParseQueryAppGroupParameters(const napi_env &env, const napi_callback napi_valuetype valuetype = napi_undefined; NAPI_CALL(env, napi_typeof(env, argv[0], &valuetype)); if (valuetype == napi_function) { - napi_valuetype inputValuetype = napi_undefined; - NAPI_CALL(env, napi_typeof(env, argv[0], &inputValuetype)); - if (inputValuetype != napi_function) { + napi_valuetype inputValueType = napi_undefined; + NAPI_CALL(env, napi_typeof(env, argv[0], &inputValueType)); + if (inputValueType != napi_function) { params.errorCode = ERR_CALL_BACK_TYPE; return BundleStateCommon::HandleParamErr(env, ERR_CALL_BACK_TYPE, ""); } -- Gitee From 849571e50ef5acc0cc062b95ef9d56751ea8e9bc Mon Sep 17 00:00:00 2001 From: houdisheng Date: Wed, 26 Oct 2022 16:50:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecppcheck=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/app_group_observer_napi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/src/app_group_observer_napi.cpp b/frameworks/src/app_group_observer_napi.cpp index fdc96fe..eb20bcd 100644 --- a/frameworks/src/app_group_observer_napi.cpp +++ b/frameworks/src/app_group_observer_napi.cpp @@ -158,7 +158,7 @@ void AppGroupObserver::OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCal delete callBackInfo; work->data = (void *)callbackReceiveDataWorker; - int ret = uv_queue_work(loop, work, [](uv_work_t *work) {}, UvQueueWorkOnAppGroupChanged); + int ret = uv_queue_work(loop, work, [](uv_work_t *&work) {}, UvQueueWorkOnAppGroupChanged); if (ret != 0) { delete callbackReceiveDataWorker; callbackReceiveDataWorker = nullptr; -- Gitee