diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:05:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:24 +0100 |
commit | cf54f2a10f128cf5d79397911b5be710e7081963 (patch) | |
tree | cbaf1036cfca3572cb5d7b1df7c2f46de99168cb /rsc/source/tools | |
parent | d963fd84256081ce6a2e0ab1e9c0516cfb0b38b9 (diff) |
Clean up C-style casts from pointers to void
Change-Id: I85d6761e72ba2f67a1d67a94cae674cbb271b43f
Diffstat (limited to 'rsc/source/tools')
-rw-r--r-- | rsc/source/tools/rscchar.cxx | 2 | ||||
-rw-r--r-- | rsc/source/tools/rsctools.cxx | 12 | ||||
-rw-r--r-- | rsc/source/tools/rsctree.cxx | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx index 38f0ec6db52f..e216c13c09e5 100644 --- a/rsc/source/tools/rscchar.cxx +++ b/rsc/source/tools/rscchar.cxx @@ -151,7 +151,7 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding ) hConv = rtl_createUnicodeToTextConverter( RTL_TEXTENCODING_UTF8 ); // factor of 6 is the maximum size of an UNICODE character as utf8 - char * pUtf8 = (char *)rtl_allocateMemory( nUniSize * 6 ); + char * pUtf8 = static_cast<char *>(rtl_allocateMemory( nUniSize * 6 )); rtl_convertUnicodeToText( hConv, 0, pUniCode, nUniSize, pUtf8, nUniSize * 6, diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index 3fa4bdda9f8b..7b25510c8f7c 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -74,7 +74,7 @@ int rsc_stricmp( const char *string1, const char *string2 ){ char* rsc_strdup( const char* pStr ) { int nLen = strlen( pStr ); - char* pBuffer = (char*)rtl_allocateMemory( nLen+1 ); + char* pBuffer = static_cast<char*>(rtl_allocateMemory( nLen+1 )); memcpy( pBuffer, pStr, nLen+1 ); return pBuffer; } @@ -222,11 +222,11 @@ void RscPtrPtr :: Reset() sal_uInt32 RscPtrPtr :: Append( void * pBuffer ) { if( !pMem ) - pMem = (void **)rtl_allocateMemory( (nCount +1) * sizeof( void * ) ); + pMem = static_cast<void **>(rtl_allocateMemory( (nCount +1) * sizeof( void * ) )); else - pMem = (void **)rtl_reallocateMemory( (void *)pMem, + pMem = static_cast<void **>(rtl_reallocateMemory( (void *)pMem, ((nCount +1) * sizeof( void * ) - ) ); + ) )); pMem[ nCount ] = pBuffer; return nCount++; } @@ -267,7 +267,7 @@ sal_uInt32 RscWriteRc :: IncSize( sal_uInt32 nSize ) sal_uInt32 nOrigPos = nLen; nLen += nSize; if( pMem ) - pMem = (char*)rtl_reallocateMemory( pMem, nLen ); + pMem = static_cast<char*>(rtl_reallocateMemory( pMem, nLen )); if( pMem ) memset( pMem + nOrigPos, 0, nSize ); return nOrigPos; @@ -277,7 +277,7 @@ char * RscWriteRc :: GetPointer( sal_uInt32 nSize ) { if( !pMem ) { - pMem = (char *)rtl_allocateMemory( nLen ); + pMem = static_cast<char *>(rtl_allocateMemory( nLen )); memset( pMem, 0, nLen ); } return pMem + nSize; diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx index 98ae17595bf4..c72c77f8d5e6 100644 --- a/rsc/source/tools/rsctree.cxx +++ b/rsc/source/tools/rsctree.cxx @@ -343,9 +343,9 @@ COMPARE IdNode::Compare( const NameNode * pSearch ) const // pSearch ist ein Zeiger auf sal_uInt32 COMPARE IdNode::Compare( const void * pSearch ) const { - if( GetId() < *((const sal_uInt32 *)pSearch) ) + if( GetId() < *static_cast<const sal_uInt32 *>(pSearch) ) return LESS; - else if( GetId() > *((const sal_uInt32 *)pSearch) ) + else if( GetId() > *static_cast<const sal_uInt32 *>(pSearch) ) return GREATER; else return EQUAL; @@ -376,7 +376,7 @@ COMPARE StringNode::Compare( const NameNode * pSearch ) const // pSearch ist ein Zeiger auf const char * COMPARE StringNode::Compare( const void * pSearch ) const { - int nCmp = strcmp( m_aName.getStr(), (const char *)pSearch ); + int nCmp = strcmp( m_aName.getStr(), static_cast<const char *>(pSearch) ); if( nCmp < 0 ) return LESS; |