From 8d64636c1ecf179f6a517c47f8cc74ac207a5407 Mon Sep 17 00:00:00 2001 From: wuzhihuitmac Date: Thu, 19 Oct 2023 07:48:56 +0000 Subject: [PATCH] Code specification modification Signed-off-by: wuzhihuitmac Change-Id: Iafe2505b23be63d933696a4a13358ab5412ff3c6 --- .../hdi_connection/adapter/src/hdi_connection.cpp | 4 ++-- services/sensor/src/client_info.cpp | 12 ++++++------ vibration_convert/core/utils/src/utils.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 239c0a32..41a23aa5 100755 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -62,7 +62,7 @@ int32_t HdiConnection::ConnectHdi() } HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SENSOR, "HDF_SERVICE_EXCEPTION", HiSysEvent::EventType::FAULT, "PKG_NAME", "ConnectHdi", "ERROR_CODE", CONNECT_SENSOR_HDF_ERR); - SEN_HILOGE("connect v1_1 hdi failed"); + SEN_HILOGE("Connect v1_1 hdi failed"); return ERR_NO_INIT; } @@ -108,7 +108,7 @@ int32_t HdiConnection::EnableSensor(int32_t sensorId) if (ret != 0) { HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::SENSOR, "HDF_SERVICE_EXCEPTION", HiSysEvent::EventType::FAULT, "PKG_NAME", "EnableSensor", "ERROR_CODE", ret); - SEN_HILOGE("connect v1_1 hdi failed"); + SEN_HILOGE("Connect v1_1 hdi failed"); return ret; } SetSensorBasicInfoState(sensorId, true); diff --git a/services/sensor/src/client_info.cpp b/services/sensor/src/client_info.cpp index 17bf5c7a..4a5974f6 100644 --- a/services/sensor/src/client_info.cpp +++ b/services/sensor/src/client_info.cpp @@ -55,7 +55,7 @@ bool ClientInfo::GetSensorState(int32_t sensorId) std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorId); if (it == clientMap_.end()) { - SEN_HILOGE("Cannot find sensorId:%{public}d", sensorId); + SEN_HILOGE("Can't find sensorId:%{public}d", sensorId); return false; } for (const auto &pidIt : it->second) { @@ -63,7 +63,7 @@ bool ClientInfo::GetSensorState(int32_t sensorId) return true; } } - SEN_HILOGE("Cannot find sensorInfo, sensorId:%{public}d", sensorId); + SEN_HILOGE("Can't find sensorInfo, sensorId:%{public}d", sensorId); return false; } @@ -82,7 +82,7 @@ SensorBasicInfo ClientInfo::GetBestSensorInfo(int32_t sensorId) std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorId); if (it == clientMap_.end()) { - SEN_HILOGE("Cannot find sensorId:%{public}d", sensorId); + SEN_HILOGE("Can't find sensorId:%{public}d", sensorId); return sensorInfo; } for (const auto &pidIt : it->second) { @@ -106,7 +106,7 @@ bool ClientInfo::OnlyCurPidSensorEnabled(int32_t sensorId, int32_t pid) std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorId); if (it == clientMap_.end()) { - SEN_HILOGE("Cannot find sensorId:%{public}d", sensorId); + SEN_HILOGE("Can't find sensorId:%{public}d", sensorId); return false; } bool ret = false; @@ -374,12 +374,12 @@ SensorBasicInfo ClientInfo::GetCurPidSensorInfo(int32_t sensorId, int32_t pid) std::lock_guard clientLock(clientMutex_); auto it = clientMap_.find(sensorId); if (it == clientMap_.end()) { - SEN_HILOGE("Cannot find sensorId:%{public}d", sensorId); + SEN_HILOGE("Can't find sensorId:%{public}d", sensorId); return sensorInfo; } auto pidIt = it->second.find(pid); if (pidIt == it->second.end()) { - SEN_HILOGE("Cannot find pid:%{public}d", pid); + SEN_HILOGE("Can't find pid:%{public}d", pid); return sensorInfo; } sensorInfo.SetSamplingPeriodNs(pidIt->second.GetSamplingPeriodNs()); diff --git a/vibration_convert/core/utils/src/utils.cpp b/vibration_convert/core/utils/src/utils.cpp index 1c03a9bb..275218cc 100644 --- a/vibration_convert/core/utils/src/utils.cpp +++ b/vibration_convert/core/utils/src/utils.cpp @@ -75,7 +75,7 @@ std::vector TransposeMatrix(size_t rows, const std::vector &valu size_t valuesSize = values.size(); SEN_HILOGD("valuesSize:%{public}zu", valuesSize); if ((rows == 0) || (valuesSize == 0) || (valuesSize > MAX_SIZE)) { - SEN_HILOGE("Parameter error"); + SEN_HILOGE("Parameter is invalid"); return {}; } std::vector dst(valuesSize, 0.0); @@ -98,7 +98,7 @@ int32_t UniqueIdx(const std::vector &idx, const std::vector &ti { CALL_LOG_ENTER; if (idx.size() != time.size()) { - SEN_HILOGE("size of idx and time vectors not equal"); + SEN_HILOGE("Size of idx and time vectors not equal"); return Sensors::ERROR; } int32_t oldIdxLen = static_cast(idx.size()); @@ -121,7 +121,7 @@ int32_t UniqueIdx(const std::vector &idx, const std::vector &ti ++i; } if (idxLen != oldIdxLen) { - SEN_HILOGI("Idx unique process"); + SEN_HILOGI("idx unique process"); } return Sensors::SUCCESS; } -- Gitee