cppu/source/uno/copy.hxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
New commits: commit 0a347396d35876564031df7cf7ac3ee149e76fb7 Author: Bogdan Buzea <[email protected]> AuthorDate: Mon Oct 21 17:47:37 2024 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Oct 23 11:57:15 2024 +0200 tdf#163486: PVS: Identical branches V1037 Two or more case-branches perform the same actions. Check lines: 152, 194 V1037 Two or more case-branches perform the same actions. Check lines: 565, 592 Change-Id: I52ec0921c898ca74473631ba36a76f6444ce07d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175358 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx index 6a71d413faee..10985a87a16f 100644 --- a/cppu/source/uno/copy.hxx +++ b/cppu/source/uno/copy.hxx @@ -149,6 +149,7 @@ inline void _copyConstructAnyFromData( break; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: // enum is forced to 32bit long pDestAny->pData = &pDestAny->pReserved; *static_cast<sal_Int32 *>(pDestAny->pData) = *static_cast<sal_Int32 *>(pSource); break; @@ -190,11 +191,6 @@ inline void _copyConstructAnyFromData( case typelib_TypeClass_ANY: OSL_FAIL( "### unexpected nested any!" ); break; - case typelib_TypeClass_ENUM: - pDestAny->pData = &pDestAny->pReserved; - // enum is forced to 32bit long - *static_cast<sal_Int32 *>(pDestAny->pData) = *static_cast<sal_Int32 *>(pSource); - break; case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: if (pTypeDescr) @@ -562,6 +558,7 @@ inline void _copyConstructData( break; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: *static_cast<sal_Int32 *>(pDest) = *static_cast<sal_Int32 *>(pSource); break; case typelib_TypeClass_HYPER: @@ -588,9 +585,6 @@ inline void _copyConstructData( static_cast<uno_Any *>(pSource)->pType, nullptr, acquire, mapping ); break; - case typelib_TypeClass_ENUM: - *static_cast<sal_Int32 *>(pDest) = *static_cast<sal_Int32 *>(pSource); - break; case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: if (pTypeDescr)
