diff --git a/interfaces/kits/js/src/common/ani_helper/ani_signature.cpp b/interfaces/kits/js/src/common/ani_helper/ani_signature.cpp index c4cb141374aeec94eb60c4acfa2f22cec4027838..a632f6f88bcf3f525da01aee43c3fec964e25f29 100644 --- a/interfaces/kits/js/src/common/ani_helper/ani_signature.cpp +++ b/interfaces/kits/js/src/common/ani_helper/ani_signature.cpp @@ -81,7 +81,7 @@ const string FS::FileInner::ctorSig = Builder::BuildSignatureDescriptor({ BasicT const Type FS::ProgressInner::classType = Builder::BuildClass("@ohos.file.fs.fileIo.ProgressInner"); const string FS::ProgressInner::classDesc = FS::ProgressInner::classType.Descriptor(); const string FS::ProgressInner::ctorSig = - Builder::BuildSignatureDescriptor({ BasicTypes::doubleType, BasicTypes::doubleType }); + Builder::BuildSignatureDescriptor({ BasicTypes::longType, BasicTypes::longType }); // FS::RandomAccessFileInner const Type FS::RandomAccessFileInner::classType = Builder::BuildClass("@ohos.file.fs.fileIo.RandomAccessFileInner"); const string FS::RandomAccessFileInner::classDesc = FS::RandomAccessFileInner::classType.Descriptor(); diff --git a/interfaces/kits/js/src/common/ani_helper/type_converter.cpp b/interfaces/kits/js/src/common/ani_helper/type_converter.cpp index 6f13fa40e22e15827540399e5131b9fefb9418f2..662006f953758d7a46e3c4f93c76cbf5a17bcd2d 100644 --- a/interfaces/kits/js/src/common/ani_helper/type_converter.cpp +++ b/interfaces/kits/js/src/common/ani_helper/type_converter.cpp @@ -166,7 +166,7 @@ static std::tuple ParseFd(ani_env *env, const ani_object &pathOrF { ani_boolean isFd = false; - auto classDesc = BoxedTypes::Double::classDesc.c_str(); + auto classDesc = BoxedTypes::Int::classDesc.c_str(); ani_class cls; env->FindClass(classDesc, &cls); env->Object_InstanceOf(pathOrFd, cls, &isFd); diff --git a/interfaces/kits/js/src/mod_fs/properties/ani/create_randomaccessfile_ani.cpp b/interfaces/kits/js/src/mod_fs/properties/ani/create_randomaccessfile_ani.cpp index d7936360b8949ccb06793b420c6f8fdefb1f2a98..345181b028e86ddf886083635b106a9644882c7f 100644 --- a/interfaces/kits/js/src/mod_fs/properties/ani/create_randomaccessfile_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/ani/create_randomaccessfile_ani.cpp @@ -186,13 +186,13 @@ ani_object CreateRandomAccessFileAni::CreateRandomAccessFileSync( if (isPath) { return CreateRandomAccessFileByString(env, file, mode, op); } else { - ani_double fdOp; - if (ANI_OK != env->Object_GetPropertyByName_Double(file, "fd", &fdOp)) { + ani_int fd; + if (ANI_OK != env->Object_GetPropertyByName_Int(file, "fd", &fd)) { HILOGE("Get fd in class file failed"); ErrorHandler::Throw(env, EINVAL); return nullptr; } - int32_t fd = static_cast(fdOp); + FsResult ret = CreateRandomAccessFileCore::DoCreateRandomAccessFile(fd, op); if (!ret.IsSuccess()) { HILOGE("CreateRandomAccessFile failed"); diff --git a/interfaces/kits/js/src/mod_fs/properties/copy_listener/ani/progress_listener_ani.cpp b/interfaces/kits/js/src/mod_fs/properties/copy_listener/ani/progress_listener_ani.cpp index f9b15b0dbc2bd62fb2409f25f2ff7e138298d449..e7379f4a39b5626a7bbc25d913dba0a2d589500f 100644 --- a/interfaces/kits/js/src/mod_fs/properties/copy_listener/ani/progress_listener_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/copy_listener/ani/progress_listener_ani.cpp @@ -42,8 +42,8 @@ static ani_object WrapCopyProgress(ani_env *env, uint64_t progressSize, uint64_t return nullptr; } - const ani_double aniProgressSize = static_cast(progressSize <= MAX_VALUE ? progressSize : 0); - const ani_double aniTotalSize = static_cast(totalSize <= MAX_VALUE ? totalSize : 0); + const ani_long aniProgressSize = static_cast(progressSize <= MAX_VALUE ? progressSize : 0); + const ani_long aniTotalSize = static_cast(totalSize <= MAX_VALUE ? totalSize : 0); ani_object obj; if (ANI_OK != env->Object_New(cls, ctor, &obj, aniProgressSize, aniTotalSize)) {