From e26481a494ab67b9b8d986e451d1cee4ef6b7700 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Thu, 21 Apr 2022 11:01:37 +0800 Subject: [PATCH] modify kora warning Signed-off-by: hellohyh001 --- interfaces/plugin/src/sensor_js.cpp | 2 +- .../hdi_connection/hardware/include/hdi_service_impl.h | 8 ++++---- .../hdi_connection/hardware/src/hdi_service_impl.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/interfaces/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index 56f24649..d98c24d3 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -448,7 +448,7 @@ static napi_value TransformCoordinateSystem(napi_env env, napi_callback_info inf for (size_t i = 0; i < length; ++i) { asyncCallbackInfo->data.reserveData.reserve[i] = outRotationVector[i]; } - asyncCallbackInfo->data.reserveData.length = length; + asyncCallbackInfo->data.reserveData.length = static_cast(length); } if (argc == 2) { napi_value promise = nullptr; diff --git a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h index 9c9d041e..6b122bfa 100644 --- a/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h +++ b/services/sensor/hdi_connection/hardware/include/hdi_service_impl.h @@ -33,17 +33,17 @@ public: int32_t GetSensorList(std::vector& sensorList); - int32_t EnableSensor(uint32_t sensorId); + int32_t EnableSensor(int32_t sensorId); - int32_t DisableSensor(uint32_t sensorId); + int32_t DisableSensor(int32_t sensorId); int32_t SetBatch(int32_t sensorId, int64_t samplingInterval, int64_t reportInterval); int32_t SetMode(int32_t sensorId, int32_t mode); - int32_t SetOption(int32_t sensorId, uint32_t option); + int32_t SetOption(int32_t sensorId, int32_t option); - int32_t RunCommand(uint32_t sensorId, int32_t cmd, int32_t params); + int32_t RunCommand(int32_t sensorId, int32_t cmd, int32_t params); int32_t Register(RecordDataCallback cb); diff --git a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp index 3916dc76..288021fd 100644 --- a/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/sensor/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -63,7 +63,7 @@ void HdiServiceImpl::DataReportThread() return; } -int32_t HdiServiceImpl::EnableSensor(uint32_t sensorId) +int32_t HdiServiceImpl::EnableSensor(int32_t sensorId) { CALL_LOG_ENTER; CHKPR(g_callback, ERROR); @@ -87,7 +87,7 @@ int32_t HdiServiceImpl::EnableSensor(uint32_t sensorId) return ERR_OK; }; -int32_t HdiServiceImpl::DisableSensor(uint32_t sensorId) +int32_t HdiServiceImpl::DisableSensor(int32_t sensorId) { CALL_LOG_ENTER; if (std::find(supportSensors.begin(), supportSensors.end(), sensorId) == supportSensors.end()) { @@ -128,12 +128,12 @@ int32_t HdiServiceImpl::SetMode(int32_t sensorId, int32_t mode) return ERR_OK; } -int32_t HdiServiceImpl::RunCommand(uint32_t sensorId, int32_t cmd, int32_t params) +int32_t HdiServiceImpl::RunCommand(int32_t sensorId, int32_t cmd, int32_t params) { return ERR_OK; } -int32_t HdiServiceImpl::SetOption(int32_t sensorId, uint32_t option) +int32_t HdiServiceImpl::SetOption(int32_t sensorId, int32_t option) { return ERR_OK; } -- Gitee