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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 18 12:07:51 PST 2013


 sal/inc/rtl/string.hxx  |   26 ++++++++++++++++++++++++++
 sal/inc/rtl/ustring.hxx |   26 ++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

New commits:
commit ed26a93b2fc640f5b727ba7dbabc80990438f5b3
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri Jan 18 21:05:04 2013 +0100

    avoid warning about a comparison being always true
    
    Change-Id: Ie0bd47a16af56b7d3ae070d5b82ec46ed21834c0

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index b750264..6b3d2ff 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1522,7 +1522,9 @@ public:
     */
     static OString number( unsigned long ll, sal_Int16 radix = 10 )
     {
+#if SAL_TYPES_SIZEOFLONG == 8
         assert( ll <= SAL_MAX_INT64 ); // valueOfInt64 may not be able to handle the highest bit
+#endif
         sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64];
         rtl_String* pNewData = 0;
         rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfInt64( aBuf, ll, radix ) );
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index f057166..a4051ac 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2156,7 +2156,9 @@ public:
     */
     static OUString number( unsigned long ll, sal_Int16 radix = 10 )
     {
+#if SAL_TYPES_SIZEOFLONG == 8
         assert( ll <= SAL_MAX_INT64 ); // valueOfInt64 may not be able to handle the highest bit
+#endif
         sal_Unicode aBuf[RTL_STR_MAX_VALUEOFINT64];
         rtl_uString* pNewData = 0;
         rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfInt64( aBuf, ll, radix ) );
commit 1efe9a15f86a7a9dc08b57fd1dd12336522ba515
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri Jan 18 20:31:44 2013 +0100

    avoid -Wsign-promo warnings
    
    I actually find the warning to be obsolete nonsense (the manpage talks
    about cfront), but at least for now.
    
    Change-Id: I4390b1779f6f8de062afd441f6855cb760adf93d

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index c04cd13..b750264 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1550,6 +1550,30 @@ public:
         return OString( pNewData, (DO_NOT_ACQUIRE*)0 );
     }
 
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OString number( short i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OString number( unsigned short i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OString number( signed char i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OString number( unsigned char i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
     /**
       Returns the string representation of the float argument.
 
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index c0370ff..f057166 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2184,6 +2184,30 @@ public:
         return OUString( pNewData, (DO_NOT_ACQUIRE*)0 );
     }
 
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OUString number( short i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OUString number( unsigned short i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OUString number( signed char i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
+    /// @overload
+    /// @since LibreOffice 4.1
+    static OUString number( unsigned char i, sal_Int16 radix = 10 )
+    {
+        return number( static_cast< long long >( i ), radix );
+    }
     /**
       Returns the string representation of the float argument.
 


More information about the Libreoffice-commits mailing list