From 7fc8509a797bf843415b2058d5e4ae38d1ab26e1 Mon Sep 17 00:00:00 2001 From: xsz233 Date: Thu, 27 Oct 2022 10:58:30 +0800 Subject: [PATCH] fix alerts Signed-off-by: xsz233 --- services/bundlemgr_lite/src/bundle_manager_service.cpp | 8 +++----- services/bundlemgr_lite/src/zip_file.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/services/bundlemgr_lite/src/bundle_manager_service.cpp b/services/bundlemgr_lite/src/bundle_manager_service.cpp index 8fab372..f72805e 100644 --- a/services/bundlemgr_lite/src/bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/bundle_manager_service.cpp @@ -123,7 +123,7 @@ bool ManagerService::GetAmsInterface(AmsInnerInterface **amsInterface) return false; } - int result = iUnknown->QueryInterface(iUnknown, 0, (void **) amsInterface); + int result = iUnknown->QueryInterface(iUnknown, 0, reinterpret_cast(amsInterface)); if (result != 0) { HILOG_ERROR(HILOG_MODULE_APP, "BundleMS Query ams Interface failed: %{public}d\n", result); return false; @@ -647,18 +647,16 @@ uint32_t ManagerService::GetBundleSize(const char *bundleName) std::string ManagerService::GetCodeDirPath() const { - std::string codeDirPath; if (installer_ == nullptr) { - return codeDirPath; + return ""; } return installer_->GetCodeDirPath(); } std::string ManagerService::GetDataDirPath() const { - std::string dataDirPath; if (installer_ == nullptr) { - return dataDirPath; + return ""; } return installer_->GetDataDirPath(); } diff --git a/services/bundlemgr_lite/src/zip_file.cpp b/services/bundlemgr_lite/src/zip_file.cpp index 0970ae9..c680ba5 100755 --- a/services/bundlemgr_lite/src/zip_file.cpp +++ b/services/bundlemgr_lite/src/zip_file.cpp @@ -509,7 +509,7 @@ bool ZipFile::UnzipWithInflated(const ZipEntry &zipEntry, const uint16_t extraSi size_t inflateLen = UNZIP_BUF_OUT_LEN - zstream.avail_out; if (inflateLen > 0) { - dest.write((const char*)bufOut, inflateLen); + dest.write(reinterpret_cast(bufOut), inflateLen); zstream.next_out = bufOut; zstream.avail_out = UNZIP_BUF_OUT_LEN; errorTimes = 0; -- Gitee