From d1f0c1d3bb42d80900ceeda62eb6de5586bcde3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BA=E5=B0=8F=E5=B8=85?= Date: Sun, 3 Apr 2022 08:13:30 +0800 Subject: [PATCH] Fix build for 64 bit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 贺小帅 Change-Id: I4cf053af525bd3ec1b648d8db6032ab2954569a4 --- interfaces/kits/js/src/file_manager_napi.cpp | 2 +- services/src/fileoper/external_storage_oper.cpp | 8 ++++---- services/src/fileoper/external_storage_utils.cpp | 7 ++++--- services/src/fileoper/media_file_oper.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) mode change 100644 => 100755 interfaces/kits/js/src/file_manager_napi.cpp mode change 100644 => 100755 services/src/fileoper/external_storage_oper.cpp mode change 100644 => 100755 services/src/fileoper/media_file_oper.cpp diff --git a/interfaces/kits/js/src/file_manager_napi.cpp b/interfaces/kits/js/src/file_manager_napi.cpp old mode 100644 new mode 100755 index 1aa3447c..399c37d5 --- 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 old mode 100644 new mode 100755 index d1999735..af9c01d6 --- 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..5a9788f7 100644 --- a/services/src/fileoper/external_storage_utils.cpp +++ b/services/src/fileoper/external_storage_utils.cpp @@ -16,6 +16,7 @@ #include "external_storage_utils.h" #include +#include #include #include #include @@ -113,7 +114,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}" PRId64", offset %{public}" PRId64, count, offset); std::string path; if (!ConvertUriToAbsolutePath(uri, path)) { ERR_LOG("invalid uri[%{private}s].", uri.c_str()); @@ -155,7 +156,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}" PRId64"].", MAX_NUM); } return SUCCESS; } @@ -203,4 +204,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 old mode 100644 new mode 100755 index c93f6ccb..3d5e69ee --- 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