diff --git a/frameworks/native/sensor/src/fd_listener.cpp b/frameworks/native/sensor/src/fd_listener.cpp index 33dc27a35a2bbf83efe8f347d1ab13b670040bef..ef5364a1672e0989b27e44b03cce6ed838ace336 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 6d0231025f513acbd7aae1ea544c0a13430cb0b9..96416f2e6aa8ff0f85b0fee33798445be9de19f8 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 14c50de517acc1c8cc9108a21bc4265c74f273fb..bb86946cca755c1aeb6c871d673d6d96503fc84e 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 e4b1daedf6559ee0cb7158bd03d7ab76b0c80f21..73cfcab74acb4bfc2c1001f9ddfdbc987fe89cd8 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 816a2a7905212f0be3ca46351bc163c135d7098e..a25f41107a9ceeda60f45e9cb082572626faf63a 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; -static constexpr HiLogLabel LABEL = {LOG_CORE, OHOS::Sensors::SENSOR_LOG_DOMAIN, "SensorAlgorithmAPI"}; +namespace { +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 a8e79688cf13b822ba1f8f15b5acf3d5ada3ffe0..239c0a326fabd3a05b2dafbec734e716df0529fd 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; 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 a6f6bee40766970367d9ddad03360df3bdcfb5a1..f66801d0588f7ed3419182ab01a3134b964e3c85 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();