summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sal/qa')
-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
-rw-r--r--sal/qa/rtl/alloc/rtl_alloc.cxx6
4 files changed, 21 insertions, 21 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();
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index b0f58a63c613..4aee1ca22978 100644
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -60,7 +60,7 @@ public:
// initialise your test code values here.
void setUp() SAL_OVERRIDE
{
- m_pMemory = (char*) rtl_allocateMemory( m_nSizeOfMemory );
+ m_pMemory = static_cast<char*>(rtl_allocateMemory( m_nSizeOfMemory ));
}
void tearDown() SAL_OVERRIDE
@@ -79,7 +79,7 @@ public:
void rtl_reallocateMemory_001()
{
sal_uInt32 nSize = 2 * 1024;
- m_pMemory = (char*)rtl_reallocateMemory(m_pMemory, nSize);
+ m_pMemory = static_cast<char*>(rtl_reallocateMemory(m_pMemory, nSize));
CPPUNIT_ASSERT_MESSAGE( "Can reallocate memory.", m_pMemory != NULL);
memset(m_pMemory, 2, nSize);
@@ -108,7 +108,7 @@ public:
// initialise your test code values here.
void setUp() SAL_OVERRIDE
{
- m_pZeroMemory = (char*) rtl_allocateZeroMemory( m_nSizeOfZeroMemory );
+ m_pZeroMemory = static_cast<char*>(rtl_allocateZeroMemory( m_nSizeOfZeroMemory ));
}
void tearDown() SAL_OVERRIDE