diff --git a/frameworks/js/napi/src/sensor_js.cpp b/frameworks/js/napi/src/sensor_js.cpp index 560949313221c630817b592197ca25675aeae3ed..87a142d1e56151cf93102d4f29f5991bf963af1f 100644 --- a/frameworks/js/napi/src/sensor_js.cpp +++ b/frameworks/js/napi/src/sensor_js.cpp @@ -41,7 +41,7 @@ constexpr int32_t SENSOR_SUBSCRIBE_FAILURE = 1001; constexpr int32_t INPUT_ERROR = 202; constexpr float BODY_STATE_EXCEPT = 1.0f; constexpr float THRESHOLD = 0.000001f; -} +} // namespace static std::map g_samplingPeriod = { {"normal", 200000000}, {"ui", 60000000}, diff --git a/frameworks/js/napi/src/sensor_napi_utils.cpp b/frameworks/js/napi/src/sensor_napi_utils.cpp index 8a9ade39f009f7c4c39d41efa88b0d7cfe7b5546..498032d79aec59f98f8f2d1ee168e29b92bc79a1 100644 --- a/frameworks/js/napi/src/sensor_napi_utils.cpp +++ b/frameworks/js/napi/src/sensor_napi_utils.cpp @@ -25,7 +25,7 @@ namespace OHOS { namespace Sensors { namespace { constexpr int32_t STRING_LENGTH_MAX = 64; -} +} // namespace bool IsSameValue(const napi_env &env, const napi_value &lhs, const napi_value &rhs) { CALL_LOG_ENTER; diff --git a/services/hdi_connection/adapter/src/compatible_connection.cpp b/services/hdi_connection/adapter/src/compatible_connection.cpp index 1748a858877a4fbb9528ab2583b4fce8fa34c27e..7e598b57ccdfec5d04d7586714b420e7b3d4f424 100644 --- a/services/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/hdi_connection/adapter/src/compatible_connection.cpp @@ -25,7 +25,7 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "CompatibleConnection" }; -} +} // namespace ReportDataCb CompatibleConnection::reportDataCb_ = nullptr; sptr CompatibleConnection::reportDataCallback_ = nullptr; diff --git a/services/hdi_connection/hardware/src/hdi_service_impl.cpp b/services/hdi_connection/hardware/src/hdi_service_impl.cpp index ef76a32cd8a5f0ec4b073cb25b768fdf822c4d41..00af60e2469157cfe0fbae407e74726e549986bc 100644 --- a/services/hdi_connection/hardware/src/hdi_service_impl.cpp +++ b/services/hdi_connection/hardware/src/hdi_service_impl.cpp @@ -64,7 +64,7 @@ SensorEvent g_headPostureEvent = { .option = 3, .dataLen = 20 }; -} +} // namespace std::vector HdiServiceImpl::enableSensors_; std::vector HdiServiceImpl::callbacks_; int64_t HdiServiceImpl::samplingInterval_ = -1; diff --git a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp index 72fb9ed8395dc2bdc2fa1bcc2c22e6e3fcaa10dc..6713157f26cde95d565d61d7920c44a15cc5295d 100644 --- a/services/hdi_connection/interface/src/sensor_hdi_connection.cpp +++ b/services/hdi_connection/interface/src/sensor_hdi_connection.cpp @@ -42,7 +42,7 @@ std::unordered_set g_supportMockSensors = { SENSOR_TYPE_ID_HEADPOSTURE }; #endif // BUILD_VARIANT_ENG -} +} // namespace int32_t SensorHdiConnection::ConnectHdi() { diff --git a/test/fuzztest/interfaces/getactivesensorinfos_fuzzer/getactivesensorinfos_fuzzer.cpp b/test/fuzztest/interfaces/getactivesensorinfos_fuzzer/getactivesensorinfos_fuzzer.cpp index 3619cde0a4160cab52f3d27a37d7f70bfb22ce32..1ea7754f4af8efc084245bc9b7b63857424bb129 100644 --- a/test/fuzztest/interfaces/getactivesensorinfos_fuzzer/getactivesensorinfos_fuzzer.cpp +++ b/test/fuzztest/interfaces/getactivesensorinfos_fuzzer/getactivesensorinfos_fuzzer.cpp @@ -78,8 +78,8 @@ void GetActiveSensorInfosFuzzTest(const uint8_t *data, size_t size) int32_t count { 0 }; GetActiveSensorInfos(pid, &sensorActiveInfos, &count); } -} // Sensors -} // OHOS +} // namespace Sensors +} // namespace OHOS extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/test/fuzztest/interfaces/register_fuzzer/register_fuzzer.cpp b/test/fuzztest/interfaces/register_fuzzer/register_fuzzer.cpp index cde631c622a25fc35d11370bd72fb1cc37174c7d..d4f646dac773765bfbc8329406e384353e187727 100644 --- a/test/fuzztest/interfaces/register_fuzzer/register_fuzzer.cpp +++ b/test/fuzztest/interfaces/register_fuzzer/register_fuzzer.cpp @@ -76,8 +76,8 @@ void RegisterFuzzTest(const uint8_t *data, size_t size) GetObject(data, size, callback); Register(callback); } -} // Sensors -} // OHOS +} // namespace Sensors +} // namespace OHOS extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/test/fuzztest/interfaces/resumesensors_fuzzer/resumesensors_fuzzer.cpp b/test/fuzztest/interfaces/resumesensors_fuzzer/resumesensors_fuzzer.cpp index 77a42ad02c4de08d000c7212fe78d507933a9bc3..9bf068f4a74ed15f2b2a2b25f0f4ce76f65ee6bc 100644 --- a/test/fuzztest/interfaces/resumesensors_fuzzer/resumesensors_fuzzer.cpp +++ b/test/fuzztest/interfaces/resumesensors_fuzzer/resumesensors_fuzzer.cpp @@ -75,8 +75,8 @@ void ResumeSensorsFuzzTest(const uint8_t *data, size_t size) GetObject(data, size, pid); ResumeSensors(pid); } -} // Sensors -} // OHOS +} // namespace Sensors +} // namespace OHOS extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/test/fuzztest/interfaces/suspendsensors_fuzzer/suspendsensors_fuzzer.cpp b/test/fuzztest/interfaces/suspendsensors_fuzzer/suspendsensors_fuzzer.cpp index 1ed02639dee157c3a6d0696af2b1ade29d981fa3..5bdd8c3827723613c0acf40c367cd5647e07edf0 100644 --- a/test/fuzztest/interfaces/suspendsensors_fuzzer/suspendsensors_fuzzer.cpp +++ b/test/fuzztest/interfaces/suspendsensors_fuzzer/suspendsensors_fuzzer.cpp @@ -75,8 +75,8 @@ void SuspendSensorsFuzzTest(const uint8_t *data, size_t size) GetObject(data, size, pid); SuspendSensors(pid); } -} // Sensors -} // OHOS +} // namespace Sensors +} // namespace OHOS extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/test/fuzztest/interfaces/unregister_fuzzer/unregister_fuzzer.cpp b/test/fuzztest/interfaces/unregister_fuzzer/unregister_fuzzer.cpp index 336f780b646b9a3452709e6fa35cc3a67d4bceb1..0255dd70466a725e17e18c8205b4d82f236ec8ce 100644 --- a/test/fuzztest/interfaces/unregister_fuzzer/unregister_fuzzer.cpp +++ b/test/fuzztest/interfaces/unregister_fuzzer/unregister_fuzzer.cpp @@ -76,8 +76,8 @@ void UnregisterFuzzTest(const uint8_t *data, size_t size) GetObject(data, size, callback); Unregister(callback); } -} // Sensors -} // OHOS +} // namespace Sensors +} // namespace OHOS extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { diff --git a/utils/common/src/active_info.cpp b/utils/common/src/active_info.cpp index 2ad63479dd22c8307c979f5b800f3703eb89ceb8..2236dd10725d4040afbc57ffe4bc69c856527d6f 100644 --- a/utils/common/src/active_info.cpp +++ b/utils/common/src/active_info.cpp @@ -22,7 +22,7 @@ namespace Sensors { using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "ActiveInfo" }; -} +} // namespace ActiveInfo::ActiveInfo(int32_t pid, int32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) :pid_(pid), sensorId_(sensorId), samplingPeriodNs_(samplingPeriodNs), maxReportDelayNs_(maxReportDelayNs) diff --git a/utils/common/src/sensor.cpp b/utils/common/src/sensor.cpp index 6519c4535de21fd4337eb982fd6d47401e2dd74e..bd20895ac16fb6c5a0c87ec8fd1adb4efe88d43a 100644 --- a/utils/common/src/sensor.cpp +++ b/utils/common/src/sensor.cpp @@ -22,7 +22,7 @@ using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "Sensor" }; -} +} // namespace Sensor::Sensor() : sensorId_(0), diff --git a/utils/ipc/src/stream_session.cpp b/utils/ipc/src/stream_session.cpp index 6f687931985408c4266e34d8db3a239373511d6d..81a6a2ffedd1d66e0fff3472d950d016a958bc40 100644 --- a/utils/ipc/src/stream_session.cpp +++ b/utils/ipc/src/stream_session.cpp @@ -26,7 +26,7 @@ namespace OHOS { namespace Sensors { namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "StreamSession" }; -} +} // namespace StreamSession::StreamSession(const std::string &programName, const int32_t fd, const int32_t uid, const int32_t pid) : programName_(programName)