summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-08 16:29:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-08 16:29:21 +0200
commit8df62de7a037ee9e222b304662953f2b7aecce50 (patch)
treea9b247269de492e4f2b63576858d7bad31eb2f0d
parent8ca53be757b16be721dbdd334459b962b15980e1 (diff)
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I9408d28393ff3654dd81c0240d7665b72b3c189c
-rw-r--r--ucb/source/core/FileAccess.cxx8
-rw-r--r--ucb/source/core/ucbstore.cxx4
-rw-r--r--ucb/source/sorter/sortdynres.cxx4
-rw-r--r--ucb/source/sorter/sortresult.cxx4
-rw-r--r--ucb/source/ucp/file/bc.cxx2
-rw-r--r--ucb/source/ucp/file/filstr.cxx2
-rw-r--r--ucb/source/ucp/file/prov.cxx2
-rw-r--r--ucb/source/ucp/file/shell.cxx4
-rw-r--r--ucb/source/ucp/ftp/ftpcontentprovider.cxx4
-rw-r--r--ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx2
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx8
11 files changed, 22 insertions, 22 deletions
diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx
index 292939a6a627..4e36b7664f9c 100644
--- a/ucb/source/core/FileAccess.cxx
+++ b/ucb/source/core/FileAccess.cxx
@@ -543,7 +543,7 @@ Reference< XInputStream > OFileAccess::openFileRead( const OUString& FileURL )
INetURLObject aObj( FileURL, INetProtocol::File );
ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment, comphelper::getProcessComponentContext() );
- Reference< XActiveDataSink > xSink = (XActiveDataSink*)(new OActiveDataSink());
+ Reference< XActiveDataSink > xSink = static_cast<XActiveDataSink*>(new OActiveDataSink());
try
{
@@ -572,7 +572,7 @@ Reference< XOutputStream > OFileAccess::openFileWrite( const OUString& FileURL )
Reference< XStream > OFileAccess::openFileReadWrite( const OUString& FileURL )
throw(CommandAbortedException, Exception, RuntimeException, std::exception)
{
- Reference< XActiveDataStreamer > xSink = (XActiveDataStreamer*)new OActiveDataStreamer();
+ Reference< XActiveDataStreamer > xSink = static_cast<XActiveDataStreamer*>(new OActiveDataStreamer());
Reference< XInterface > xSinkIface = Reference< XInterface >::query( xSink );
OpenCommandArgument2 aArg;
@@ -637,7 +637,7 @@ void OFileAccess::setInteractionHandler( const Reference< XInteractionHandler >&
if( !mpEnvironment )
{
mpEnvironment = new OCommandEnvironment();
- mxEnvironment = (XCommandEnvironment*)mpEnvironment;
+ mxEnvironment = static_cast<XCommandEnvironment*>(mpEnvironment);
}
mpEnvironment->setHandler( Handler );
}
@@ -775,7 +775,7 @@ void OFileAccess::setHidden( const OUString& FileURL, sal_Bool bHidden )
Reference< XInterface > SAL_CALL FileAccess_CreateInstance( const Reference< XMultiServiceFactory > & xSMgr )
{
- return Reference < XInterface >( ( cppu::OWeakObject * ) new OFileAccess( comphelper::getComponentContext(xSMgr) ) );
+ return Reference < XInterface >( static_cast<cppu::OWeakObject *>(new OFileAccess( comphelper::getComponentContext(xSMgr) )) );
}
Sequence< OUString > FileAccess_getSupportedServiceNames()
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 51eebb122795..545c23403e01 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -1332,7 +1332,7 @@ void SAL_CALL PersistentPropertySet::setPropertyValue( const OUString& aProperty
xRootHierNameAccess->getByHierarchicalName( aValueName )
>>= nHandle;
- aEvt.Source = (OWeakObject*)this;
+ aEvt.Source = static_cast<OWeakObject*>(this);
aEvt.PropertyName = aPropertyName;
aEvt.PropertyHandle = nHandle;
aEvt.Further = sal_False;
@@ -2068,7 +2068,7 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
if ( m_pImpl->m_pPropertyChangeListeners )
{
PropertyChangeEvent aEvt;
- aEvt.Source = (OWeakObject*)this;
+ aEvt.Source = static_cast<OWeakObject*>(this);
aEvt.PropertyName = rNewValue.Name;
aEvt.PropertyHandle = rNewValue.Handle;
aEvt.Further = sal_False;
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 214a589118ea..87a1703023ca 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -494,8 +494,8 @@ SortedDynamicResultSetFactory_CreateInstance( const css::uno::Reference<
css::lang::XMultiServiceFactory> & rSMgr )
throw( css::uno::Exception )
{
- css::lang::XServiceInfo* pX = (css::lang::XServiceInfo*)
- new SortedDynamicResultSetFactory( ucbhelper::getComponentContext(rSMgr) );
+ css::lang::XServiceInfo* pX = static_cast<css::lang::XServiceInfo*>(
+ new SortedDynamicResultSetFactory( ucbhelper::getComponentContext(rSMgr) ));
return css::uno::Reference< css::uno::XInterface >::query( pX );
}
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 5e4c81e96125..97955830281e 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1417,7 +1417,7 @@ void SortedResultSet::Initialize(
size_t i;
for ( i=1; i<maS2O.Count(); i++ )
- maO2S.Insert( (void*) 0, i ); // Insert( data, pos )
+ maO2S.Insert( nullptr, i ); // Insert( data, pos )
for ( i=1; i<maS2O.Count(); i++ )
maO2S.Replace( reinterpret_cast<void*>(i), maS2O[ i ] ); // Insert( data, pos )
@@ -1530,7 +1530,7 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv
SortListData *pData = maS2O.Remove( nSortPos );
if ( pData->mbModified )
- maModList.Remove( (void*) pData );
+ maModList.Remove( static_cast<void*>(pData) );
delete pData;
// generate remove Event, but not for new entries
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index f6f086de729f..3920d9ebb2db 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1218,7 +1218,7 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
getTitle(m_aUncPath),
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8),
- (cppu::OWeakObject*)this,
+ static_cast<cppu::OWeakObject*>(this),
m_pMyShell,nMyCommandIdentifier);
uno::Reference< task::XInteractionRequest > aReq( aRequestImpl );
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 287381294cb2..988103519e9a 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -213,7 +213,7 @@ XStream_impl::writeBytes( const uno::Sequence< sal_Int8 >& aData )
{
sal_uInt64 nWrittenBytes(0);
const sal_Int8* p = aData.getConstArray();
- if(osl::FileBase::E_None != m_aFile.write(((void*)(p)),sal_uInt64(length),nWrittenBytes) ||
+ if(osl::FileBase::E_None != m_aFile.write((static_cast<void const *>(p)),sal_uInt64(length),nWrittenBytes) ||
nWrittenBytes != length )
throw io::IOException( THROW_WHERE );
}
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index de4ef78c768c..5da8d6e7f0ba 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -182,7 +182,7 @@ Reference< XInterface > SAL_CALL
FileProvider::CreateInstance(
const Reference< XMultiServiceFactory >& xMultiServiceFactory )
{
- XServiceInfo* xP = (XServiceInfo*) new FileProvider( comphelper::getComponentContext(xMultiServiceFactory) );
+ XServiceInfo* xP = static_cast<XServiceInfo*>(new FileProvider( comphelper::getComponentContext(xMultiServiceFactory) ));
return Reference< XInterface >::query( xP );
}
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 4aa1b02465d4..300922e03070 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -591,7 +591,7 @@ void SAL_CALL shell::page( sal_Int32 CommandId,
do
{
- err = aFile.read( (void*) BFF,bfz,nrc );
+ err = aFile.read( static_cast<void*>(BFF),bfz,nrc );
if( err == osl::FileBase::E_None )
{
uno::Sequence< sal_Int8 > seq( BFF, (sal_uInt32)nrc );
@@ -1868,7 +1868,7 @@ shell::write( sal_Int32 CommandId,
{
const sal_Int8* p = seq.getConstArray();
- err = aFile.write( ((void*)(p)),
+ err = aFile.write( (static_cast<void const *>(p)),
sal_uInt64( nReadBytes ),
nWrittenBytes );
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index 35afa610333e..8fb30a4af342 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -140,8 +140,8 @@ FTPContentProvider_CreateInstance( const css::uno::Reference<
css::lang::XMultiServiceFactory> & rSMgr )
throw( css::uno::Exception )
{
- css::lang::XServiceInfo* pX = (css::lang::XServiceInfo*)
- new FTPContentProvider( ucbhelper::getComponentContext(rSMgr) );
+ css::lang::XServiceInfo* pX = static_cast<css::lang::XServiceInfo*>(
+ new FTPContentProvider( ucbhelper::getComponentContext(rSMgr) ));
return css::uno::Reference< css::uno::XInterface >::query( pX );
}
diff --git a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
index fa94624cc94f..7ed95627988f 100644
--- a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
@@ -273,7 +273,7 @@ NeonPropFindRequest::NeonPropFindRequest( HttpSession* inSession,
}
for ( theIndex = 0; theIndex < thePropCount; theIndex ++ )
- free( (void *)thePropNames[ theIndex ].name );
+ free( const_cast<char *>(thePropNames[ theIndex ].name) );
}
else
{
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 535abde4d134..e1adfe1776cd 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1009,9 +1009,9 @@ void NeonSession::PROPPATCH( const OUString & inPath,
for ( n = 0; n < nPropCount; ++n )
{
- free( (void *)pItems[ n ].name->name );
+ free( const_cast<char *>(pItems[ n ].name->name) );
delete pItems[ n ].name;
- free( (void *)pItems[ n ].value );
+ free( const_cast<char *>(pItems[ n ].value) );
}
delete [] pItems;
@@ -1989,8 +1989,8 @@ NeonSession::getDataFromInputStream(
rData.realloc( nPos + nRead );
aBuffer.realloc( nRead );
- memcpy( (void*)( rData.getArray() + nPos ),
- (const void*)aBuffer.getConstArray(),
+ memcpy( static_cast<void*>( rData.getArray() + nPos ),
+ static_cast<const void*>(aBuffer.getConstArray()),
nRead );
nPos += nRead;