diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-10-18 23:05:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-10-18 23:10:56 +0200 |
commit | bf1f0183d5c6b4c94acdbee27276d5a386a657f4 (patch) | |
tree | 3d4d60a59f935ee11011ebea33ccb6d9fab5063c /testtools | |
parent | 0eee1cf957d122ac0d805a9589a5db075a94e4a1 (diff) |
Some fixes for "clang version 3.1 (trunk 142234)" (with --enable-werror, on Linux x86_64).
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 5 | ||||
-rw-r--r-- | testtools/source/bridgetest/cppobj.cxx | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index a1bde57d438c..e777037c405e 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -657,10 +657,11 @@ static sal_Bool performTest( sal_Int8 _arByte[] = { 1, 2, -1 }; sal_Int16 _arShort[] = { -0x8000, 1, 0x7FFF }; sal_uInt16 _arUShort[] = { 0 , 1, 0xFFFF }; - sal_Int32 _arLong[] = { 0x80000000, 1, 0x7FFFFFFF }; + sal_Int32 _arLong[] = { + static_cast< sal_Int32 >(0x80000000), 1, 0x7FFFFFFF }; sal_uInt32 _arULong[] = { 0, 1, 0xFFFFFFFF }; sal_Int64 _arHyper[] = { - SAL_CONST_INT64(0x8000000000000000), 1, + static_cast< sal_Int64 >(SAL_CONST_INT64(0x8000000000000000)), 1, SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF) }; sal_uInt64 _arUHyper[] = { 0, 1, SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF) }; float _arFloat[] = { 1.1f, 2.2f, 3.3f }; diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index da91ec80c4b1..5107e2358001 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -497,10 +497,22 @@ Any Test_Impl::transportAny( const Any & value ) throw ( ::com::sun::star::uno:: } //__________________________________________________________________________________________________ + +namespace { + +void wait(sal_Int32 microSeconds) { + OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000); + TimeValue t = { + static_cast< sal_uInt32 >(microSeconds / 1000000), + static_cast< sal_uInt32 >(microSeconds * 1000) }; + osl_waitThread(&t); +} + +} + void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::sun::star::uno::RuntimeException) { - TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 }; - osl_waitThread( &value ); + wait(nWaitMUSEC); if( m_bFirstCall ) { m_bFirstCall = sal_False; @@ -515,8 +527,7 @@ void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::su //__________________________________________________________________________________________________ void Test_Impl::callOneway( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw (::com::sun::star::uno::RuntimeException) { - TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 }; - osl_waitThread( &value ); + wait(nWaitMUSEC); m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId); m_nLastCallId = nCallId; } |