Kaydet (Commit) 5d950b3a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up C-style casts from pointers to void

Change-Id: Ide77480339e35a886f0d33c2a194244064c02488
üst 89d2e21a
......@@ -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;
......
......@@ -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 >();
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment