From cf54f2a10f128cf5d79397911b5be710e7081963 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 28 Mar 2015 19:05:38 +0100 Subject: Clean up C-style casts from pointers to void Change-Id: I85d6761e72ba2f67a1d67a94cae674cbb271b43f --- rsc/source/tools/rscchar.cxx | 2 +- rsc/source/tools/rsctools.cxx | 12 ++++++------ rsc/source/tools/rsctree.cxx | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'rsc/source/tools') 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(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(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(rtl_allocateMemory( (nCount +1) * sizeof( void * ) )); else - pMem = (void **)rtl_reallocateMemory( (void *)pMem, + pMem = static_cast(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(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(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(pSearch) ) return LESS; - else if( GetId() > *((const sal_uInt32 *)pSearch) ) + else if( GetId() > *static_cast(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(pSearch) ); if( nCmp < 0 ) return LESS; -- cgit