From dedd2e615d4737f619235d69c2235df157614f83 Mon Sep 17 00:00:00 2001 From: tanjiancheng <562575412@qq.com> Date: Thu, 20 Feb 2025 16:31:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?codecheck=E6=89=AB=E6=8F=8F=EF=BC=8Cohos?= =?UTF-8?q?=E9=80=82=E9=85=8D=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tanjiancheng <562575412@qq.com> --- shell/platform/ohos/napi_common.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shell/platform/ohos/napi_common.h b/shell/platform/ohos/napi_common.h index c6e468d80b..e19cdd3306 100644 --- a/shell/platform/ohos/napi_common.h +++ b/shell/platform/ohos/napi_common.h @@ -17,13 +17,13 @@ #define GET_AND_THROW_LAST_ERROR(env) \ do { \ - const napi_extended_error_info* errorInfo = nullptr; \ - napi_get_last_error_info((env), &errorInfo); \ + const napi_extended_error_info* error_Info = nullptr; \ + napi_get_last_error_info((env), &error_Info); \ bool isPending = false; \ napi_is_exception_pending((env), &isPending); \ - if (!isPending && errorInfo != nullptr) { \ - const char* errorMessage = errorInfo->error_message != nullptr \ - ? errorInfo->error_message \ + if (!isPending && error_Info != nullptr) { \ + const char* errorMessage = error_Info->error_message != nullptr \ + ? error_Info->error_message \ : "empty error message"; \ napi_throw_error((env), nullptr, errorMessage); \ } \ @@ -44,11 +44,11 @@ #define NAPI_ASSERT_RETURN_VOID(env, assertion, message) \ NAPI_ASSERT_BASE(env, assertion, message, NAPI_RETVAL_NOTHING) -#define NAPI_CALL_BASE(env, theCall, retVal) \ +#define NAPI_CALL_BASE(env, theCall, retValue) \ do { \ if ((theCall) != napi_ok) { \ GET_AND_THROW_LAST_ERROR((env)); \ - return retVal; \ + return retValue; \ } \ } while (0) -- Gitee From 1917ffc425167398b6aaf8b5f8a9f725252e32ee Mon Sep 17 00:00:00 2001 From: tanjiancheng <562575412@qq.com> Date: Thu, 20 Feb 2025 16:46:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?codecheck=E6=89=AB=E6=8F=8F=EF=BC=8Cohos?= =?UTF-8?q?=E9=80=82=E9=85=8D=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tanjiancheng <562575412@qq.com> --- shell/platform/ohos/napi_common.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/shell/platform/ohos/napi_common.h b/shell/platform/ohos/napi_common.h index e19cdd3306..298078e295 100644 --- a/shell/platform/ohos/napi_common.h +++ b/shell/platform/ohos/napi_common.h @@ -15,18 +15,18 @@ #define NAPI_RETVAL_NOTHING -#define GET_AND_THROW_LAST_ERROR(env) \ - do { \ +#define GET_AND_THROW_LAST_ERROR(env) \ + do { \ const napi_extended_error_info* error_Info = nullptr; \ napi_get_last_error_info((env), &error_Info); \ - bool isPending = false; \ - napi_is_exception_pending((env), &isPending); \ + bool isPending = false; \ + napi_is_exception_pending((env), &isPending); \ if (!isPending && error_Info != nullptr) { \ const char* errorMessage = error_Info->error_message != nullptr \ ? error_Info->error_message \ - : "empty error message"; \ - napi_throw_error((env), nullptr, errorMessage); \ - } \ + : "empty error message"; \ + napi_throw_error((env), nullptr, errorMessage); \ + } \ } while (0) #define NAPI_ASSERT_BASE(env, assertion, message, retVal) \ @@ -45,11 +45,11 @@ NAPI_ASSERT_BASE(env, assertion, message, NAPI_RETVAL_NOTHING) #define NAPI_CALL_BASE(env, theCall, retValue) \ - do { \ - if ((theCall) != napi_ok) { \ - GET_AND_THROW_LAST_ERROR((env)); \ + do { \ + if ((theCall) != napi_ok) { \ + GET_AND_THROW_LAST_ERROR((env)); \ return retValue; \ - } \ + } \ } while (0) #define NAPI_CALL(env, theCall) NAPI_CALL_BASE(env, theCall, nullptr) -- Gitee From 98c568b890f4c0cefd70ab5f2365597648898bad Mon Sep 17 00:00:00 2001 From: tanjiancheng <562575412@qq.com> Date: Thu, 20 Feb 2025 17:35:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?codecheck=E6=89=AB=E6=8F=8F=EF=BC=8Cohos?= =?UTF-8?q?=E9=80=82=E9=85=8D=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tanjiancheng <562575412@qq.com> --- shell/platform/ohos/napi_common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/ohos/napi_common.h b/shell/platform/ohos/napi_common.h index 298078e295..7ce06c7246 100644 --- a/shell/platform/ohos/napi_common.h +++ b/shell/platform/ohos/napi_common.h @@ -22,10 +22,10 @@ bool isPending = false; \ napi_is_exception_pending((env), &isPending); \ if (!isPending && error_Info != nullptr) { \ - const char* errorMessage = error_Info->error_message != nullptr \ + const char* errorMessage = error_Info->error_message != nullptr \ ? error_Info->error_message \ : "empty error message"; \ - napi_throw_error((env), nullptr, errorMessage); \ + napi_throw_error((env), nullptr, errorMessage); \ } \ } while (0) @@ -47,8 +47,8 @@ #define NAPI_CALL_BASE(env, theCall, retValue) \ do { \ if ((theCall) != napi_ok) { \ - GET_AND_THROW_LAST_ERROR((env)); \ - return retValue; \ + GET_AND_THROW_LAST_ERROR((env)); \ + return retValue; \ } \ } while (0) -- Gitee