From 111a76521c67e5edbf92fdd7c3d72ef2c687a363 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Tue, 26 Sep 2023 11:30:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bailu1992 --- frameworks/native/sensor/src/fd_listener.cpp | 2 +- frameworks/native/sensor/src/sensor_client_stub.cpp | 2 +- interfaces/native/src/geomagnetic_field.cpp | 2 +- interfaces/native/src/sensor_agent.cpp | 4 +++- interfaces/native/src/sensor_algorithm.cpp | 2 ++ services/sensor/hdi_connection/adapter/src/hdi_connection.cpp | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frameworks/native/sensor/src/fd_listener.cpp b/frameworks/native/sensor/src/fd_listener.cpp index 33dc27a3..ef5364a1 100644 --- a/frameworks/native/sensor/src/fd_listener.cpp +++ b/frameworks/native/sensor/src/fd_listener.cpp @@ -26,7 +26,7 @@ using namespace OHOS::AppExecFwk; namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "FdListener" }; constexpr int32_t MAX_DATA_BUF_SIZE = 256; -} +} // namespace void FdListener::SetChannel(SensorDataChannel *channel) { diff --git a/frameworks/native/sensor/src/sensor_client_stub.cpp b/frameworks/native/sensor/src/sensor_client_stub.cpp index 6d023102..96416f2e 100644 --- a/frameworks/native/sensor/src/sensor_client_stub.cpp +++ b/frameworks/native/sensor/src/sensor_client_stub.cpp @@ -24,7 +24,7 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorClientStub" }; -} +} // namespace int32_t SensorClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) diff --git a/interfaces/native/src/geomagnetic_field.cpp b/interfaces/native/src/geomagnetic_field.cpp index 14c50de5..bb86946c 100644 --- a/interfaces/native/src/geomagnetic_field.cpp +++ b/interfaces/native/src/geomagnetic_field.cpp @@ -111,7 +111,7 @@ std::vector> polynomialsDerivative(GAUSSIAN_COEFFICIENT_DIMEN std::vector relativeRadiusPower(GAUSSIAN_COEFFICIENT_DIMENSION + 2); std::vector sinMLongitude(GAUSSIAN_COEFFICIENT_DIMENSION); std::vector cosMLongitude(GAUSSIAN_COEFFICIENT_DIMENSION); -} +} // namespace GeomagneticField::GeomagneticField(float latitude, float longitude, float altitude, int64_t timeMillis) { diff --git a/interfaces/native/src/sensor_agent.cpp b/interfaces/native/src/sensor_agent.cpp index e4b1daed..73cfcab7 100755 --- a/interfaces/native/src/sensor_agent.cpp +++ b/interfaces/native/src/sensor_agent.cpp @@ -25,7 +25,9 @@ using OHOS::Sensors::SERVICE_EXCEPTION; using OHOS::Sensors::PARAMETER_ERROR; using OHOS::Sensors::PERMISSION_DENIED; -static const HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorNativeAPI"}; +namespace { +constexpr HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorNativeAPI"}; +} // namespace static int32_t NormalizeErrCode(int32_t code) { diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index 816a2a79..e5d2466c 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -22,7 +22,9 @@ using OHOS::HiviewDFX::HiLog; using OHOS::HiviewDFX::HiLogLabel; +namespace { static constexpr HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorAlgorithmAPI"}; +} // namespace int32_t SensorAlgorithm::CreateQuaternion(std::vector rotationVector, std::vector &quaternion) { diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index a8e79688..239c0a32 100755 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -38,7 +38,7 @@ std::map sensorBasicInfoMap_; std::mutex sensorBasicInfoMutex_; constexpr int32_t GET_HDI_SERVICE_COUNT = 5; constexpr uint32_t WAIT_MS = 200; -} +} // namespace ReportDataCb HdiConnection::reportDataCb_ = nullptr; sptr HdiConnection::reportDataCallback_ = nullptr; -- Gitee From b1a0f3fe254927f17b9d07ad48ab2fa64fe7444f Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Tue, 26 Sep 2023 11:31:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bailu1992 --- .../hdi_connection/adapter/src/sensor_event_callback.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp b/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp index a6f6bee4..f66801d0 100644 --- a/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp +++ b/services/sensor/hdi_connection/adapter/src/sensor_event_callback.cpp @@ -24,7 +24,8 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "HdiConnection" }; std::unique_ptr HdiConnection_ = std::make_unique(); -} +} // namespace + int32_t SensorEventCallback::OnDataEvent(const HdfSensorEvents &event) { ReportDataCb reportDataCb_ = HdiConnection_->GetReportDataCb(); -- Gitee From 8651b1eae65cbd4987fee2a0e97ba8f30fdac8de Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Tue, 26 Sep 2023 11:40:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bailu1992 --- interfaces/native/src/sensor_algorithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/native/src/sensor_algorithm.cpp b/interfaces/native/src/sensor_algorithm.cpp index e5d2466c..a25f4110 100644 --- a/interfaces/native/src/sensor_algorithm.cpp +++ b/interfaces/native/src/sensor_algorithm.cpp @@ -23,7 +23,7 @@ using OHOS::HiviewDFX::HiLog; using OHOS::HiviewDFX::HiLogLabel; namespace { -static constexpr HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorAlgorithmAPI"}; +constexpr HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorAlgorithmAPI"}; } // namespace int32_t SensorAlgorithm::CreateQuaternion(std::vector rotationVector, std::vector &quaternion) -- Gitee