diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:04:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:21 +0100 |
commit | 5d950b3afd91e87035d24b550f29d0b3a7c5033b (patch) | |
tree | 6333d83db4b1c66e823185c37b42c53103aa9cf1 /framework | |
parent | 89d2e21af6909e5d2526eb7b11c7cf87bac23c01 (diff) |
Clean up C-style casts from pointers to void
Change-Id: Ide77480339e35a886f0d33c2a194244064c02488
Diffstat (limited to 'framework')
6 files changed, 17 insertions, 17 deletions
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index 1619051cd74e..7f961e798204 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -97,7 +97,7 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, pParam) if ( ! pParam) return 0L; - const VclWindowEvent* pEvent = (VclWindowEvent*)pParam; + const VclWindowEvent* pEvent = static_cast<VclWindowEvent*>(pParam); if (pEvent->GetId() == VCLEVENT_OBJECT_DYING) { impl_stopListening(); @@ -106,7 +106,7 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, pParam) if (pEvent->GetId() != VCLEVENT_WINDOW_COMMAND) return 0L; - const CommandEvent* pCommand = (CommandEvent*)pEvent->GetData(); + const CommandEvent* pCommand = static_cast<CommandEvent*>(pEvent->GetData()); if (pCommand->GetCommand() != COMMAND_SHOWDIALOG) return 0L; diff --git a/framework/source/fwe/classes/imagewrapper.cxx b/framework/source/fwe/classes/imagewrapper.cxx index 6120a04480fe..7ab6fd8221ce 100644 --- a/framework/source/fwe/classes/imagewrapper.cxx +++ b/framework/source/fwe/classes/imagewrapper.cxx @@ -69,7 +69,7 @@ Sequence< sal_Int8 > SAL_CALL ImageWrapper::getDIB() throw ( RuntimeException, s SvMemoryStream aMem; WriteDIB(m_aImage.GetBitmapEx().GetBitmap(), aMem, false, true); - return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() ); + return Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() ); } Sequence< sal_Int8 > SAL_CALL ImageWrapper::getMaskDIB() throw ( RuntimeException, std::exception ) @@ -81,13 +81,13 @@ Sequence< sal_Int8 > SAL_CALL ImageWrapper::getMaskDIB() throw ( RuntimeExceptio { SvMemoryStream aMem; WriteDIB(aBmpEx.GetAlpha().GetBitmap(), aMem, false, true); - return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() ); + return Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() ); } else if ( aBmpEx.IsTransparent() ) { SvMemoryStream aMem; WriteDIB(aBmpEx.GetMask(), aMem, false, true); - return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() ); + return Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() ); } return Sequence< sal_Int8 >(); diff --git a/framework/source/fwi/helper/networkdomain.cxx b/framework/source/fwi/helper/networkdomain.cxx index 6ea2a37f5469..bbb2a1526b0d 100644 --- a/framework/source/fwi/helper/networkdomain.cxx +++ b/framework/source/fwi/helper/networkdomain.cxx @@ -139,7 +139,7 @@ static rtl_uString *getDomainName() do { nBufSize += 256; /* Increase buffer size by steps of 256 bytes */ - pBuffer = (char *)alloca( nBufSize ); + pBuffer = static_cast<char *>(alloca( nBufSize )); result = getdomainname( pBuffer, nBufSize ); /* If buffersize in not large enough -1 is returned and errno is set to EINVAL. This only applies to libc. With glibc the name diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index 93eb99286a13..4254ead4e8f8 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -48,7 +48,7 @@ extern "C" { static int SAL_CALL compare_OUString_Property_Impl( const void *arg1, const void *arg2 ) { - return ((OUString *)arg1)->compareTo( ((Property *)arg2)->Name ); + return static_cast<OUString const *>(arg1)->compareTo( static_cast<Property const *>(arg2)->Name ); } } @@ -89,9 +89,9 @@ Sequence< Property > OPropertySetHelperInfo_Impl::getProperties(void) throw(::co Property OPropertySetHelperInfo_Impl::getPropertyByName( const OUString & PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) { Property * pR; - pR = (Property *)bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(), + pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(), sizeof( Property ), - compare_OUString_Property_Impl ); + compare_OUString_Property_Impl )); if( !pR ) { throw UnknownPropertyException(); } @@ -105,9 +105,9 @@ Property OPropertySetHelperInfo_Impl::getPropertyByName( const OUString & Proper sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & PropertyName ) throw(::com::sun::star::uno::RuntimeException, std::exception) { Property * pR; - pR = (Property *)bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(), + pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(), sizeof( Property ), - compare_OUString_Property_Impl ); + compare_OUString_Property_Impl )); return pR != NULL; } diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx index 3de9ef6356b0..48affcc5dd59 100644 --- a/framework/source/recording/dispatchrecorder.cxx +++ b/framework/source/recording/dispatchrecorder.cxx @@ -58,7 +58,7 @@ void flatten_struct_members( for ( sal_Int32 nPos = 0; nPos < pTD->nMembers; ++nPos ) { vec->push_back( - Any( (char const *)data + pTD->pMemberOffsets[ nPos ], pTD->ppTypeRefs[ nPos ] ) ); + Any( static_cast<char const *>(data) + pTD->pMemberOffsets[ nPos ], pTD->ppTypeRefs[ nPos ] ) ); } } @@ -254,7 +254,7 @@ void SAL_CALL DispatchRecorder::AppendToBuffer( css::uno::Any aValue, OUStringBu else if (aValue.getValueType() == getCppuCharType()) { // character variables are recorded as strings, back conversion must be handled in client code - sal_Unicode nVal = *((sal_Unicode*)aValue.getValue()); + sal_Unicode nVal = *static_cast<sal_Unicode const *>(aValue.getValue()); aArgumentBuffer.appendAscii("\""); if ( (sal_Unicode(nVal) == '\"') ) // encode \" to \"\" @@ -416,9 +416,9 @@ void SAL_CALL DispatchRecorder::replaceByIndex(sal_Int32 idx, const com::sun::st } - com::sun::star::frame::DispatchStatement *pStatement; + com::sun::star::frame::DispatchStatement const *pStatement; - pStatement = (com::sun::star::frame::DispatchStatement *)element.getValue(); + pStatement = static_cast<com::sun::star::frame::DispatchStatement const *>(element.getValue()); com::sun::star::frame::DispatchStatement aStatement( pStatement->aCommand, diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 28b743674415..a5f76ecc5696 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -149,7 +149,7 @@ void SAL_CALL AddonsToolBarManager::dispose() throw( RuntimeException, std::exce if ( nId > 0 ) { - AddonsParams* pRuntimeItemData = (AddonsParams*)m_pToolBar->GetItemData( nId ); + AddonsParams* pRuntimeItemData = static_cast<AddonsParams*>(m_pToolBar->GetItemData( nId )); if ( pRuntimeItemData ) delete pRuntimeItemData; m_pToolBar->SetItemData( nId, NULL ); @@ -181,7 +181,7 @@ void AddonsToolBarManager::RefreshImages() { OUString aCommandURL = m_pToolBar->GetItemCommand( nId ); OUString aImageId; - AddonsParams* pRuntimeItemData = (AddonsParams*)m_pToolBar->GetItemData( nId ); + AddonsParams* pRuntimeItemData = static_cast<AddonsParams*>(m_pToolBar->GetItemData( nId )); if ( pRuntimeItemData ) aImageId = pRuntimeItemData->aImageId; |