summaryrefslogtreecommitdiff
path: root/sal/qa/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:05:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:24 +0100
commitd57d81e529a44d8042401e36057a69ebe97e870a (patch)
tree3c434c6998bb9c8754c9b662c4bdb485c0aff29b /sal/qa/osl
parentcf54f2a10f128cf5d79397911b5be710e7081963 (diff)
Clean up C-style casts from pointers to void
Change-Id: I5e370445affbcd32b05588111f74590bf24f39d6
Diffstat (limited to 'sal/qa/osl')
-rw-r--r--sal/qa/osl/file/osl_File.cxx16
-rw-r--r--sal/qa/osl/module/osl_Module.cxx6
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx14
3 files changed, 18 insertions, 18 deletions
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 20f5cbef53c2..b5c5cc204c9b 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1793,9 +1793,9 @@ namespace osl_FileStatus
void getAccessTime_001()
{
TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
TimeValue *pTV_access = NULL;
- CPPUNIT_ASSERT( ( pTV_access = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
::osl::FileStatus rFileStatus( osl_FileStatus_Mask_AccessTime );
nError = rItem.getFileStatus( rFileStatus );
@@ -1833,7 +1833,7 @@ namespace osl_FileStatus
void getModifyTime_001()
{
TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
//create file
aTypeURL = aUserDirectoryURL.copy( 0 );
@@ -1853,7 +1853,7 @@ namespace osl_FileStatus
//get modify time
TimeValue* pTV_modify = NULL;
- CPPUNIT_ASSERT( ( pTV_modify = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
*pTV_modify = rFileStatus.getModifyTime();
bool bOK = t_compareTime( pTV_modify, pTV_current, delta );
@@ -3452,13 +3452,13 @@ namespace osl_File
void setTime_001()
{
TimeValue *pTV_current = NULL;
- CPPUNIT_ASSERT( ( pTV_current = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_current = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
TimeValue *pTV_creation = NULL;
- CPPUNIT_ASSERT( ( pTV_creation = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_creation = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
TimeValue *pTV_access = NULL;
- CPPUNIT_ASSERT( ( pTV_access = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_access = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
TimeValue *pTV_modify = NULL;
- CPPUNIT_ASSERT( ( pTV_modify = ( TimeValue* )malloc( sizeof( TimeValue ) ) ) != NULL );
+ CPPUNIT_ASSERT( ( pTV_modify = static_cast<TimeValue*>(malloc( sizeof( TimeValue ) )) ) != NULL );
//get current time
bool bOk = osl_getSystemTime( pTV_current );
diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx
index 60a336348543..be812e04b161 100644
--- a/sal/qa/osl/module/osl_Module.cxx
+++ b/sal/qa/osl/module/osl_Module.cxx
@@ -135,7 +135,7 @@ namespace osl_Module
#if !defined( MACOSX )
// TODO: Find out why this fails on Mac OS X
::osl::Module aMod( getDllURL( ) );
- FuncPtr pFunc = ( FuncPtr ) aMod.getSymbol( rtl::OUString("firstfunc") );
+ FuncPtr pFunc = reinterpret_cast<FuncPtr>(aMod.getSymbol( rtl::OUString("firstfunc") ));
OUString aFileURL;
bRes = osl::Module::getUrlFromAddress(
@@ -258,7 +258,7 @@ namespace osl_Module
#if !defined( MACOSX )
// TODO: Find out why this fails on Mac OS X
::osl::Module aMod( getDllURL( ) );
- FuncPtr pFunc = ( FuncPtr ) aMod.getSymbol( rtl::OUString("firstfunc") );
+ FuncPtr pFunc = reinterpret_cast<FuncPtr>(aMod.getSymbol( rtl::OUString("firstfunc") ));
bRes = false;
if ( pFunc )
bRes = pFunc( bRes );
@@ -306,7 +306,7 @@ namespace osl_Module
::osl::Module aMod( getDllURL( ) );
::rtl::OUString funcName( "firstfunc" );
- FuncPtr pFunc = ( FuncPtr ) osl_getSymbol( (oslModule)aMod, funcName.pData );
+ FuncPtr pFunc = reinterpret_cast<FuncPtr>(osl_getSymbol( (oslModule)aMod, funcName.pData ));
bRes = false;
if ( pFunc )
bRes = pFunc( bRes );
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index ba5b0b7552f1..5ab883645c5f 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -1736,7 +1736,7 @@ namespace osl_Thread
// destroy function when the binding thread terminate
void SAL_CALL destroyCallback(void * data)
{
- delete[] (char *) data;
+ delete[] static_cast<char *>(data);
}
static ThreadData myThreadData(destroyCallback);
@@ -1765,7 +1765,7 @@ private:
pc[1] = '\0';
myThreadData.setData(pc);
- char* pData = (char*)myThreadData.getData();
+ char* pData = static_cast<char*>(myThreadData.getData());
m_Char_Test = *pData;
// wait for long time to check the data value in main thread
ThreadHelper::thread_sleep_tenth_sec(3);
@@ -1792,7 +1792,7 @@ private:
oslThreadIdentifier* pId = new oslThreadIdentifier;
*pId = getIdentifier();
idData.setData(pId);
- oslThreadIdentifier* pIdData = (oslThreadIdentifier*)idData.getData();
+ oslThreadIdentifier* pIdData = static_cast<oslThreadIdentifier*>(idData.getData());
//t_print("Thread %d has Data %d\n", getIdentifier(), *pIdData);
m_Id = *pIdData;
delete pId;
@@ -1883,7 +1883,7 @@ namespace osl_ThreadData
myKeyThread aThread2('b');
aThread2.create();
// aThread1 and aThread2 should have not terminated yet, check current data, not 'a' 'b'
- char* pChar = (char*)myThreadData.getData();
+ char* pChar = static_cast<char*>(myThreadData.getData());
char aChar = *pChar;
aThread1.join();
@@ -1922,7 +1922,7 @@ namespace osl_ThreadData
pc2[1] = '\0';
myThreadData.setData(pc2);
- char* pChar = (char*)myThreadData.getData();
+ char* pChar = static_cast<char*>(myThreadData.getData());
char aChar = *pChar;
aThread1.join();
@@ -1976,7 +1976,7 @@ namespace osl_ThreadData
char cData1 = aThread1.m_Char_Test;
char cData2 = aThread2.m_Char_Test;
- char* pChar = (char*)myThreadData.getData();
+ char* pChar = static_cast<char*>(myThreadData.getData());
char aChar = *pChar;
CPPUNIT_ASSERT_MESSAGE(
@@ -2007,7 +2007,7 @@ namespace osl_ThreadData
pc[1] = '\0';
void* pChar = myThreadData.getData();
- char aChar = *(char*)pChar;
+ char aChar = *static_cast<char*>(pChar);
aThread1.join();
aThread2.join();