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 1aa3447c6114ceb32ee6eea3a1b6f644d90cce35..399c37d59097bd7aa3bda506b31a4af2198fae0c --- 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 d19997353d4e5a09e05c69d819bb4d1fabcaa0b1..af9c01d6b7cfccf5c6863c56bf109a062866ca96 --- 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 884039858bcacbaf528fffcf14a871b1495de998..5a9788f7717a92e690f6327c801924c508d096f4 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 c93f6ccb6f6c1f6cbe6a79f3e91ebab73bfa3fe9..3d5e69eed8ae3ca107dbdcfc4c795042101dc5a9 --- 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