From 49e7f232fd641f8c0261c12b31727954a82340b5 Mon Sep 17 00:00:00 2001 From: zff Date: Sat, 2 Apr 2022 21:45:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=8164=E4=BD=8D=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close: #I5113F Signed-off-by: zff Change-Id: I8905c71e1355e6cc7e795bf89b00f68645559028 --- interfaces/kits/js/src/file_manager_napi.cpp | 2 +- services/src/fileoper/external_storage_oper.cpp | 8 ++++---- services/src/fileoper/external_storage_utils.cpp | 6 +++--- services/src/fileoper/media_file_oper.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/interfaces/kits/js/src/file_manager_napi.cpp b/interfaces/kits/js/src/file_manager_napi.cpp index 1aa3447c..399c37d5 100644 --- a/interfaces/kits/js/src/file_manager_napi.cpp +++ b/interfaces/kits/js/src/file_manager_napi.cpp @@ -184,7 +184,7 @@ static bool CreateFileArray(napi_env env, shared_ptr arg) NVal obj = NVal::CreateObject(env); shared_ptr res = arg->fileRes_[i]; if (res == nullptr) { - ERR_LOG("inner error, lack of memory, file count %{public}d", arg->fileRes_.size()); + ERR_LOG("inner error, lack of memory, file count %{public}zu", arg->fileRes_.size()); return false; } obj.AddProp("name", NVal::CreateUTF8String(env, res->GetName()).val_); diff --git a/services/src/fileoper/external_storage_oper.cpp b/services/src/fileoper/external_storage_oper.cpp index d1999735..af9c01d6 100644 --- a/services/src/fileoper/external_storage_oper.cpp +++ b/services/src/fileoper/external_storage_oper.cpp @@ -73,7 +73,7 @@ int ExternalStorageOper::GetRoot(const std::string &name, const std::string &pat cmdResponse.SetErr(ret); cmdResponse.SetFileInfoList(fileList); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity%{public}zu", reply.GetDataCapacity()); } return ret; } @@ -86,7 +86,7 @@ int ExternalStorageOper::CreateFile(const std::string &uri, const std::string &n cmdResponse.SetErr(ret); cmdResponse.SetUri(resultUir); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity:%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity:%{public}zu", reply.GetDataCapacity()); } return ret; } @@ -100,9 +100,9 @@ int ExternalStorageOper::ListFile(const std::string &type, const std::string &ur cmdResponse.SetErr(ret); cmdResponse.SetFileInfoList(fileList); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity:%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity:%{public}zu", reply.GetDataCapacity()); } return ret; } } // namespace FileManagerService -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/src/fileoper/external_storage_utils.cpp b/services/src/fileoper/external_storage_utils.cpp index 88403985..1cff272a 100644 --- a/services/src/fileoper/external_storage_utils.cpp +++ b/services/src/fileoper/external_storage_utils.cpp @@ -113,7 +113,7 @@ int ExternalStorageUtils::DoListFile(const std::string &type, const std::string ERR_LOG("invalid file count or offset."); return E_INVALID_FILE_NUMBER; } - DEBUG_LOG("limit %{public}lld, offset %{public}lld", count, offset); + DEBUG_LOG("limit %{public}lld, offset %{public}lld", (long long)count, (long long)offset); std::string path; if (!ConvertUriToAbsolutePath(uri, path)) { ERR_LOG("invalid uri[%{private}s].", uri.c_str()); @@ -155,7 +155,7 @@ int ExternalStorageUtils::DoListFile(const std::string &type, const std::string } closedir(dir); if (option.GetCount() == MAX_NUM && count == 0) { - DEBUG_LOG("get files with MAX_NUM:[%{public}lld].", MAX_NUM); + DEBUG_LOG("get files with MAX_NUM:[%{public}lld].", (long long)MAX_NUM); } return SUCCESS; } @@ -203,4 +203,4 @@ int ExternalStorageUtils::DoGetRoot(const std::string &name, const std::string & return SUCCESS; } } // namespace FileManagerService -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/src/fileoper/media_file_oper.cpp b/services/src/fileoper/media_file_oper.cpp index c93f6ccb..3d5e69ee 100644 --- a/services/src/fileoper/media_file_oper.cpp +++ b/services/src/fileoper/media_file_oper.cpp @@ -86,7 +86,7 @@ int MediaFileOper::CreateFile(const std::string &name, const std::string &path, cmdResponse.SetErr(ret); cmdResponse.SetUri(uri); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity:%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity:%{public}zu", reply.GetDataCapacity()); } return ret; } @@ -99,7 +99,7 @@ int MediaFileOper::GetRoot(const std::string &name, const std::string &path, Mes cmdResponse.SetErr(ret); cmdResponse.SetFileInfoList(fileList); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity%{public}zu", reply.GetDataCapacity()); } return ret; } @@ -118,7 +118,7 @@ int MediaFileOper::ListFile(const string &type, const string &path, int offset, cmdResponse.SetErr(res); cmdResponse.SetFileInfoList(fileList); if (!reply.WriteParcelable(&cmdResponse)) { - ERR_LOG("reply write err parcel capacity:%{public}d", reply.GetDataCapacity()); + ERR_LOG("reply write err parcel capacity:%{public}zu", reply.GetDataCapacity()); } return res; } @@ -130,4 +130,4 @@ int MediaFileOper::Mkdir(const string &name, const string &path) const return SUCCESS; } } // namespace FileManagerService -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee