From 6828cda966857863fd8a58ba2b2959429e1de9ca Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Fri, 26 May 2023 01:45:28 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!23=20:?= =?UTF-8?q?=20udmf=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/common/endian_converter.h | 8 ++++---- framework/jskitsimpl/common/napi_error_utils.cpp | 3 +-- framework/jskitsimpl/common/napi_queue.cpp | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/framework/common/endian_converter.h b/framework/common/endian_converter.h index dab898a..0541ac3 100755 --- a/framework/common/endian_converter.h +++ b/framework/common/endian_converter.h @@ -101,22 +101,22 @@ static inline uint64_t NetToHost(uint64_t value) static inline float HostToNet(float value) { - return htole32(*reinterpret_cast(&value)); + return htole32(*(uint32_t*)(&value)); } static inline float NetToHost(float value) { - return le32toh(*reinterpret_cast(&value)); + return le32toh(*(uint32_t*)(&value)); } static inline double HostToNet(double value) { - return htole64(*reinterpret_cast(&value)); + return htole64(*(uint64_t*)(&value)); } static inline double NetToHost(double value) { - return le64toh(*reinterpret_cast(&value)); + return le64toh(*(uint64_t*)(&value)); } } // namespace UDMF } // namespace OHOS diff --git a/framework/jskitsimpl/common/napi_error_utils.cpp b/framework/jskitsimpl/common/napi_error_utils.cpp index 1787e05..7f18ae9 100644 --- a/framework/jskitsimpl/common/napi_error_utils.cpp +++ b/framework/jskitsimpl/common/napi_error_utils.cpp @@ -81,8 +81,7 @@ void ThrowNapiError(napi_env env, int32_t status, const std::string &errMessage, std::string message(napiError.message); if (isParamsCheck) { - auto paramsCheckError = 401; - napiError.jsCode = paramsCheckError; + napiError.jsCode = 401; message += errMessage; } diff --git a/framework/jskitsimpl/common/napi_queue.cpp b/framework/jskitsimpl/common/napi_queue.cpp index baaa332..6a661cd 100644 --- a/framework/jskitsimpl/common/napi_queue.cpp +++ b/framework/jskitsimpl/common/napi_queue.cpp @@ -92,7 +92,8 @@ napi_value NapiQueue::AsyncWork(napi_env env, std::shared_ptr ctxt, LOG_INFO(UDMF_KITS_NAPI, "NapiQueue::AsyncWork create string start"); napi_create_string_utf8(ctxt->env, name.c_str(), NAPI_AUTO_LENGTH, &resource); LOG_INFO(UDMF_KITS_NAPI, "NapiQueue::AsyncWork create string finish"); - napi_create_async_work(ctxt->env, nullptr, resource, + napi_create_async_work( + ctxt->env, nullptr, resource, [](napi_env env, void *data) { LOG_INFO(UDMF_KITS_NAPI, "NapiQueue::AsyncWork start execute"); ASSERT_VOID(data != nullptr, "no data"); -- Gitee