diff --git a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp index 85671277a7da7d22fb12716cd2824b6dcf95b9c9..c31ff7b264d653b8fa65d3265fe0588fa7e5e4a7 100644 --- a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp +++ b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp @@ -312,7 +312,7 @@ static int32_t SetPublicDirHmdfsInfo(const std::string &physicalPath, const std: LOGE("Failed to get physical path stat with %{public}d", -errno); return -errno; } - hui.fileSize = buf.st_size; + hui.fileSize = static_cast(buf.st_size); return 0; } diff --git a/interfaces/kits/js/file_share/grant_uri_permission.cpp b/interfaces/kits/js/file_share/grant_uri_permission.cpp index 33c1ddc11a72b96bcd15a185451bd918c978b586..783fe7c814db0c745266d7951a27d96da43b2bb6 100644 --- a/interfaces/kits/js/file_share/grant_uri_permission.cpp +++ b/interfaces/kits/js/file_share/grant_uri_permission.cpp @@ -226,7 +226,7 @@ namespace ModuleFileShare { uriPermInfo.bundleName = string(bundleName.get()); if (NVal(env, funcArg[NARG_POS::THIRD]).TypeIs(napi_number)) { - auto [succFlag, flag] = NVal(env, funcArg[NARG_POS::THIRD]).ToInt32(); + auto [succFlag, flag] = NVal(env, funcArg[NARG_POS::THIRD]).ToUint32(); uriPermInfo.flag = flag; uriPermInfo.mode = GetModeFromFlag(flag); } else if (NVal(env, funcArg[NARG_POS::THIRD]).TypeIs(napi_string)) {