diff --git a/utils/common/include/report_data_callback.h b/utils/common/include/report_data_callback.h index e937c0748237f29103adee3057f1995a4020724d..4e15e6c45051698e7fdce3c66942852792a0f1f0 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 299a8df07627798ab938cdb46b85cfcd5e48bd9f..6577415abb8cb9a1a72b855fb8ee0f24022134a7 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; }