From e7b4225fc8dbc8482150163b0e0c26f1fc3a7449 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 8 Jun 2015 16:29:59 +0200 Subject: loplugin:cstylecast: deal with remaining pointer casts Change-Id: I4e24ee646763e758a404bf0832e31e5cebc9d71d --- xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx | 12 ++++++------ xmlhelp/source/cxxhelp/provider/databases.cxx | 4 ++-- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 6 +++--- xmlhelp/source/treeview/tvfactory.cxx | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'xmlhelp') diff --git a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx index 1ed291f9859e..bfcdb2e367a8 100644 --- a/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx +++ b/xmlhelp/source/cxxhelp/provider/bufferedinputstream.cxx @@ -61,11 +61,11 @@ BufferedInputStream::BufferedInputStream(const Reference& xInputSt { tmp = m_pBuffer; m_pBuffer = new sal_Int8[m_nBufferSize+num]; - memcpy((void *)(m_pBuffer), - (void *)(tmp), + memcpy(static_cast(m_pBuffer), + static_cast(tmp), sal_uInt32(m_nBufferSize)); - memcpy((void *)(m_pBuffer+m_nBufferSize), - (void *)(aData.getArray()), + memcpy(static_cast(m_pBuffer+m_nBufferSize), + static_cast(aData.getArray()), sal_uInt32(num)); m_nBufferSize += num; delete[] tmp; @@ -134,8 +134,8 @@ sal_Int32 SAL_CALL BufferedInputStream::readBytes( Sequence< sal_Int8 >& aData,s if( aData.getLength() < nBytesToRead ) aData.realloc(nBytesToRead); - memcpy((void*)(aData.getArray()), - (void*)(m_pBuffer+m_nBufferLocation), + memcpy(static_cast(aData.getArray()), + static_cast(m_pBuffer+m_nBufferLocation), nBytesToRead); return nBytesToRead; diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 19a28f9a9928..e9bcfbf30810 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -436,7 +436,7 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const OUStrin OUString key = processLang(Language) + "/" + Module; std::pair< ModInfoTable::iterator,bool > aPair = - m_aModInfo.insert( ModInfoTable::value_type( key,(StaticModuleInformation*)0 ) ); + m_aModInfo.insert( ModInfoTable::value_type( key,nullptr ) ); ModInfoTable::iterator it = aPair.first; @@ -836,7 +836,7 @@ KeywordInfo* Databases::getKeyword( const OUString& Database, OUString key = processLang(Language) + "/" + Database; std::pair< KeywordInfoTable::iterator,bool > aPair = - m_aKeywordInfo.insert( KeywordInfoTable::value_type( key,(KeywordInfo*)0 ) ); + m_aKeywordInfo.insert( KeywordInfoTable::value_type( key,nullptr ) ); KeywordInfoTable::iterator it = aPair.first; diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 3db0233a09c7..277405700521 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -712,7 +712,7 @@ zipOpen(SAL_UNUSED_PARAMETER const char *) { OUString language,jar,path; if( !ugblData->m_pInitial->get_eid().isEmpty() ) - return (void*)(new Reference< XHierarchicalNameAccess >); + return static_cast(new Reference< XHierarchicalNameAccess >); else { jar = ugblData->m_pInitial->get_jar(); @@ -1143,8 +1143,8 @@ void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ ) char* tmp = buffer; buffer = new char[ len+len_ ]; - memcpy( (void*)(buffer),(void*)(tmp),sal_uInt32( len ) ); - memcpy( (void*)(buffer+len),(void*)(buffer_),sal_uInt32( len_ ) ); + memcpy( static_cast(buffer),static_cast(tmp),sal_uInt32( len ) ); + memcpy( static_cast(buffer+len),static_cast(buffer_),sal_uInt32( len_ ) ); delete[] tmp; len += len_; } diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx index e76fcfeb4a25..81881f828ca2 100644 --- a/xmlhelp/source/treeview/tvfactory.cxx +++ b/xmlhelp/source/treeview/tvfactory.cxx @@ -171,7 +171,7 @@ Reference< XInterface > SAL_CALL TVFactory::CreateInstance( const Reference< XMultiServiceFactory >& xMultiServiceFactory ) { - XServiceInfo* xP = (XServiceInfo*) new TVFactory( comphelper::getComponentContext(xMultiServiceFactory) ); + XServiceInfo* xP = static_cast(new TVFactory( comphelper::getComponentContext(xMultiServiceFactory) )); return Reference< XInterface >::query( xP ); } -- cgit