diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:17:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:17:51 +0100 |
commit | 5a3bb76cd384fa3760fe8481ce008791258595ad (patch) | |
tree | 8544fecc06b73cb43000143339c06ad880b56db4 /sal/qa | |
parent | acd1696a066b8fa6fb94a0613939565799413769 (diff) |
More loplugin:cstylecast: sal
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 100 | ||||
-rw-r--r-- | sal/qa/osl/process/osl_Thread.cxx | 84 | ||||
-rw-r--r-- | sal/qa/rtl/digest/rtl_digest.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/textenc/rtl_textcvt.cxx | 12 |
4 files changed, 99 insertions, 99 deletions
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx index b4aa4e3c053a..3afd07f8dcab 100644 --- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx +++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx @@ -14755,7 +14755,7 @@ namespace rtl_OStringBuffer void append_001() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.0"); + float input = static_cast<float>(atof("3.0")); // LLA: // the complex problem is here, that a float value is not really what we write. @@ -14775,7 +14775,7 @@ namespace rtl_OStringBuffer void append_002() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.5"); + float input = static_cast<float>(atof("3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14791,7 +14791,7 @@ namespace rtl_OStringBuffer void append_003() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.0625"); + float input = static_cast<float>(atof("3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14807,7 +14807,7 @@ namespace rtl_OStringBuffer void append_004() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.502525"); + float input = static_cast<float>(atof("3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14823,7 +14823,7 @@ namespace rtl_OStringBuffer void append_005() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.141592"); + float input = static_cast<float>(atof("3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14839,7 +14839,7 @@ namespace rtl_OStringBuffer void append_006() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.5025255"); + float input = static_cast<float>(atof("3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14855,7 +14855,7 @@ namespace rtl_OStringBuffer void append_007() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("3.00390625"); + float input = static_cast<float>(atof("3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14871,7 +14871,7 @@ namespace rtl_OStringBuffer void append_008() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.0"); + float input = static_cast<float>(atof("3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14887,7 +14887,7 @@ namespace rtl_OStringBuffer void append_009() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.5"); + float input = static_cast<float>(atof("3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14903,7 +14903,7 @@ namespace rtl_OStringBuffer void append_010() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.0625"); + float input = static_cast<float>(atof("3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14919,7 +14919,7 @@ namespace rtl_OStringBuffer void append_011() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.502525"); + float input = static_cast<float>(atof("3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14935,7 +14935,7 @@ namespace rtl_OStringBuffer void append_012() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.141592"); + float input = static_cast<float>(atof("3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14951,7 +14951,7 @@ namespace rtl_OStringBuffer void append_013() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.5025255"); + float input = static_cast<float>(atof("3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14967,7 +14967,7 @@ namespace rtl_OStringBuffer void append_014() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("3.00390625"); + float input = static_cast<float>(atof("3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14983,7 +14983,7 @@ namespace rtl_OStringBuffer void append_015() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.0"); + float input = static_cast<float>(atof("3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -14999,7 +14999,7 @@ namespace rtl_OStringBuffer void append_016() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.5"); + float input = static_cast<float>(atof("3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15015,7 +15015,7 @@ namespace rtl_OStringBuffer void append_017() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.0625"); + float input = static_cast<float>(atof("3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15031,7 +15031,7 @@ namespace rtl_OStringBuffer void append_018() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.502525"); + float input = static_cast<float>(atof("3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15047,7 +15047,7 @@ namespace rtl_OStringBuffer void append_019() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.141592"); + float input = static_cast<float>(atof("3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15063,7 +15063,7 @@ namespace rtl_OStringBuffer void append_020() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.5025255"); + float input = static_cast<float>(atof("3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15079,7 +15079,7 @@ namespace rtl_OStringBuffer void append_021() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("3.00390625"); + float input = static_cast<float>(atof("3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15095,7 +15095,7 @@ namespace rtl_OStringBuffer void append_022() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("3.0"); + float input = static_cast<float>(atof("3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15111,7 +15111,7 @@ namespace rtl_OStringBuffer void append_023() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("3.5"); + float input = static_cast<float>(atof("3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15127,7 +15127,7 @@ namespace rtl_OStringBuffer void append_024() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("3.0625"); + float input = static_cast<float>(atof("3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15143,7 +15143,7 @@ namespace rtl_OStringBuffer void append_025() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("3.502525"); + float input = static_cast<float>(atof("3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15332,7 +15332,7 @@ namespace rtl_OStringBuffer void append_001() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.0"); + float input = static_cast<float>(atof("-3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15348,7 +15348,7 @@ namespace rtl_OStringBuffer void append_002() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.5"); + float input = static_cast<float>(atof("-3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15364,7 +15364,7 @@ namespace rtl_OStringBuffer void append_003() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.0625"); + float input = static_cast<float>(atof("-3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15380,7 +15380,7 @@ namespace rtl_OStringBuffer void append_004() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.502525"); + float input = static_cast<float>(atof("-3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15396,7 +15396,7 @@ namespace rtl_OStringBuffer void append_005() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.141592"); + float input = static_cast<float>(atof("-3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15412,7 +15412,7 @@ namespace rtl_OStringBuffer void append_006() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.5025255"); + float input = static_cast<float>(atof("-3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15428,7 +15428,7 @@ namespace rtl_OStringBuffer void append_007() { ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); - float input = (float)atof("-3.00390625"); + float input = static_cast<float>(atof("-3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15444,7 +15444,7 @@ namespace rtl_OStringBuffer void append_008() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.0"); + float input = static_cast<float>(atof("-3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15460,7 +15460,7 @@ namespace rtl_OStringBuffer void append_009() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.5"); + float input = static_cast<float>(atof("-3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15476,7 +15476,7 @@ namespace rtl_OStringBuffer void append_010() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.0625"); + float input = static_cast<float>(atof("-3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15492,7 +15492,7 @@ namespace rtl_OStringBuffer void append_011() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.502525"); + float input = static_cast<float>(atof("-3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15508,7 +15508,7 @@ namespace rtl_OStringBuffer void append_012() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.141592"); + float input = static_cast<float>(atof("-3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15524,7 +15524,7 @@ namespace rtl_OStringBuffer void append_013() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.5025255"); + float input = static_cast<float>(atof("-3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15540,7 +15540,7 @@ namespace rtl_OStringBuffer void append_014() { ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); - float input = (float)atof("-3.00390625"); + float input = static_cast<float>(atof("-3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15556,7 +15556,7 @@ namespace rtl_OStringBuffer void append_015() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.0"); + float input = static_cast<float>(atof("-3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15572,7 +15572,7 @@ namespace rtl_OStringBuffer void append_016() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.5"); + float input = static_cast<float>(atof("-3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15588,7 +15588,7 @@ namespace rtl_OStringBuffer void append_017() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.0625"); + float input = static_cast<float>(atof("-3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15604,7 +15604,7 @@ namespace rtl_OStringBuffer void append_018() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.502525"); + float input = static_cast<float>(atof("-3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15620,7 +15620,7 @@ namespace rtl_OStringBuffer void append_019() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.141592"); + float input = static_cast<float>(atof("-3.141592")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15636,7 +15636,7 @@ namespace rtl_OStringBuffer void append_020() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.5025255"); + float input = static_cast<float>(atof("-3.5025255")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15652,7 +15652,7 @@ namespace rtl_OStringBuffer void append_021() { ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); - float input = (float)atof("-3.00390625"); + float input = static_cast<float>(atof("-3.00390625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15668,7 +15668,7 @@ namespace rtl_OStringBuffer void append_022() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("-3.0"); + float input = static_cast<float>(atof("-3.0")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15684,7 +15684,7 @@ namespace rtl_OStringBuffer void append_023() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("-3.5"); + float input = static_cast<float>(atof("-3.5")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15700,7 +15700,7 @@ namespace rtl_OStringBuffer void append_024() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("-3.0625"); + float input = static_cast<float>(atof("-3.0625")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); @@ -15716,7 +15716,7 @@ namespace rtl_OStringBuffer void append_025() { ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); - float input = (float)atof("-3.502525"); + float input = static_cast<float>(atof("-3.502525")); sal_Int32 nLen = aStrBuf.getLength(); aStrBuf.append( input ); diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx index ae23a9ef41a0..396aa86efdb4 100644 --- a/sal/qa/osl/process/osl_Thread.cxx +++ b/sal/qa/osl/process/osl_Thread.cxx @@ -96,7 +96,7 @@ void StopWatch::start() m_bIsValid = false; m_bIsRunning = true; osl_getSystemTime( &t1 ); - t_print("# %u %u nsecs\n", (unsigned)t1.Seconds, (unsigned)t1.Nanosec); + t_print("# %u %u nsecs\n", static_cast<unsigned>(t1.Seconds), static_cast<unsigned>(t1.Nanosec)); // gettimeofday(&t1, 0); } @@ -107,7 +107,7 @@ void StopWatch::stop() // gettimeofday(&t2, 0); // Ask timer osl_getSystemTime( &t2 ); - t_print("# %u %u nsecs\n", (unsigned) t2.Seconds, (unsigned) t2.Nanosec); + t_print("# %u %u nsecs\n", static_cast<unsigned>(t2.Seconds), static_cast<unsigned>(t2.Nanosec)); if (m_bIsRunning) { // check if started. @@ -119,7 +119,7 @@ void StopWatch::stop() m_nNanoSec = 1000000000 + static_cast<sal_Int32>(t2.Nanosec) - static_cast<sal_Int32>(t1.Nanosec); m_nSeconds -= 1; } - t_print("# %u %u nsecs\n", (unsigned) m_nSeconds, (unsigned) m_nNanoSec ); + t_print("# %u %u nsecs\n", static_cast<unsigned>(m_nSeconds), static_cast<unsigned>(m_nNanoSec) ); //if (m_nNanoSec < 0) //{ //m_nNanoSec += 1000000000; @@ -271,7 +271,7 @@ public: OCountThread() { m_nWaitSec = 0; - t_print("new OCountThread thread %u!\n", (unsigned) getIdentifier()); + t_print("new OCountThread thread %u!\n", static_cast<unsigned>(getIdentifier())); } sal_Int32 getValue() { return m_aFlag.getValue(); } @@ -312,7 +312,7 @@ protected: } void SAL_CALL onTerminated() override { - t_print("normally terminate this thread %u!\n", (unsigned) getIdentifier()); + t_print("normally terminate this thread %u!\n", static_cast<unsigned>(getIdentifier())); } public: @@ -351,12 +351,12 @@ protected: } void SAL_CALL onTerminated() override { - t_print("normally terminate this thread %u!\n", (unsigned) getIdentifier()); + t_print("normally terminate this thread %u!\n", static_cast<unsigned>(getIdentifier())); } public: ONoScheduleThread() { - t_print("new thread id %u!\n", (unsigned) getIdentifier()); + t_print("new thread id %u!\n", static_cast<unsigned>(getIdentifier())); } virtual ~ONoScheduleThread() override { @@ -467,7 +467,7 @@ namespace osl_Thread termAndJoinThread(newthread); delete newthread; - t_print(" nValue = %d\n", (int) nValue); + t_print(" nValue = %d\n", static_cast<int>(nValue)); t_print("isRunning = %s\n", isRunning ? "true" : "false"); CPPUNIT_ASSERT_MESSAGE( @@ -671,9 +671,9 @@ namespace osl_Thread termAndJoinThread(pCountThread); delete pCountThread; - t_print("SuspendValue: %d\n", (int) nSuspendValue); - t_print("ResumeValue: %d\n", (int) nResumeValue); - t_print("LaterValue: %d\n", (int) nLaterValue); + t_print("SuspendValue: %d\n", static_cast<int>(nSuspendValue)); + t_print("ResumeValue: %d\n", static_cast<int>(nResumeValue)); + t_print("LaterValue: %d\n", static_cast<int>(nLaterValue)); /* LLA: this assumption is no longer relevant: nResumeValue == nSuspendValue && */ CPPUNIT_ASSERT_MESSAGE( @@ -706,7 +706,7 @@ namespace osl_Thread termAndJoinThread(newthread); delete newthread; - t_print(" nValue = %d\n", (int) nValue); + t_print(" nValue = %d\n", static_cast<int>(nValue)); CPPUNIT_ASSERT_MESSAGE( "Creates a suspended thread, then resume", @@ -747,8 +747,8 @@ namespace osl_Thread aCountThread->join(); delete aCountThread; - t_print(" nValue = %d\n", (int) nValue); - t_print("nLaterValue = %d\n", (int) nLaterValue); + t_print(" nValue = %d\n", static_cast<int>(nValue)); + t_print("nLaterValue = %d\n", static_cast<int>(nLaterValue)); CPPUNIT_ASSERT_MESSAGE( "Terminate the thread", @@ -780,8 +780,8 @@ namespace osl_Thread sal_Int32 nLaterValue = aCountThread->getValue(); delete aCountThread; - t_print(" nValue = %d\n", (int) nValue); - t_print("nLaterValue = %d\n", (int) nLaterValue); + t_print(" nValue = %d\n", static_cast<int>(nValue)); + t_print("nLaterValue = %d\n", static_cast<int>(nLaterValue)); CPPUNIT_ASSERT_MESSAGE( "Suspend then resume the thread", @@ -1013,8 +1013,8 @@ namespace osl_Thread rtl::OString sPrio = getPrioName(_aPriority); t_print("After 10 tenth seconds\n"); - t_print("nValue in %s Prio Thread is %d\n",sPrio.getStr(), (int) nValueNormal); - t_print("nValue in %s Prio Thread is %d\n", sPrio.getStr(), (int) nValueNormal2); + t_print("nValue in %s Prio Thread is %d\n",sPrio.getStr(), static_cast<int>(nValueNormal)); + t_print("nValue in %s Prio Thread is %d\n", sPrio.getStr(), static_cast<int>(nValueNormal2)); // ThreadHelper::thread_sleep_tenth_sec(1); pThread->join(); @@ -1031,7 +1031,7 @@ namespace osl_Thread ); double nDeltaPercent = nDelta / nQuotient * 100; - t_print("Delta value %d, percent %f\n", (int) nDelta, nDeltaPercent); + t_print("Delta value %d, percent %f\n", static_cast<int>(nDelta), nDeltaPercent); // LLA: it's not a bug if the current OS is not able to handle thread scheduling right and good. // like Windows XP @@ -1113,9 +1113,9 @@ namespace osl_Thread nValueNormal = aNormalThread.getValue(); t_print("After 10 tenth seconds\n"); - t_print("nValue in Highest Prio Thread is %d\n", (int) nValueHighest); - t_print("nValue in AboveNormal Prio Thread is %d\n", (int) nValueAboveNormal); - t_print("nValue in Normal Prio Thread is %d\n", (int) nValueNormal); + t_print("nValue in Highest Prio Thread is %d\n", static_cast<int>(nValueHighest)); + t_print("nValue in AboveNormal Prio Thread is %d\n", static_cast<int>(nValueAboveNormal)); + t_print("nValue in Normal Prio Thread is %d\n", static_cast<int>(nValueNormal)); #ifndef _WIN32 CPPUNIT_ASSERT_MESSAGE( @@ -1194,11 +1194,11 @@ namespace osl_Thread nValueLowest = pLowestThread.getValue(); t_print("After 10 tenth seconds\n"); - t_print("nValue in Highest Prio Thread is %d\n", (int) nValueHighest); - t_print("nValue in AboveNormal Prio Thread is %d\n", (int) nValueAboveNormal); - t_print("nValue in Normal Prio Thread is %d\n", (int) nValueNormal); - t_print("nValue in BelowNormal Prio Thread is %d\n", (int) nValueBelowNormal); - t_print("nValue in Lowest Prio Thread is %d\n", (int) nValueLowest); + t_print("nValue in Highest Prio Thread is %d\n", static_cast<int>(nValueHighest)); + t_print("nValue in AboveNormal Prio Thread is %d\n", static_cast<int>(nValueAboveNormal)); + t_print("nValue in Normal Prio Thread is %d\n", static_cast<int>(nValueNormal)); + t_print("nValue in BelowNormal Prio Thread is %d\n", static_cast<int>(nValueBelowNormal)); + t_print("nValue in Lowest Prio Thread is %d\n", static_cast<int>(nValueLowest)); #ifndef _WIN32 CPPUNIT_ASSERT_MESSAGE( @@ -1279,10 +1279,10 @@ namespace osl_Thread nValueLowest = pLowestThread.getValue(); t_print("After 5 tenth seconds\n"); - t_print("nValue in AboveNormal Prio Thread is %d\n", (int) nValueAboveNormal); - t_print("nValue in Normal Prio Thread is %d\n", (int) nValueNormal); - t_print("nValue in BelowNormal Prio Thread is %d\n", (int) nValueBelowNormal); - t_print("nValue in Lowest Prio Thread is %d\n", (int) nValueLowest); + t_print("nValue in AboveNormal Prio Thread is %d\n", static_cast<int>(nValueAboveNormal)); + t_print("nValue in Normal Prio Thread is %d\n", static_cast<int>(nValueNormal)); + t_print("nValue in BelowNormal Prio Thread is %d\n", static_cast<int>(nValueBelowNormal)); + t_print("nValue in Lowest Prio Thread is %d\n", static_cast<int>(nValueLowest)); // delete pHighestThread; @@ -1364,9 +1364,9 @@ namespace osl_Thread nValueLowest = pLowestThread.getValue(); t_print("After 5 tenth seconds\n"); - t_print("nValue in Normal Prio Thread is %d\n", (int) nValueNormal); - t_print("nValue in BelowNormal Prio Thread is %d\n", (int) nValueBelowNormal); - t_print("nValue in Lowest Prio Thread is %d\n", (int) nValueLowest); + t_print("nValue in Normal Prio Thread is %d\n", static_cast<int>(nValueNormal)); + t_print("nValue in BelowNormal Prio Thread is %d\n", static_cast<int>(nValueBelowNormal)); + t_print("nValue in Lowest Prio Thread is %d\n", static_cast<int>(nValueLowest)); #ifndef _WIN32 CPPUNIT_ASSERT_MESSAGE( @@ -1526,7 +1526,7 @@ namespace osl_Thread delete aCountThread; t_print("nTenthSec = %f \n", nTenthSec); t_print("nSec = %f \n", nSec); - t_print("nValue = %d \n", (int) nValue); + t_print("nValue = %d \n", static_cast<int>(nValue)); CPPUNIT_ASSERT_MESSAGE( "Wait: Blocks the calling thread for the given number of time.", @@ -1586,8 +1586,8 @@ namespace osl_Thread ThreadHelper::thread_sleep_tenth_sec(3); sal_Int32 nLaterValue = aThread->getValue(); // resumeAndWaitThread(aThread); - t_print(" value = %d\n", (int) nValue); - t_print("later value = %d\n", (int) nLaterValue); + t_print(" value = %d\n", static_cast<int>(nValue)); + t_print("later value = %d\n", static_cast<int>(nLaterValue)); // if value and latervalue not equal, than the thread would not suspended CPPUNIT_ASSERT_EQUAL_MESSAGE( @@ -1604,8 +1604,8 @@ namespace osl_Thread aThread->join(); sal_Int32 nValue_join = aThread->getValue(); - t_print("value after term = %d\n", (int) nValue_term); - t_print("value after join = %d\n", (int) nValue_join); + t_print("value after term = %d\n", static_cast<int>(nValue_term)); + t_print("value after join = %d\n", static_cast<int>(nValue_join)); // nValue_term and nValue_join should be the same // but should be differ from nValue @@ -1641,8 +1641,8 @@ namespace osl_Thread resumeAndWaitThread(&aThread); - t_print(" value = %d\n", (int) nValue); - t_print("later value = %d\n", (int) nLaterValue); + t_print(" value = %d\n", static_cast<int>(nValue)); + t_print("later value = %d\n", static_cast<int>(nLaterValue)); //On windows, suspend works, so the values are same #ifdef _WIN32 @@ -1665,7 +1665,7 @@ namespace osl_Thread termAndJoinThread(&aThread); sal_Int32 nValue_term = aThread.getValue(); - t_print(" value term = %d\n", (int) nValue_term); + t_print(" value term = %d\n", static_cast<int>(nValue_term)); CPPUNIT_ASSERT_EQUAL_MESSAGE( "Schedule: don't schedule in thread run method, terminate failed.", diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx index 6b693067785f..e022cd500d65 100644 --- a/sal/qa/rtl/digest/rtl_digest.cxx +++ b/sal/qa/rtl/digest/rtl_digest.cxx @@ -76,7 +76,7 @@ OString createHex(const sal_uInt8* pKeyBuffer, sal_uInt32 nKeyLen) OStringBuffer aBuffer(nKeyLen * 2 + 1); for (sal_uInt32 i = 0; i < nKeyLen; ++i) { - sal_Int32 nValue = (sal_Int32) pKeyBuffer[i]; + sal_Int32 nValue = static_cast<sal_Int32>(pKeyBuffer[i]); if (nValue < 16) aBuffer.append('0'); aBuffer.append(nValue, 16); diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx index 77d7c6a82ac3..4bfdc41742e8 100644 --- a/sal/qa/rtl/textenc/rtl_textcvt.cxx +++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx @@ -71,7 +71,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR), &nInfo, &nConverted); CPPUNIT_ASSERT_EQUAL(nNumber, nSize); - CPPUNIT_ASSERT_EQUAL((sal_uInt32)0, nInfo); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo); CPPUNIT_ASSERT_EQUAL(nNumber, nConverted); rtl_destroyTextToUnicodeContext(aConverter, aContext); rtl_destroyTextToUnicodeConverter(aConverter); @@ -116,7 +116,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR), &nInfo, &nConverted); CPPUNIT_ASSERT_EQUAL(nNumber, nSize); - CPPUNIT_ASSERT_EQUAL((sal_uInt32)0, nInfo); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo); CPPUNIT_ASSERT_EQUAL(nNumber, nConverted); rtl_destroyUnicodeToTextContext(aConverter, aContext); rtl_destroyUnicodeToTextConverter(aConverter); @@ -163,9 +163,9 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { sal_uInt32 nExpectedInfo = (RTL_TEXTTOUNICODE_INFO_ERROR | RTL_TEXTTOUNICODE_INFO_UNDEFINED); - CPPUNIT_ASSERT_EQUAL((sal_Size) 0, nSize); + CPPUNIT_ASSERT_EQUAL(sal_Size(0), nSize); CPPUNIT_ASSERT_EQUAL(nExpectedInfo, nInfo); - CPPUNIT_ASSERT_EQUAL((sal_Size) 0, nConverted); + CPPUNIT_ASSERT_EQUAL(sal_Size(0), nConverted); rtl_destroyTextToUnicodeContext(aConverter, aContext); rtl_destroyTextToUnicodeConverter(aConverter); @@ -214,7 +214,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE : 0)), &nInfo, &nConverted); CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nSize); - CPPUNIT_ASSERT_EQUAL((sal_uInt32) 0, nInfo); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), nInfo); CPPUNIT_ASSERT_EQUAL(rTest.m_nTextSize, nConverted); rtl_destroyTextToUnicodeContext(aConverter, aContext); @@ -264,7 +264,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { nFlags, &nInfo, &nConverted); nOutput += nSize; nInput += nConverted; - CPPUNIT_ASSERT_EQUAL((sal_uInt32) 0, + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), (nInfo & ~RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL)); } CPPUNIT_ASSERT_EQUAL(rTest.m_nUnicodeSize, nOutput); |