sal: work around spurious signed overflow warnings
gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC): /rtl/string.hxx:1037:67: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
This commit is contained in:
@@ -1033,8 +1033,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
OString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
|
OString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
|
||||||
{
|
{
|
||||||
assert(beginIndex >= 0 && beginIndex <= getLength()
|
assert(beginIndex >= 0 && beginIndex <= getLength() && count >= 0
|
||||||
&& count >= 0 && count <= getLength() - beginIndex);
|
&& sal::static_int_cast<sal_uInt32>(count) <=
|
||||||
|
sal::static_int_cast<sal_uInt32>(getLength() - beginIndex));
|
||||||
if ( (beginIndex == 0) && (count == getLength()) )
|
if ( (beginIndex == 0) && (count == getLength()) )
|
||||||
return *this;
|
return *this;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user