diff --git a/services/bundlemgr_lite/src/bundle_manager_service.cpp b/services/bundlemgr_lite/src/bundle_manager_service.cpp index 8fab37213c353f00987b91d9d5c0065011430d9b..f72805e76856ac01d20ff12c3b9c3f9de4cbe596 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 0970ae951b6f86366aa6029cb00296d1f24a7d29..c680ba535b190467e2f1fd9d479d0ed8b64afce0 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;