From c86c09392dba8881f0f9ba74b8fa45207884be85 Mon Sep 17 00:00:00 2001 From: wangpggg Date: Mon, 9 Jun 2025 16:54:25 +0800 Subject: [PATCH] modify warnings Signed-off-by: wangpeng --- frameworks/native/backup_ext/src/ext_extension.cpp | 5 +++-- frameworks/native/backup_ext/src/sub_ext_extension.cpp | 6 +++--- services/backup_sa/src/module_ipc/service_incremental.cpp | 2 +- utils/src/b_filesystem/b_dir.cpp | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frameworks/native/backup_ext/src/ext_extension.cpp b/frameworks/native/backup_ext/src/ext_extension.cpp index cb619e84d..8f67b82de 100644 --- a/frameworks/native/backup_ext/src/ext_extension.cpp +++ b/frameworks/native/backup_ext/src/ext_extension.cpp @@ -486,6 +486,7 @@ ErrCode BackupExtExtension::IndexFileReady(const TarMap &pkgInfo, sptr "The application is packaged successfully but the AppFileReady interface fails to be invoked: " "%{public}d", ret); + close(fdval); } HILOGI("End notify Appfile Ready"); return ret; @@ -856,13 +857,13 @@ tuple BackupExtExtension::CalculateDataSize(const B HILOGD("bigfile size = %{public}" PRId64 "", fileSize); totalSize += fileSize; } - appStatistic_->bigFileSize_ = totalSize; + appStatistic_->bigFileSize_ = static_cast(totalSize); HILOGI("bigfile size = %{public}" PRId64 "", totalSize); for (const auto &item : smallFiles) { UpdateFileStat(item.first, item.second); totalSize += static_cast(item.second); } - appStatistic_->smallFileSize_ = totalSize - appStatistic_->bigFileSize_; + appStatistic_->smallFileSize_ = static_cast(totalSize - appStatistic_->bigFileSize_); HILOGI("scanning end, Datasize = %{public}" PRId64 "", totalSize); return {ERR_OK, static_cast(includes.size()), static_cast(excludes.size())}; } diff --git a/frameworks/native/backup_ext/src/sub_ext_extension.cpp b/frameworks/native/backup_ext/src/sub_ext_extension.cpp index e1e38e153..ed31e9d1d 100644 --- a/frameworks/native/backup_ext/src/sub_ext_extension.cpp +++ b/frameworks/native/backup_ext/src/sub_ext_extension.cpp @@ -1094,9 +1094,9 @@ TarMap BackupExtExtension::GetIncrmentBigInfos(const vectorbigFileSize_ += sta.st_size; + appStatistic_->bigFileSize_ += static_cast(sta.st_size); UpdateFileStat(item.filePath, sta.st_size); - uint64_t hashStart = TimeUtils::GetTimeUS(); + uint64_t hashStart = static_cast(TimeUtils::GetTimeUS()); string md5Name = getStringHash(bigFiles, item.filePath); appStatistic_->hashSpendUS_ += TimeUtils::GetSpendUS(hashStart); if (!md5Name.empty()) { @@ -1250,7 +1250,7 @@ void BackupExtExtension::IncrementalPacket(const vector & int fdNum = 0; string partName = GetIncrmentPartName(); auto reportCb = ReportErrFileByProc(wptr {this}, curScenario_); - uint64_t tarStart = TimeUtils::GetTimeMS(); + uint64_t tarStart = static_cast(TimeUtils::GetTimeMS()); for (const auto &small : infos) { appStatistic_->smallFileSize_ += small.size; UpdateFileStat(small.filePath, small.size); diff --git a/services/backup_sa/src/module_ipc/service_incremental.cpp b/services/backup_sa/src/module_ipc/service_incremental.cpp index 738f41821..2490928f7 100644 --- a/services/backup_sa/src/module_ipc/service_incremental.cpp +++ b/services/backup_sa/src/module_ipc/service_incremental.cpp @@ -566,7 +566,7 @@ ErrCode Service::PublishSAIncrementalFile(const BFileInfo &fileInfo, UniqueFd fd std::unique_lock mapLock(statMapMutex_); std::shared_ptr saStatistic = std::make_shared(bundleName, totalStatistic_->GetUniqId(), totalStatistic_->GetBizScene()); - saStatistic->doRestoreStart_ = TimeUtils::GetTimeMS(); + saStatistic->doRestoreStart_ = static_cast(TimeUtils::GetTimeMS()); saStatisticMap_[bundleName] = saStatistic; } ErrCode errCode = VerifyCaller(); diff --git a/utils/src/b_filesystem/b_dir.cpp b/utils/src/b_filesystem/b_dir.cpp index 3cefa2276..a725c3f09 100644 --- a/utils/src/b_filesystem/b_dir.cpp +++ b/utils/src/b_filesystem/b_dir.cpp @@ -267,7 +267,8 @@ static set ExpandPathWildcard(const vector &vec, bool onlyPath) } } - set expandPath, filteredPath; + set expandPath; + set filteredPath; for (size_t i = 0; i < gl->gl_pathc; ++i) { std::string tmpPath = gl->gl_pathv[i]; auto pos = tmpPath.find(BConstants::FILE_SEPARATOR_CHAR); -- Gitee