From c881b1b50e3be023efd4dfdebddd002545ed71b3 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 18 Jan 2013 19:43:17 +0100 Subject: long and long long can be the same size (and thus also sal_Int64) Change-Id: I3961ec27d23915b038c3a803dc71e7d937ca331c --- sal/inc/rtl/string.hxx | 1 + sal/inc/rtl/ustring.hxx | 1 + sal/qa/rtl/strings/test_strings_valuex.cxx | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) (limited to 'sal') diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 325fe28af239..c04cd13c81e6 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -1522,6 +1522,7 @@ public: */ static OString number( unsigned long ll, sal_Int16 radix = 10 ) { + assert( ll <= SAL_MAX_INT64 ); // valueOfInt64 may not be able to handle the highest bit 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 c87978f4b067..c0370ffd526d 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -2156,6 +2156,7 @@ public: */ static OUString number( unsigned long ll, sal_Int16 radix = 10 ) { + assert( ll <= SAL_MAX_INT64 ); // valueOfInt64 may not be able to handle the highest bit sal_Unicode aBuf[RTL_STR_MAX_VALUEOFINT64]; rtl_uString* pNewData = 0; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfInt64( aBuf, ll, radix ) ); diff --git a/sal/qa/rtl/strings/test_strings_valuex.cxx b/sal/qa/rtl/strings/test_strings_valuex.cxx index d350b0fb401f..9573b1970592 100644 --- a/sal/qa/rtl/strings/test_strings_valuex.cxx +++ b/sal/qa/rtl/strings/test_strings_valuex.cxx @@ -70,7 +70,6 @@ void testInt() { assert( sizeof( long ) <= sizeof( sal_Int64 )); assert( sizeof( long long ) <= sizeof( sal_Int64 )); assert( sizeof( unsigned int ) < sizeof( sal_Int64 )); - assert( sizeof( unsigned long ) < sizeof( sal_Int64 )); } void test::strings::valueX::testOUInt() { -- cgit