Kaydet (Commit) 8df62de7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast: deal with remaining pointer casts

Change-Id: I9408d28393ff3654dd81c0240d7665b72b3c189c
üst 8ca53be7
......@@ -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()
......
......@@ -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;
......
......@@ -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 );
}
......
......@@ -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
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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 );
}
......
......@@ -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 );
......
......@@ -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 );
}
......
......@@ -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
{
......
......@@ -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;
......
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