From 24965b41c60ca8d0298465aff34cff8d05c6123d Mon Sep 17 00:00:00 2001 From: lijiahao Date: Fri, 15 Jul 2022 14:12:00 +0800 Subject: [PATCH] modified: parcel.h description: Avoid implicit type conversion issue: https://gitee.com/openharmony/commonlibrary_c_utils/issues/I5H8QS?from=project-issue Signed-off-by: lijiahao --- base/include/parcel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/include/parcel.h b/base/include/parcel.h index a011996..9928335 100644 --- a/base/include/parcel.h +++ b/base/include/parcel.h @@ -362,7 +362,8 @@ sptr Parcel::ReadObject() if (!this->CheckOffsets()) { return nullptr; } - return T::Unmarshalling(*this); + sptr res(T::Unmarshalling(*this)); + return res; } // Read data from the given parcel into this parcelable object. @@ -373,7 +374,6 @@ T *Parcel::ReadParcelable() if (size == 0) { return nullptr; } - return T::Unmarshalling(*this); } @@ -385,8 +385,8 @@ sptr Parcel::ReadStrongParcelable() if (size == 0) { return nullptr; } - - return T::Unmarshalling(*this); + sptr res(T::Unmarshalling(*this)); + return res; } } // namespace OHOS -- Gitee