[Libreoffice-commits] .: cppu/inc cppu/source
cppu/inc/com/sun/star/uno/Sequence.hxx | 14 ++ cppu/source/uno/sequence.cxx |4 2 files changed, 10 insertions(+), 8 deletions(-) New commits: commit d55155cad0926f61b5745260196b93e95471d06a Author: Stephan Bergmann Date: Tue Jan 15 11:24:46 2013 +0100 Include Also, move assert into uno_type_sequence_construct so that all its callers benefit. Also, change some OSL_ENSURE to assert. Change-Id: Idd0a03c4aa6eed1db453db84602c01ff16f0d72c diff --git a/cppu/inc/com/sun/star/uno/Sequence.hxx b/cppu/inc/com/sun/star/uno/Sequence.hxx index 3a006a6..a23fd3b 100644 --- a/cppu/inc/com/sun/star/uno/Sequence.hxx +++ b/cppu/inc/com/sun/star/uno/Sequence.hxx @@ -19,7 +19,10 @@ #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ #define _COM_SUN_STAR_UNO_SEQUENCE_HXX_ -#include "osl/diagnose.h" +#include "sal/config.h" + +#include + #include "osl/interlck.h" #include "com/sun/star/uno/Sequence.h" #include "typelib/typedescription.h" @@ -89,7 +92,6 @@ inline Sequence< E >::Sequence( const E * pElements, sal_Int32 len ) template< class E > inline Sequence< E >::Sequence( sal_Int32 len ) { -assert( len >= 0 ); const Type & rType = ::cppu::getTypeFavourUnsigned( this ); #if ! defined EXCEPTIONS_OFF sal_Bool success = @@ -167,9 +169,7 @@ inline E * Sequence< E >::getArray() template< class E > inline E & Sequence< E >::operator [] ( sal_Int32 nIndex ) { -OSL_ENSURE( -nIndex >= 0 && nIndex < getLength(), -"### illegal index of sequence!" ); +assert( nIndex >= 0 && nIndex < getLength() ); return getArray()[ nIndex ]; } @@ -178,9 +178,7 @@ template< class E > inline const E & Sequence< E >::operator [] ( sal_Int32 nIndex ) const SAL_THROW(()) { -OSL_ENSURE( -nIndex >= 0 && nIndex < getLength(), -"### illegal index of sequence!" ); +assert( nIndex >= 0 && nIndex < getLength() ); return reinterpret_cast< const E * >( _pSequence->elements )[ nIndex ]; } diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx index d9e28fb..d570461 100644 --- a/cppu/source/uno/sequence.cxx +++ b/cppu/source/uno/sequence.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + +#include #include #include @@ -771,6 +774,7 @@ sal_Bool SAL_CALL uno_type_sequence_construct( uno_AcquireFunc acquire ) SAL_THROW_EXTERN_C() { +assert( len >= 0 ); bool ret; if (len) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: cppu/inc
cppu/inc/com/sun/star/uno/Sequence.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit e2a1d1c49117e3321a59daff35500394a7e60cda Author: Miklos Vajna Date: Mon Jan 14 18:27:43 2013 +0100 uno::Sequence: assert on negative length Change-Id: Ie94a6042863bb0d91f2b61ac8a048182aea41c0a diff --git a/cppu/inc/com/sun/star/uno/Sequence.hxx b/cppu/inc/com/sun/star/uno/Sequence.hxx index 498109a0..3a006a6 100644 --- a/cppu/inc/com/sun/star/uno/Sequence.hxx +++ b/cppu/inc/com/sun/star/uno/Sequence.hxx @@ -89,6 +89,7 @@ inline Sequence< E >::Sequence( const E * pElements, sal_Int32 len ) template< class E > inline Sequence< E >::Sequence( sal_Int32 len ) { +assert( len >= 0 ); const Type & rType = ::cppu::getTypeFavourUnsigned( this ); #if ! defined EXCEPTIONS_OFF sal_Bool success = ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: cppu/inc
cppu/inc/com/sun/star/uno/Reference.hxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit a842b5690e77de51d933bd9a4224303abba1d870 Author: Stephan Bergmann Date: Sun Sep 30 19:59:02 2012 +0200 Make Reference::iset_throw work with multiple-inheritance interfaces Change-Id: Ia8a644c613de17279abdab533a6314ba6c0e0aec diff --git a/cppu/inc/com/sun/star/uno/Reference.hxx b/cppu/inc/com/sun/star/uno/Reference.hxx index 100a430..aa39810 100644 --- a/cppu/inc/com/sun/star/uno/Reference.hxx +++ b/cppu/inc/com/sun/star/uno/Reference.hxx @@ -91,7 +91,7 @@ inline interface_type * Reference< interface_type >::iset_throw( { if (pInterface) { -pInterface->acquire(); +castToXInterface(pInterface)->acquire(); return pInterface; } throw RuntimeException( @@ -184,13 +184,13 @@ inline Reference< interface_type >::Reference( const Any & rAny, UnoReference_Qu template< class interface_type > inline Reference< interface_type >::Reference( const Reference< interface_type > & rRef, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) ) { -_pInterface = iset_throw( rRef.get() ); +_pInterface = castToXInterface( iset_throw( rRef.get() ) ); } //__ template< class interface_type > inline Reference< interface_type >::Reference( interface_type * pInterface, UnoReference_SetThrow ) SAL_THROW( (RuntimeException) ) { -_pInterface = iset_throw( pInterface ); +_pInterface = castToXInterface( iset_throw( pInterface ) ); } #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits