summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-08 16:28:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-08 16:28:01 +0200
commit54bac4ddafbf330ad2ab17d69f09d5f67664d01b (patch)
treed1a9b1e9d7009e88fc3ea6be657b481a0b32b7c2 /sot
parent42590fd2aa73c77c07b62ef1dcc823e17f6bb1e9 (diff)
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I82142b0a0fabf9492ce4c4b9ebf4fded4af5a82d
Diffstat (limited to 'sot')
-rw-r--r--sot/qa/cppunit/test_sot.cxx2
-rw-r--r--sot/source/base/factory.cxx2
-rw-r--r--sot/source/base/formats.cxx2
-rw-r--r--sot/source/sdstor/ucbstorage.cxx20
4 files changed, 13 insertions, 13 deletions
diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx
index f3c55157e147..804005a40bdf 100644
--- a/sot/qa/cppunit/test_sot.cxx
+++ b/sot/qa/cppunit/test_sot.cxx
@@ -62,7 +62,7 @@ namespace
CPPUNIT_ASSERT_MESSAGE( "check size #2", xStream->remainingSize() == nSize );
// Read as much as we can, a corrupted FAT chain can cause real grief here
- nReadableSize = xStream->Read( (void *)pData, nSize );
+ nReadableSize = xStream->Read( static_cast<void *>(pData), nSize );
// fprintf(stderr, "readable size %d vs size %d remaining %d\n", nReadableSize, nSize, nReadableSize);
}
{ // Read the data backwards as well
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index cade244c5698..7f13cf9fcfd7 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -145,7 +145,7 @@ void SotFactory::PutSuperClass( const SotFactory * pFact )
else
{
const SotFactory ** pTmp = new const SotFactory * [ nSuperCount ];
- memcpy( (void *)pTmp, (void *)pSuperClasses,
+ memcpy( static_cast<void *>(pTmp), static_cast<void *>(pSuperClasses),
sizeof( void * ) * (nSuperCount -1) );
delete [] pSuperClasses;
pSuperClasses = pTmp;
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 7b2f8979b968..e0d7bc22a0fb 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -1414,7 +1414,7 @@ static sal_uInt16 GetTransferableAction_Impl(
if( aAny.hasValue() )
{
Sequence< sal_Int8 > aSeq; aAny >>= aSeq;
- SvMemoryStream aMemStm( (void*) aSeq.getConstArray(), aSeq.getLength(), StreamMode::READ );
+ SvMemoryStream aMemStm( const_cast<sal_Int8 *>(aSeq.getConstArray()), aSeq.getLength(), StreamMode::READ );
FileList aFileList;
ReadFileList( aMemStm, aFileList );
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 3f1060177d56..19bb96ce22fe 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -149,7 +149,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::readBytes(Sequence< sal_Int8 >& aData
aData.realloc(nBytesToRead);
- sal_uInt32 nRead = m_pSvStream->Read((void*)aData.getArray(), nBytesToRead);
+ sal_uInt32 nRead = m_pSvStream->Read(static_cast<void*>(aData.getArray()), nBytesToRead);
checkError();
// Wenn gelesene Zeichen < MaxLength, Sequence anpassen
@@ -901,13 +901,13 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
// copy this tail to the temporary stream
sal_uLong aToRead = nSize - aResult;
- pData = (void*)( static_cast<char*>(pData) + aResult );
+ pData = static_cast<void*>( static_cast<char*>(pData) + aResult );
try
{
Sequence<sal_Int8> aData( aToRead );
sal_uLong aReaded = m_rSource->readBytes( aData, aToRead );
- aResult += m_pStream->Write( (void*)aData.getArray(), aReaded );
+ aResult += m_pStream->Write( static_cast<void*>(aData.getArray()), aReaded );
memcpy( pData, aData.getArray(), aReaded );
}
catch (const Exception &e)
@@ -1363,13 +1363,13 @@ const SvStream* UCBStorageStream::GetSvStream() const
SvStream* UCBStorageStream::GetModifySvStream()
{
- return (SvStream*)pImp;
+ return static_cast<SvStream*>(pImp);
}
bool UCBStorageStream::Equals( const BaseStorageStream& rStream ) const
{
// ???
- return ((BaseStorageStream*) this ) == &rStream;
+ return static_cast<BaseStorageStream const *>(this) == &rStream;
}
bool UCBStorageStream::Commit()
@@ -2605,8 +2605,8 @@ UCBStorageElement_Impl* UCBStorage::FindElement_Impl( const OUString& rName ) co
bool UCBStorage::CopyTo( BaseStorage* pDestStg ) const
{
- DBG_ASSERT( pDestStg != ((BaseStorage*)this), "Self-Copying is not possible!" );
- if ( pDestStg == ((BaseStorage*)this) )
+ DBG_ASSERT( pDestStg != static_cast<BaseStorage const *>(this), "Self-Copying is not possible!" );
+ if ( pDestStg == static_cast<BaseStorage const *>(this) )
return false;
// perhaps it's also a problem if one storage is a parent of the other ?!
@@ -2639,7 +2639,7 @@ bool UCBStorage::CopyTo( const OUString& rElemName, BaseStorage* pDest, const OU
if( rElemName.isEmpty() )
return false;
- if ( pDest == ((BaseStorage*) this) )
+ if ( pDest == static_cast<BaseStorage*>(this) )
{
// can't double an element
return false;
@@ -3001,7 +3001,7 @@ bool UCBStorage::MoveTo( const OUString& rEleName, BaseStorage* pNewSt, const OU
if( rEleName.isEmpty() || rNewName.isEmpty() )
return false;
- if ( pNewSt == ((BaseStorage*) this) && !FindElement_Impl( rNewName ) )
+ if ( pNewSt == static_cast<BaseStorage*>(this) && !FindElement_Impl( rNewName ) )
{
return Rename( rEleName, rNewName );
}
@@ -3066,7 +3066,7 @@ const SvStream* UCBStorage::GetSvStream() const
bool UCBStorage::Equals( const BaseStorage& rStorage ) const
{
// ???
- return ((BaseStorage*)this) == &rStorage;
+ return static_cast<BaseStorage const *>(this) == &rStorage;
}
bool UCBStorage::IsStorageFile( SvStream* pFile )