From 41a967af06a9584a997e11079c3c931d34158c09 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 18 May 2022 09:51:46 +0200 Subject: Extend loplugin:redundantcast to trivial reinterpret_cast from T to itself Change-Id: I7c0be7b435d6b5f97bdd40484023584146638d70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134506 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- basic/source/classes/sbxmod.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'basic/source/classes') diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 67bf03ef9ecb..1e5e7ec36a7f 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1450,7 +1450,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, sal_uInt16& nCol, bool bFollowJumps, const SbiImage* pImg ) const { - sal_uInt32 nPC = static_cast( p - reinterpret_cast(pImage->GetCode()) ); + sal_uInt32 nPC = static_cast( p - pImage->GetCode() ); while( nPC < pImage->GetCodeSize() ) { SbiOpcode eOp = static_cast( *p++ ); @@ -1460,7 +1460,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, SAL_WARN_IF( !pImg, "basic", "FindNextStmnt: pImg==NULL with FollowJumps option" ); sal_uInt32 nOp1 = *p++; nOp1 |= *p++ << 8; nOp1 |= *p++ << 16; nOp1 |= *p++ << 24; - p = reinterpret_cast(pImg->GetCode()) + nOp1; + p = pImg->GetCode() + nOp1; } else if( eOp >= SbiOpcode::SbOP1_START && eOp <= SbiOpcode::SbOP1_END ) { @@ -1497,7 +1497,7 @@ bool SbModule::IsBreakable( sal_uInt16 nLine ) const { if( !pImage ) return false; - const sal_uInt8* p = reinterpret_cast(pImage->GetCode()); + const sal_uInt8* p = pImage->GetCode(); sal_uInt16 nl, nc; while( ( p = FindNextStmnt( p, nl, nc ) ) != nullptr ) if( nl == nLine ) -- cgit