diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-01-18 19:43:17 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-18 19:44:06 +0100 |
commit | c881b1b50e3be023efd4dfdebddd002545ed71b3 (patch) | |
tree | 118165046e429a421660f3345324f904774e2a63 /sal | |
parent | 8f766122f0c5fbbb5442e1a5dd6f4eab9744d5cd (diff) |
long and long long can be the same size (and thus also sal_Int64)
Change-Id: I3961ec27d23915b038c3a803dc71e7d937ca331c
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/string.hxx | 1 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 1 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_strings_valuex.cxx | 1 |
3 files changed, 2 insertions, 1 deletions
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() { |