[Libreoffice-commits] core.git: include/com

Michael Stahl mstahl at redhat.com
Thu Apr 24 04:13:15 PDT 2014


 include/com/sun/star/uno/Sequence.hxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 44d9e4960e7a373350e44fb88be7a3a8c2a81cfd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Apr 24 13:10:56 2014 +0200

    Sequence::operator[]: let's cast the other side to unsigned too
    
    Change-Id: I30845477e5dfbf5c90702bb0b6acb7955fcbe684

diff --git a/include/com/sun/star/uno/Sequence.hxx b/include/com/sun/star/uno/Sequence.hxx
index 88fba66..347953c 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -157,7 +157,7 @@ template< class E >
 inline E & Sequence< E >::operator [] ( sal_Int32 nIndex )
 {
     // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
-    assert(nIndex >= 0 && static_cast<sal_uInt32>(nIndex) < getLength());
+    assert(nIndex >= 0 && static_cast<sal_uInt32>(nIndex) < static_cast<sal_uInt32>(getLength()));
     return getArray()[ nIndex ];
 }
 
@@ -166,7 +166,7 @@ inline const E & Sequence< E >::operator [] ( sal_Int32 nIndex ) const
     SAL_THROW(())
 {
     // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
-    assert(nIndex >= 0 && static_cast<sal_uInt32>(nIndex) < getLength());
+    assert(nIndex >= 0 && static_cast<sal_uInt32>(nIndex) < static_cast<sal_uInt32>(getLength()));
     return reinterpret_cast< const E * >( _pSequence->elements )[ nIndex ];
 }
 


More information about the Libreoffice-commits mailing list