summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:07:01 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:25 +0100
commit7eeabbca710d387e462043afdc3d8af4e28b2123 (patch)
treefddc6e0e1ee77baf80cf93786549e2c886579652 /sot
parent84676d50ca5d6e75dc194540ee9d5d37dec0c5fe (diff)
Clean up C-style casts from pointers to void
Change-Id: I1d157bfc82f09f2438e59eca4fcd92931ca38723
Diffstat (limited to 'sot')
-rw-r--r--sot/qa/cppunit/test_sot.cxx2
-rw-r--r--sot/source/sdstor/stgcache.cxx2
-rw-r--r--sot/source/sdstor/stgcache.hxx2
-rw-r--r--sot/source/sdstor/stgelem.cxx4
-rw-r--r--sot/source/sdstor/stgstrms.cxx18
-rw-r--r--sot/source/sdstor/storage.cxx4
-rw-r--r--sot/source/sdstor/ucbstorage.cxx2
7 files changed, 17 insertions, 17 deletions
diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx
index 3c24588ee9ab..03b486932c25 100644
--- a/sot/qa/cppunit/test_sot.cxx
+++ b/sot/qa/cppunit/test_sot.cxx
@@ -48,7 +48,7 @@ namespace
const OUString &rStreamName,
sal_uLong nSize )
{
- unsigned char *pData = (unsigned char*)malloc( nSize );
+ unsigned char *pData = static_cast<unsigned char*>(malloc( nSize ));
sal_uLong nReadableSize = 0;
if( !pData )
return true;
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 1d09b7beadac..e54ffa4f14af 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -64,7 +64,7 @@ void StgCache::SetToPage ( const rtl::Reference< StgPage >& rPage, short nOff, s
#ifdef OSL_BIGENDIAN
nVal = OSL_SWAPDWORD(nVal);
#endif
- ((sal_Int32*) rPage->GetData() )[ nOff ] = nVal;
+ static_cast<sal_Int32*>(rPage->GetData())[ nOff ] = nVal;
SetDirty( rPage );
}
}
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index b531f5130ae2..6b5970dab54a 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -119,7 +119,7 @@ inline sal_Int32 StgCache::GetFromPage ( const rtl::Reference< StgPage >& rPage,
{
if( ( nOff >= (short) ( rPage->GetSize() / sizeof( sal_Int32 ) ) ) || nOff < 0 )
return -1;
- sal_Int32 n = ((sal_Int32*) rPage->GetData() )[ nOff ];
+ sal_Int32 n = static_cast<sal_Int32*>(rPage->GetData())[ nOff ];
#ifdef OSL_BIGENDIAN
return OSL_SWAPDWORD(n);
#else
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 3e1dc9543d4a..cd6c072a9fac 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -366,7 +366,7 @@ bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
if ( nBufSize < 128 )
return false;
- SvMemoryStream r( (sal_Char*) pFrom, nBufSize, StreamMode::READ );
+ SvMemoryStream r( const_cast<void *>(pFrom), nBufSize, StreamMode::READ );
for( short i = 0; i < 32; i++ )
r.ReadUInt16( nName[ i ] ); // 00 name as WCHAR
r.ReadUInt16( nNameLen ) // 40 size of name in bytes including 00H
@@ -412,7 +412,7 @@ bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
void StgEntry::Store( void* pTo )
{
- SvMemoryStream r( (sal_Char *)pTo, 128, StreamMode::WRITE );
+ SvMemoryStream r( pTo, 128, StreamMode::WRITE );
for( short i = 0; i < 32; i++ )
r.WriteUInt16( nName[ i ] ); // 00 name as WCHAR
r.WriteUInt16( nNameLen ) // 40 size of name in bytes including 00H
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 8a624e042f5c..ca7f087f25c4 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -885,7 +885,7 @@ void* StgDataStrm::GetPtr( sal_Int32 Pos, bool bForce, bool bDirty )
{
if( bDirty )
rIo.SetDirty( pPg );
- return ((sal_uInt8 *)pPg->GetData()) + nOffset;
+ return static_cast<sal_uInt8 *>(pPg->GetData()) + nOffset;
}
}
return NULL;
@@ -912,7 +912,7 @@ sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n )
if( nBytes )
{
short nRes;
- void *p = (sal_uInt8 *) pBuf + nDone;
+ void *p = static_cast<sal_uInt8 *>(pBuf) + nDone;
if( nBytes == nPageSize )
{
pPg = rIo.Find( nPage );
@@ -932,7 +932,7 @@ sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n )
pPg = rIo.Get( nPage, false );
if( !pPg.is() )
break;
- memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes );
+ memcpy( p, static_cast<sal_uInt8*>(pPg->GetData()) + nOffset, nBytes );
nRes = nBytes;
}
nDone += nRes;
@@ -971,7 +971,7 @@ sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n )
if( nBytes )
{
short nRes;
- const void *p = (const sal_uInt8 *) pBuf + nDone;
+ const void *p = static_cast<const sal_uInt8 *>(pBuf) + nDone;
if( nBytes == nPageSize )
{
pPg = rIo.Find( nPage );
@@ -992,7 +992,7 @@ sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n )
pPg = rIo.Get( nPage, false );
if( !pPg.is() )
break;
- memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes );
+ memcpy( static_cast<sal_uInt8*>(pPg->GetData()) + nOffset, p, nBytes );
rIo.SetDirty( pPg );
nRes = nBytes;
}
@@ -1063,7 +1063,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
if( !pData || !pData->Pos2Page( nPage * nPageSize + nOffset ) )
break;
// all reading through the stream
- short nRes = (short) pData->Read( (sal_uInt8*)pBuf + nDone, nBytes );
+ short nRes = (short) pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
@@ -1106,7 +1106,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
break;
if( !pData->Pos2Page( nDataPos ) )
break;
- short nRes = (short) pData->Write( (sal_uInt8*)pBuf + nDone, nBytes );
+ short nRes = (short) pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes );
nDone = nDone + nRes;
nPos += nRes;
n -= nRes;
@@ -1265,7 +1265,7 @@ sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n )
return n;
}
else
- return SvMemoryStream::GetData( (sal_Char *)pData, n );
+ return SvMemoryStream::GetData( pData, n );
}
sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
@@ -1284,7 +1284,7 @@ sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
SetError( pStrm->GetError() );
}
else
- nNew = SvMemoryStream::PutData( (sal_Char*)pData, n );
+ nNew = SvMemoryStream::PutData( pData, n );
return nNew;
}
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index c91138326204..03a7a9f8c50c 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -143,7 +143,7 @@ sal_uLong SotStorageStream::GetData( void* pData, sal_uLong nSize )
SetError( pOwnStm->GetError() );
}
else
- nRet = SvStream::GetData( (sal_Char *)pData, nSize );
+ nRet = SvStream::GetData( pData, nSize );
return nRet;
}
@@ -158,7 +158,7 @@ sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize )
SetError( pOwnStm->GetError() );
}
else
- nRet = SvStream::PutData( (sal_Char *)pData, nSize );
+ nRet = SvStream::PutData( pData, nSize );
return nRet;
}
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 11a6f61ce483..791334c22cf0 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -901,7 +901,7 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
// copy this tail to the temporary stream
sal_uLong aToRead = nSize - aResult;
- pData = (void*)( (char*)pData + aResult );
+ pData = (void*)( static_cast<char*>(pData) + aResult );
try
{