diff options
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/bootstrap.cxx | 6 | ||||
-rw-r--r-- | sal/rtl/byteseq.cxx | 8 | ||||
-rw-r--r-- | sal/rtl/hash.cxx | 3 | ||||
-rw-r--r-- | sal/rtl/string.cxx | 6 |
4 files changed, 13 insertions, 10 deletions
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 754003e7a0e8..f5a650708057 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -72,7 +72,7 @@ bool isPathnameUrl(std::u16string_view url) bool resolvePathnameUrl(OUString * url) { - OSL_ASSERT(url); + assert(url); if (!isPathnameUrl(*url) || (osl::FileBase::getFileURLFromSystemPath( url->copy(VND_SUN_STAR_PATHNAME.size()), *url) == @@ -835,7 +835,7 @@ void SAL_CALL rtl_bootstrap_expandMacros(rtl_uString ** macro) void rtl_bootstrap_encode(rtl_uString const * value, rtl_uString ** encoded) { - OSL_ASSERT(value); + assert(value); OUStringBuffer b(value->length+5); for (sal_Int32 i = 0; i < value->length; ++i) { @@ -861,7 +861,7 @@ int hex(sal_Unicode c) sal_Unicode read(std::u16string_view text, std::size_t * pos, bool * escaped) { - OSL_ASSERT(pos && *pos < text.length() && escaped); + assert(pos && *pos < text.length() && escaped); sal_Unicode c = text[(*pos)++]; if (c == '\\') { diff --git a/sal/rtl/byteseq.cxx b/sal/rtl/byteseq.cxx index 0084f3969812..5c9cb224178f 100644 --- a/sal/rtl/byteseq.cxx +++ b/sal/rtl/byteseq.cxx @@ -41,7 +41,7 @@ void SAL_CALL rtl_byte_sequence_reference2One( { sal_Sequence * pSequence; - OSL_ENSURE( ppSequence, "### null ptr!" ); + assert(ppSequence && "### null ptr!"); pSequence = *ppSequence; if (pSequence->nRefCount > 1) @@ -132,7 +132,7 @@ void SAL_CALL rtl_byte_sequence_realloc( void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence ) SAL_THROW_EXTERN_C() { - OSL_ASSERT( pSequence ); + assert(pSequence); osl_atomic_increment( &(pSequence->nRefCount) ); } @@ -151,7 +151,7 @@ void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 nLength ) SAL_THROW_EXTERN_C() { - OSL_ASSERT( ppSequence ); + assert(ppSequence); if( *ppSequence ) { rtl_byte_sequence_release( *ppSequence ); @@ -178,7 +178,7 @@ void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , sal_Int32 nLength ) SAL_THROW_EXTERN_C() { - OSL_ASSERT( ppSequence ); + assert(ppSequence); if( *ppSequence ) { rtl_byte_sequence_release( *ppSequence ); diff --git a/sal/rtl/hash.cxx b/sal/rtl/hash.cxx index 4e255d965e17..ba7769d09a8c 100644 --- a/sal/rtl/hash.cxx +++ b/sal/rtl/hash.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <assert.h> #include <stdlib.h> #include "hash.hxx" @@ -76,10 +77,12 @@ static sal_uInt32 hashString(rtl_uString *pString) static StringHashTable * rtl_str_hash_new(sal_uInt32 nSize) { StringHashTable *pHash = static_cast<StringHashTable *>(malloc(sizeof(StringHashTable))); + assert(pHash && "Don't handle OOM conditions"); pHash->nEntries = 0; pHash->nSize = getNextSize (nSize); pHash->pData = static_cast< rtl_uString ** >(calloc(pHash->nSize, sizeof(rtl_uString *))); + assert(pHash->pData && "Don't handle OOM conditions"); return pHash; } diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx index 05f87475df0b..ce0e873fbd64 100644 --- a/sal/rtl/string.cxx +++ b/sal/rtl/string.cxx @@ -161,7 +161,7 @@ static bool rtl_impl_convertUStringToString(rtl_String ** pTarget, if ( *pTarget ) rtl_string_release( *pTarget ); *pTarget = rtl_string_ImplAlloc( nLength ); - OSL_ASSERT(*pTarget != nullptr); + assert(*pTarget != nullptr); pBuffer = (*pTarget)->buffer; do { @@ -200,7 +200,7 @@ static bool rtl_impl_convertUStringToString(rtl_String ** pTarget, for (;;) { pTemp = rtl_string_ImplAlloc( nNewLen ); - OSL_ASSERT(pTemp != nullptr); + assert(pTemp != nullptr); nDestBytes = rtl_convertUnicodeToText( hConverter, nullptr, pSource, nLength, pTemp->buffer, nNewLen, @@ -230,7 +230,7 @@ static bool rtl_impl_convertUStringToString(rtl_String ** pTarget, if ( nNewLen > nDestBytes+8 ) { rtl_String* pTemp2 = rtl_string_ImplAlloc( nDestBytes ); - OSL_ASSERT(pTemp2 != nullptr); + assert(pTemp2 != nullptr); rtl::str::Copy(pTemp2->buffer, pTemp->buffer, nDestBytes); rtl_freeString( pTemp ); pTemp = pTemp2; |