From 581c5075bbbb8068e2285c3392b712f41083cfb4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 31 Mar 2015 13:12:34 +0200 Subject: Reduce to static_cast any reinterpret_cast from void pointers Change-Id: I062024d4768374e319b6c67ed8c7abcc89f9d552 --- comphelper/source/misc/types.cxx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'comphelper/source/misc/types.cxx') diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx index bb060c4ea912..4d9a074a9a34 100644 --- a/comphelper/source/misc/types.cxx +++ b/comphelper/source/misc/types.cxx @@ -167,7 +167,7 @@ template bool tryCompare(const void* _pData, const Any& _rValue, bool& _bIdentical, TYPE& _rOut) { bool bSuccess = _rValue >>= _rOut; - _bIdentical = bSuccess && (_rOut == *reinterpret_cast(_pData)); + _bIdentical = bSuccess && (_rOut == *static_cast(_pData)); return bSuccess; } @@ -191,13 +191,13 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) // beides AnyWerte if (_rValue.getValueType().getTypeClass() == TypeClass_ANY) bRes = compare_impl( - reinterpret_cast(pData)->getValueType(), - reinterpret_cast(pData)->getValue(), - *reinterpret_cast(_rValue.getValue())); + static_cast(pData)->getValueType(), + static_cast(pData)->getValue(), + *static_cast(_rValue.getValue())); else bRes = compare_impl( - reinterpret_cast(pData)->getValueType(), - reinterpret_cast(pData)->getValue(), + static_cast(pData)->getValueType(), + static_cast(pData)->getValue(), _rValue); } else if ( (_rType.getTypeClass() == TypeClass_VOID) @@ -261,7 +261,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) { sal_Int32 nAsInt32 = 0; bConversionSuccess = ::cppu::enum2int(nAsInt32, _rValue); - bRes = bConversionSuccess && (nAsInt32== *reinterpret_cast(pData)); + bRes = bConversionSuccess && (nAsInt32== *static_cast(pData)); break; } case TypeClass_LONG: @@ -327,7 +327,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()) == 0; @@ -339,7 +339,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()) == 0; @@ -351,7 +351,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()*sizeof(sal_Int16)) == 0; @@ -363,7 +363,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()*sizeof(sal_uInt16)) == 0; @@ -375,7 +375,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()*sizeof(sal_Int32)) == 0; @@ -387,7 +387,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence& rLeftSeq = *static_cast*>(pData); const Sequence& rRightSeq = aTemp; bRes = rLeftSeq.getLength() == rRightSeq.getLength() && memcmp(rLeftSeq.getConstArray(), rRightSeq.getConstArray(), rLeftSeq.getLength()*sizeof(sal_uInt32)) == 0; @@ -399,7 +399,7 @@ bool compare_impl(const Type& _rType, const void* pData, const Any& _rValue) bConversionSuccess = _rValue >>= aTemp; if (bConversionSuccess) { - const Sequence< OUString >& rLeftSeq = *reinterpret_cast*>(pData); + const Sequence< OUString >& rLeftSeq = *static_cast*>(pData); const Sequence< OUString >& rRightSeq = aTemp; sal_Int32 nSeqLen = rLeftSeq.getLength(); bRes = ( nSeqLen == rRightSeq.getLength() ); -- cgit