[Libreoffice-commits] .: 2 commits - sal/workben

Caolán McNamara caolan at kemper.freedesktop.org
Mon Dec 20 05:00:22 PST 2010


 sal/workben/measure_oustrings.cxx |   16 ++++++++++------
 sal/workben/testfile.cxx          |   10 +++++-----
 2 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit c6867d8c5c053d8f5256b5396557b974aceee389
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 20 13:00:11 2010 +0000

    tweak this to compare classic and wide versions

diff --git a/sal/workben/measure_oustrings.cxx b/sal/workben/measure_oustrings.cxx
index bff7d6d..c9bd728 100644
--- a/sal/workben/measure_oustrings.cxx
+++ b/sal/workben/measure_oustrings.cxx
@@ -45,16 +45,20 @@
 
 #ifdef SAL_DECLARE_UTF16
 #  define RTL_CONSTASCII_USTRINGPARAM_WIDE(str) \
-     reinterpret_cast<const sal_Unicode*>(SAL_DECLARE_UTF16(str)), SAL_N_ELEMENTS(str)
+     reinterpret_cast<const sal_Unicode*>(SAL_DECLARE_UTF16(str)), (SAL_N_ELEMENTS(str)-1)
 #endif
 
+#define RTL_CONSTASCII_USTRINGPARAM_CLASSIC(str) \
+    str, ((sal_Int32)(SAL_N_ELEMENTS(str)-1)), RTL_TEXTENCODING_ASCII_US
+
+
 SAL_IMPLEMENT_MAIN()
 {
     //get my cpu fan up to speed :-)
     for (int i = 0; i < 10000000; ++i)
     {
         rtl::OUString sFoo(rtl::OUString::createFromAscii("X"));
-        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM("X"));
+        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM_CLASSIC("X"));
 #ifdef SAL_DECLARE_UTF16
         rtl::OUString sBoo(RTL_CONSTASCII_USTRINGPARAM_WIDE("X"));
 #endif
@@ -93,9 +97,9 @@ SAL_IMPLEMENT_MAIN()
     {
     sal_uInt32 nStartTime = osl_getGlobalTimer();
     for (int i = 0; i < 100000000; ++i)
-        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM("X"));
+        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM_CLASSIC("X"));
     sal_uInt32 nEndTime = osl_getGlobalTimer();
-    std::cout << "rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\"X\")) " << nEndTime - nStartTime << "ms" << std::endl;
+    std::cout << "rtl::OUString(RTL_CONSTASCII_USTRINGPARAM_CLASSIC(\"X\")) " << nEndTime - nStartTime << "ms" << std::endl;
     }
 
 #ifdef SAL_DECLARE_UTF16
@@ -128,9 +132,9 @@ SAL_IMPLEMENT_MAIN()
     {
     sal_uInt32 nStartTime = osl_getGlobalTimer();
     for (int i = 0; i < 100000000; ++i)
-        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM("XXXXXXXXXXXXXXX"));
+        rtl::OUString sBar(RTL_CONSTASCII_USTRINGPARAM_CLASSIC("XXXXXXXXXXXXXXX"));
     sal_uInt32 nEndTime = osl_getGlobalTimer();
-    std::cout << "rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\"XXXXXXXX\")) " << nEndTime - nStartTime << "ms" << std::endl;
+    std::cout << "rtl::OUString(RTL_CONSTASCII_USTRINGPARAM_CLASSIC(\"XXXXXXXX\")) " << nEndTime - nStartTime << "ms" << std::endl;
     }
 
 #ifdef SAL_DECLARE_UTF16
commit a9f0988f19e15ee0d67d9376e2471ebc14e17b8a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 20 12:57:32 2010 +0000

    WaE: fix c++0x warnings

diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index aacff72..2103da6 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -1455,13 +1455,13 @@ void FileTimeTest( void )
     sSysModifyTime.tm_mon = 11;
     sSysModifyTime.tm_year = 95;
 
-    time_t aSysCreationTime =  mktime( &sSysCreationTime );
-    time_t aSysAccessTime =  mktime( &sSysAccessTime );
-    time_t aSysModifyTime =  mktime( &sSysModifyTime );
+    sal_uInt32 aSysCreationTime = mktime( &sSysCreationTime );
+    sal_uInt32 aSysAccessTime =  mktime( &sSysAccessTime );
+    sal_uInt32 aSysModifyTime =  mktime( &sSysModifyTime );
 
     TimeValue		aCreationTime	= { aSysCreationTime, 0};
-    TimeValue		aAccessTime		= { aSysAccessTime, 0};
-    TimeValue		aModifyTime		= { aSysModifyTime, 0};
+    TimeValue		aAccessTime	= { aSysAccessTime, 0};
+    TimeValue		aModifyTime	= { aSysModifyTime, 0};
 
     TimeValue		aCreationTimeRead;
     TimeValue		aAccessTimeRead;


More information about the Libreoffice-commits mailing list