From 1bfbbe74eda8c9f1bfc2d79e5628c94b629dc9fc Mon Sep 17 00:00:00 2001 From: lijuan124 Date: Thu, 24 Jul 2025 16:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86=E6=84=8F?= =?UTF-8?q?=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lijuan124 --- .../arkoala/framework/docs/API_STYLE.md | 2 +- .../interop/src/cpp/types/koala-types.h | 18 ++++++++++-------- .../interop/src/cpp/types/signatures.cc | 12 ++++++++++-- .../pattern/search/search_model_static.h | 2 +- .../pattern/symbol/symbol_model_static.cpp | 3 ++- .../pattern/symbol/symbol_model_static.h | 2 +- .../core/interfaces/native/utility/converter.h | 14 +++++++------- .../native/utility/reverse_converter_enums.cpp | 2 +- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/docs/API_STYLE.md b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/docs/API_STYLE.md index 43d99bf605d..a64d5fd79ef 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/docs/API_STYLE.md +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/framework/docs/API_STYLE.md @@ -37,7 +37,7 @@ extern "C" DLL_EXPORT const ArkUIAnyAPI *GetArkUIAPI(int kind, int version); ArkUIAPI1* api1 = GetArkUIAPI(1, 5); if (api1) api1->op1(16); -// Find API 1, version 3. +// Find API 2, version 3. ArkUIAPI2* api2 = GetArkUIAPI(2, 3); if (api2) api2->op2(1, 2); ``` diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/koala-types.h b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/koala-types.h index 10300129515..003bb2b3f6a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/koala-types.h +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/koala-types.h @@ -154,16 +154,18 @@ struct KInteropNumber { return result; } inline double asDouble() { - if (tag == INTEROP_TAG_INT32) - return (double)i32; - else - return (double)f32; + if (tag == INTEROP_TAG_INT32) { + return (double)i32; + } else { + return (double)f32; + } } inline int32_t asInt32() { - if (tag == INTEROP_TAG_INT32) - return i32; - else - return (int32_t)f32; + if (tag == INTEROP_TAG_INT32) { + return i32; + } else { + return (int32_t)f32; + } } }; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/signatures.cc b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/signatures.cc index 3750c592b74..7f36c49afbd 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/signatures.cc +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/cpp/types/signatures.cc @@ -22,8 +22,16 @@ // For types with the same name on ets and jni #define KOALA_INTEROP_TYPEDEF(func, lang, CPP_TYPE, SIG_TYPE, CODE_TYPE) \ - if (std::strcmp(func, "sigType") == 0) if (type == CPP_TYPE) return SIG_TYPE; \ - if (std::strcmp(func, "codeType") == 0) if (type == CPP_TYPE) return CODE_TYPE; + if (std::strcmp(func, "sigType") == 0) { \ + if (type == CPP_TYPE) { \ + return SIG_TYPE; \ + } \ + } \ + if (std::strcmp(func, "codeType") == 0) { \ + if (type == CPP_TYPE) { \ + return CODE_TYPE; \ + } \ + } // For types with distinct names on ets and jni #define KOALA_INTEROP_TYPEDEF_LS(func, lang, CPP_TYPE, ETS_SIG_TYPE, ETS_CODE_TYPE, JNI_SIG_TYPE, JNI_CODE_TYPE) \ diff --git a/frameworks/core/components_ng/pattern/search/search_model_static.h b/frameworks/core/components_ng/pattern/search/search_model_static.h index 67a06074948..5a84595a097 100644 --- a/frameworks/core/components_ng/pattern/search/search_model_static.h +++ b/frameworks/core/components_ng/pattern/search/search_model_static.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/frameworks/core/components_ng/pattern/symbol/symbol_model_static.cpp b/frameworks/core/components_ng/pattern/symbol/symbol_model_static.cpp index 264bf90e4a1..f997940fcfa 100644 --- a/frameworks/core/components_ng/pattern/symbol/symbol_model_static.cpp +++ b/frameworks/core/components_ng/pattern/symbol/symbol_model_static.cpp @@ -13,9 +13,10 @@ * limitations under the License. */ +#include "core/components_ng/pattern/symbol/symbol_model_static.h" + #include "base/utils/utils.h" #include "core/components_ng/pattern/symbol/symbol_model_ng.h" -#include "core/components_ng/pattern/symbol/symbol_model_static.h" #include "core/components_ng/pattern/text/text_pattern.h" namespace OHOS::Ace::NG { diff --git a/frameworks/core/components_ng/pattern/symbol/symbol_model_static.h b/frameworks/core/components_ng/pattern/symbol/symbol_model_static.h index fcfdf199dbd..af64d8044db 100644 --- a/frameworks/core/components_ng/pattern/symbol/symbol_model_static.h +++ b/frameworks/core/components_ng/pattern/symbol/symbol_model_static.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/frameworks/core/interfaces/native/utility/converter.h b/frameworks/core/interfaces/native/utility/converter.h index 9f028fbb71b..8432504d8ca 100644 --- a/frameworks/core/interfaces/native/utility/converter.h +++ b/frameworks/core/interfaces/native/utility/converter.h @@ -265,7 +265,7 @@ namespace Converter { template<> inline long Convert(const Ark_Number& src) { - LOGE("Ark_Number doesn`t support long type"); + LOGW("Ark_Number doesn`t support long type"); return static_cast(Convert(src)); } @@ -278,7 +278,7 @@ namespace Converter { template<> inline double Convert(const Ark_Number& src) { - LOGE("Ark_Number doesn`t support double type"); + LOGW("Ark_Number doesn`t support double type"); return src.tag == INTEROP_TAG_FLOAT32 ? static_cast(src.f32) : static_cast(src.i32); } @@ -327,7 +327,7 @@ namespace Converter { template<> inline ImageSourceInfo Convert(const Ark_DrawableDescriptor& value) { - LOGE("Convert [Ark_DrawableDescriptor] to [ImageSourceInfo] is not supported"); + LOGW("Convert [Ark_DrawableDescriptor] to [ImageSourceInfo] is not supported"); return ImageSourceInfo(); } @@ -345,7 +345,7 @@ namespace Converter { template<> inline ImageSourceInfo Convert(const Ark_LinearGradient_common& value) { - LOGE("Convert [Ark_LinearGradient] to [ImageSourceInfo] is not supported"); + LOGW("Convert [Ark_LinearGradient] to [ImageSourceInfo] is not supported"); return ImageSourceInfo(); } @@ -400,19 +400,19 @@ namespace Converter { template<> inline void AssignCast(std::optional& dst, const Ark_CustomObject& src) { - LOGE("ARKOALA Converter Ark_CustomObject -> Dimension is not implemented."); + LOGW("ARKOALA Converter Ark_CustomObject -> Dimension is not implemented."); } template<> inline void AssignCast(std::optional& dst, const Ark_Resource& src) { - LOGE("ARKOALA Converter -> Resource support (String) is not implemented."); + LOGW("ARKOALA Converter -> Resource support (String) is not implemented."); } template<> inline void AssignCast(std::optional& dst, const Ark_ColoringStrategy& src) { - LOGE("ARKOALA Converter Ark_ColoringStrategy -> Color is not implemented."); + LOGW("ARKOALA Converter Ark_ColoringStrategy -> Color is not implemented."); } template<> diff --git a/frameworks/core/interfaces/native/utility/reverse_converter_enums.cpp b/frameworks/core/interfaces/native/utility/reverse_converter_enums.cpp index df04098d919..3dba48db7fd 100644 --- a/frameworks/core/interfaces/native/utility/reverse_converter_enums.cpp +++ b/frameworks/core/interfaces/native/utility/reverse_converter_enums.cpp @@ -32,7 +32,7 @@ void AssignArkValue(Ark_AccessibilityHoverType& dst, const AccessibilityHoverAct case AccessibilityHoverAction::HOVER_CANCEL: dst = ARK_ACCESSIBILITY_HOVER_TYPE_HOVER_CANCEL; break; default: dst = static_cast(-1); - LOGE("Unexpected enum value in Ark_AccessibilityHoverType: %{public}d", src); + LOGW("Unexpected enum value in Ark_AccessibilityHoverType: %{public}d", src); break; } } -- Gitee