From 14a0eaecd10c561be572d8b67033ced450351d08 Mon Sep 17 00:00:00 2001 From: bailu1992 Date: Tue, 4 Mar 2025 16:41:57 +0800 Subject: [PATCH] Alarm modification Signed-off-by: bailu1992 --- utils/common/include/report_data_callback.h | 2 +- utils/common/src/report_data_callback.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/common/include/report_data_callback.h b/utils/common/include/report_data_callback.h index e937c074..4e15e6c4 100755 --- a/utils/common/include/report_data_callback.h +++ b/utils/common/include/report_data_callback.h @@ -45,7 +45,7 @@ private: void FreeRedundantEventBuffer(); private: std::vector recentWriteBlockNums_; - int32_t blockNumsUpdateIndex_ = 0; + uint32_t blockNumsUpdateIndex_ = 0; }; using ReportDataCb = int32_t (ReportDataCallback::*)(SensorData *sensorData, sptr cb); diff --git a/utils/common/src/report_data_callback.cpp b/utils/common/src/report_data_callback.cpp index 299a8df0..6577415a 100755 --- a/utils/common/src/report_data_callback.cpp +++ b/utils/common/src/report_data_callback.cpp @@ -53,7 +53,7 @@ int32_t ReportDataCallback::ReportEventCallback(SensorData *sensorData, sptreventsBuf_.writeFullBlockNum >= cb->eventsBuf_.blockList.size()) { + if (cb->eventsBuf_.writeFullBlockNum >= static_cast(cb->eventsBuf_.blockList.size())) { SEN_HILOGE("Event buffer more than the blockList size"); return ERROR; } @@ -116,7 +116,7 @@ void ReportDataCallback::FreeRedundantEventBuffer() return; } - for (int32_t index = maxWriteBlockNum; index < eventsBuf_.blockList.size(); ++index) { + for (int32_t index = maxWriteBlockNum; index < static_cast(eventsBuf_.blockList.size()); ++index) { if (eventsBuf_.blockList[index].dataBuf == nullptr) { break; } -- Gitee