Kaydet (Commit) 44d9e496 authored tarafından Michael Stahl's avatar Michael Stahl

Sequence::operator[]: let's cast the other side to unsigned too

Change-Id: I30845477e5dfbf5c90702bb0b6acb7955fcbe684
üst c1158fbc
...@@ -157,7 +157,7 @@ template< class E > ...@@ -157,7 +157,7 @@ template< class E >
inline E & Sequence< E >::operator [] ( sal_Int32 nIndex ) inline E & Sequence< E >::operator [] ( sal_Int32 nIndex )
{ {
// silence spurious -Werror=strict-overflow warnings from GCC 4.8.2 // 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 ]; return getArray()[ nIndex ];
} }
...@@ -166,7 +166,7 @@ inline const E & Sequence< E >::operator [] ( sal_Int32 nIndex ) const ...@@ -166,7 +166,7 @@ inline const E & Sequence< E >::operator [] ( sal_Int32 nIndex ) const
SAL_THROW(()) SAL_THROW(())
{ {
// silence spurious -Werror=strict-overflow warnings from GCC 4.8.2 // 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 ]; return reinterpret_cast< const E * >( _pSequence->elements )[ nIndex ];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment