summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-01-15 11:24:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-01-15 11:25:59 +0100
commitd55155cad0926f61b5745260196b93e95471d06a (patch)
tree01dcc4daf24997341422d2ae48c3890232e26d15 /cppu
parent9f813d9f692d10f6d151c27617c2c5a36fac8c19 (diff)
Include <cassert>
Also, move assert into uno_type_sequence_construct so that all its callers benefit. Also, change some OSL_ENSURE to assert. Change-Id: Idd0a03c4aa6eed1db453db84602c01ff16f0d72c
Diffstat (limited to 'cppu')
-rw-r--r--cppu/inc/com/sun/star/uno/Sequence.hxx14
-rw-r--r--cppu/source/uno/sequence.cxx4
2 files changed, 10 insertions, 8 deletions
diff --git a/cppu/inc/com/sun/star/uno/Sequence.hxx b/cppu/inc/com/sun/star/uno/Sequence.hxx
index 3a006a654e5c..a23fd3b48225 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 <cassert>
+
#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 d9e28fb7f9ad..d570461f9297 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 <cassert>
#include <string.h>
#include <rtl/alloc.h>
@@ -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)
{