From 76d762fea934df31cd81768d467d5d40d439cb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 5 May 2024 16:50:03 +0100 Subject: [PATCH] do the casts just once so this is readable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idb9eefa31c084604a134f28892b333c56f6d6fc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167161 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/core/bastyp/calc.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1633090972d0..fbfc4b701457 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -119,22 +119,22 @@ const sal_Int32 coContFlags = & ~i18n::KParseTokens::IGNORE_LEADING_WS; extern "C" { -static int OperatorCompare( const void *pFirst, const void *pSecond) +static int OperatorCompare(const void *pA, const void *pB) { + const CalcOp *pFirst = static_cast(pA); + const CalcOp *pSecond = static_cast(pB); + int nRet = 0; - if( CALC_NAME == static_cast(pFirst)->eOp ) + if( CALC_NAME == pFirst->eOp ) { - nRet = static_cast(pFirst)->aName.compareTo( - static_cast(pSecond)->aName ); + nRet = pFirst->aName.compareTo(pSecond->aName ); } else { - if( CALC_NAME == static_cast(pSecond)->eOp ) - nRet = -1 * static_cast(pSecond)->aName.compareTo( - static_cast(pFirst)->aName ); + if( CALC_NAME == pSecond->eOp ) + nRet = -1 * pSecond->aName.compareTo(pFirst->aName); else - nRet = static_cast(pFirst)->aName.compareTo( - static_cast(pSecond)->aName ); + nRet = pFirst->aName.compareTo(pSecond->aName); } return nRet; }