diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:21:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:35 +0100 |
commit | 26f05d59bc1c25b8a0d19be7f4738fd12e557001 (patch) | |
tree | 560cccfaacf4b63385aa52ac4b3912248e87cbef /include/rtl | |
parent | loplugin:nullptr (automatic rewrite) (diff) | |
download | core-26f05d59bc1c25b8a0d19be7f4738fd12e557001.tar.gz core-26f05d59bc1c25b8a0d19be7f4738fd12e557001.zip |
loplugin:nullptr (automatic rewrite)
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
Diffstat (limited to 'include/rtl')
-rw-r--r-- | include/rtl/bootstrap.hxx | 8 | ||||
-rw-r--r-- | include/rtl/byteseq.hxx | 20 | ||||
-rw-r--r-- | include/rtl/instance.hxx | 2 | ||||
-rw-r--r-- | include/rtl/math.hxx | 26 | ||||
-rw-r--r-- | include/rtl/strbuf.hxx | 6 | ||||
-rw-r--r-- | include/rtl/string.hxx | 76 | ||||
-rw-r--r-- | include/rtl/ustrbuf.hxx | 12 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 124 |
8 files changed, 137 insertions, 137 deletions
diff --git a/include/rtl/bootstrap.hxx b/include/rtl/bootstrap.hxx index 8819dece3901..2c433b923977 100644 --- a/include/rtl/bootstrap.hxx +++ b/include/rtl/bootstrap.hxx @@ -157,7 +157,7 @@ namespace rtl inline bool Bootstrap::get( const ::rtl::OUString &sName, ::rtl::OUString & outValue ) { - return rtl_bootstrap_get( sName.pData , &(outValue.pData) , 0 ); + return rtl_bootstrap_get( sName.pData , &(outValue.pData) , NULL ); } inline void Bootstrap::get( const ::rtl::OUString &sName, @@ -174,7 +174,7 @@ namespace rtl inline Bootstrap::Bootstrap() { - _handle = 0; + _handle = NULL; } inline Bootstrap::Bootstrap(const rtl::OUString & iniName) @@ -183,7 +183,7 @@ namespace rtl _handle = rtl_bootstrap_args_open(iniName.pData); else - _handle = 0; + _handle = NULL; } inline Bootstrap::~Bootstrap() @@ -195,7 +195,7 @@ namespace rtl inline bool Bootstrap::getFrom(const ::rtl::OUString &sName, ::rtl::OUString &outValue) const { - return rtl_bootstrap_get_from_handle(_handle, sName.pData, &outValue.pData, 0); + return rtl_bootstrap_get_from_handle(_handle, sName.pData, &outValue.pData, NULL); } inline void Bootstrap::getFrom(const ::rtl::OUString &sName, diff --git a/include/rtl/byteseq.hxx b/include/rtl/byteseq.hxx index 494b17c4d8bd..cb16b83487d7 100644 --- a/include/rtl/byteseq.hxx +++ b/include/rtl/byteseq.hxx @@ -28,13 +28,13 @@ namespace rtl inline ByteSequence::ByteSequence() - : _pSequence( 0 ) + : _pSequence( NULL ) { ::rtl_byte_sequence_construct( &_pSequence, 0 ); } inline ByteSequence::ByteSequence( const ByteSequence & rSeq ) - : _pSequence( 0 ) + : _pSequence( NULL ) { ::rtl_byte_sequence_assign( &_pSequence, rSeq._pSequence ); } @@ -46,18 +46,18 @@ inline ByteSequence::ByteSequence( sal_Sequence *pSequence) } inline ByteSequence::ByteSequence( const sal_Int8 * pElements, sal_Int32 len ) - : _pSequence( 0 ) + : _pSequence( NULL ) { ::rtl_byte_sequence_constructFromArray( &_pSequence, pElements, len ); - if (_pSequence == 0) + if (_pSequence == NULL) throw ::std::bad_alloc(); } inline ByteSequence::ByteSequence( sal_Int32 len, enum __ByteSequence_NoDefault ) - : _pSequence( 0 ) + : _pSequence( NULL ) { ::rtl_byte_sequence_constructNoDefault( &_pSequence, len ); - if (_pSequence == 0) + if (_pSequence == NULL) throw ::std::bad_alloc(); } @@ -67,10 +67,10 @@ inline ByteSequence::ByteSequence( sal_Sequence *pSequence, enum __ByteSequence_ } inline ByteSequence::ByteSequence( sal_Int32 len ) - : _pSequence( 0 ) + : _pSequence( NULL ) { ::rtl_byte_sequence_construct( &_pSequence, len ); - if (_pSequence == 0) + if (_pSequence == NULL) throw ::std::bad_alloc(); } @@ -93,7 +93,7 @@ inline bool ByteSequence::operator == ( const ByteSequence & rSeq ) const inline sal_Int8 * ByteSequence::getArray() { ::rtl_byte_sequence_reference2One( &_pSequence ); - if (_pSequence == 0) + if (_pSequence == NULL) throw ::std::bad_alloc(); return reinterpret_cast<sal_Int8 *>(_pSequence->elements); } @@ -101,7 +101,7 @@ inline sal_Int8 * ByteSequence::getArray() inline void ByteSequence::realloc( sal_Int32 nSize ) { ::rtl_byte_sequence_realloc( &_pSequence, nSize ); - if (_pSequence == 0) + if (_pSequence == NULL) throw ::std::bad_alloc(); } diff --git a/include/rtl/instance.hxx b/include/rtl/instance.hxx index 25f51732fcd0..d7f8401fef4a 100644 --- a/include/rtl/instance.hxx +++ b/include/rtl/instance.hxx @@ -355,7 +355,7 @@ template< typename Inst, typename InstCtor, typename Data, typename DataCtor > Inst * rtl_Instance< Inst, InstCtor, Guard, GuardCtor, Data, DataCtor >::m_pInstance -= 0; += NULL; #endif // _MSC_VER } diff --git a/include/rtl/math.hxx b/include/rtl/math.hxx index 1b90854bb7ef..76d00f0ce993 100644 --- a/include/rtl/math.hxx +++ b/include/rtl/math.hxx @@ -43,7 +43,7 @@ inline rtl::OString doubleToString(double fValue, rtl_math_StringFormat eFormat, bool bEraseTrailingDecZeros = false) { rtl::OString aResult; - rtl_math_doubleToString(&aResult.pData, 0, 0, fValue, eFormat, nDecPlaces, + rtl_math_doubleToString(&aResult.pData, NULL, 0, fValue, eFormat, nDecPlaces, cDecSeparator, pGroups, cGroupSeparator, bEraseTrailingDecZeros); return aResult; @@ -57,8 +57,8 @@ inline rtl::OString doubleToString(double fValue, rtl_math_StringFormat eFormat, bool bEraseTrailingDecZeros = false) { rtl::OString aResult; - rtl_math_doubleToString(&aResult.pData, 0, 0, fValue, eFormat, nDecPlaces, - cDecSeparator, 0, 0, bEraseTrailingDecZeros); + rtl_math_doubleToString(&aResult.pData, NULL, 0, fValue, eFormat, nDecPlaces, + cDecSeparator, NULL, 0, bEraseTrailingDecZeros); return aResult; } @@ -73,7 +73,7 @@ inline rtl::OUString doubleToUString(double fValue, bool bEraseTrailingDecZeros = false) { rtl::OUString aResult; - rtl_math_doubleToUString(&aResult.pData, 0, 0, fValue, eFormat, nDecPlaces, + rtl_math_doubleToUString(&aResult.pData, NULL, 0, fValue, eFormat, nDecPlaces, cDecSeparator, pGroups, cGroupSeparator, bEraseTrailingDecZeros); return aResult; @@ -88,8 +88,8 @@ inline rtl::OUString doubleToUString(double fValue, bool bEraseTrailingDecZeros = false) { rtl::OUString aResult; - rtl_math_doubleToUString(&aResult.pData, 0, 0, fValue, eFormat, nDecPlaces, - cDecSeparator, 0, 0, bEraseTrailingDecZeros); + rtl_math_doubleToUString(&aResult.pData, NULL, 0, fValue, eFormat, nDecPlaces, + cDecSeparator, NULL, 0, bEraseTrailingDecZeros); return aResult; } @@ -125,7 +125,7 @@ inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue, sal_Int32 * pCapacity; rBuffer.accessInternals( &pData, &pCapacity ); rtl_math_doubleToUString( pData, pCapacity, rBuffer.getLength(), fValue, - eFormat, nDecPlaces, cDecSeparator, 0, 0, + eFormat, nDecPlaces, cDecSeparator, NULL, 0, bEraseTrailingDecZeros); } @@ -133,8 +133,8 @@ inline void doubleToUStringBuffer( rtl::OUStringBuffer& rBuffer, double fValue, */ inline double stringToDouble(rtl::OString const & rString, sal_Char cDecSeparator, sal_Char cGroupSeparator, - rtl_math_ConversionStatus * pStatus = 0, - sal_Int32 * pParsedEnd = 0) + rtl_math_ConversionStatus * pStatus = NULL, + sal_Int32 * pParsedEnd = NULL) { sal_Char const * pBegin = rString.getStr(); sal_Char const * pEnd; @@ -142,7 +142,7 @@ inline double stringToDouble(rtl::OString const & rString, pBegin + rString.getLength(), cDecSeparator, cGroupSeparator, pStatus, &pEnd); - if (pParsedEnd != 0) + if (pParsedEnd != NULL) *pParsedEnd = (sal_Int32)(pEnd - pBegin); return fResult; } @@ -152,8 +152,8 @@ inline double stringToDouble(rtl::OString const & rString, inline double stringToDouble(rtl::OUString const & rString, sal_Unicode cDecSeparator, sal_Unicode cGroupSeparator, - rtl_math_ConversionStatus * pStatus = 0, - sal_Int32 * pParsedEnd = 0) + rtl_math_ConversionStatus * pStatus = NULL, + sal_Int32 * pParsedEnd = NULL) { sal_Unicode const * pBegin = rString.getStr(); sal_Unicode const * pEnd; @@ -161,7 +161,7 @@ inline double stringToDouble(rtl::OUString const & rString, pBegin + rString.getLength(), cDecSeparator, cGroupSeparator, pStatus, &pEnd); - if (pParsedEnd != 0) + if (pParsedEnd != NULL) *pParsedEnd = (sal_Int32)(pEnd - pBegin); return fResult; } diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx index 307110367a1e..15926911008e 100644 --- a/include/rtl/strbuf.hxx +++ b/include/rtl/strbuf.hxx @@ -481,7 +481,7 @@ public: */ OStringBuffer & append( const sal_Char * str, sal_Int32 len) { - assert( len == 0 || str != 0 ); // cannot assert that in rtl_stringbuffer_insert + assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert rtl_stringbuffer_insert( &pData, &nCapacity, getLength(), str, len ); return *this; } @@ -654,7 +654,7 @@ public: */ char * appendUninitialized(sal_Int32 length) { sal_Int32 n = getLength(); - rtl_stringbuffer_insert(&pData, &nCapacity, n, 0, length); + rtl_stringbuffer_insert(&pData, &nCapacity, n, NULL, length); return pData->buffer + n; } @@ -745,7 +745,7 @@ public: */ OStringBuffer & insert( sal_Int32 offset, const sal_Char * str, sal_Int32 len) { - assert( len == 0 || str != 0 ); // cannot assert that in rtl_stringbuffer_insert + assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert rtl_stringbuffer_insert( &pData, &nCapacity, offset, str, len ); return *this; } diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index ad143f5ae047..ca0d1d114053 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -99,7 +99,7 @@ public: */ OString() { - pData = 0; + pData = NULL; rtl_string_new( &pData ); } @@ -143,7 +143,7 @@ public: @param value a character. */ explicit OString( sal_Char value ) - : pData (0) + : pData (NULL) { rtl_string_newFromStr_WithLength( &pData, &value, 1 ); } @@ -159,14 +159,14 @@ public: template< typename T > OString( const T& value, typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_string_newFromStr( &pData, value ); } template< typename T > OString( T& value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_string_newFromStr( &pData, value ); } @@ -185,7 +185,7 @@ public: { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); - pData = 0; + pData = NULL; if (libreoffice_internal::ConstCharArrayDetector<T>::length == 0) { rtl_string_new(&pData); } else { @@ -210,7 +210,7 @@ public: */ OString( const sal_Char * value, sal_Int32 length ) { - pData = 0; + pData = NULL; rtl_string_newFromStr_WithLength( &pData, value, length ); } @@ -232,9 +232,9 @@ public: rtl_TextEncoding encoding, sal_uInt32 convertFlags = OUSTRING_TO_OSTRING_CVTFLAGS ) { - pData = 0; + pData = NULL; rtl_uString2String( &pData, value, length, encoding, convertFlags ); - if (pData == 0) { + if (pData == NULL) { throw std::bad_alloc(); } } @@ -750,9 +750,9 @@ public: @since LibreOffice 4.0 */ - bool startsWith(OString const & str, OString * rest = 0) const { + bool startsWith(OString const & str, OString * rest = NULL) const { bool b = match(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -765,11 +765,11 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith( - T & literal, OString * rest = 0) const + T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION bool b = match(literal, 0); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -795,11 +795,11 @@ public: @since LibreOffice 5.1 */ - bool startsWithIgnoreAsciiCase(OString const & str, OString * rest = 0) + bool startsWithIgnoreAsciiCase(OString const & str, OString * rest = NULL) const { bool b = matchIgnoreAsciiCase(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -812,13 +812,13 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type - startsWithIgnoreAsciiCase(T & literal, OString * rest = 0) const + startsWithIgnoreAsciiCase(T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); bool b = matchIgnoreAsciiCase(literal); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -839,10 +839,10 @@ public: @since LibreOffice 3.6 */ - bool endsWith(OString const & str, OString * rest = 0) const { + bool endsWith(OString const & str, OString * rest = NULL) const { bool b = str.getLength() <= getLength() && match(str, getLength() - str.getLength()); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(0, getLength() - str.getLength()); } return b; @@ -855,7 +855,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type endsWith( - T & literal, OString * rest = 0) const + T & literal, OString * rest = NULL) const { RTL_STRING_CONST_FUNCTION assert( @@ -868,7 +868,7 @@ public: literal), (getLength() - libreoffice_internal::ConstCharArrayDetector<T>::length)); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( 0, (getLength() @@ -1214,7 +1214,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString copy( sal_Int32 beginIndex ) const { - rtl_String *pNew = 0; + rtl_String *pNew = NULL; rtl_string_newFromSubString( &pNew, pData, beginIndex, getLength() - beginIndex ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1233,7 +1233,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString copy( sal_Int32 beginIndex, sal_Int32 count ) const { - rtl_String *pNew = 0; + rtl_String *pNew = NULL; rtl_string_newFromSubString( &pNew, pData, beginIndex, count ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1248,7 +1248,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString concat( const OString & str ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newConcat( &pNew, pData, str.pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1275,7 +1275,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString replaceAt( sal_Int32 index, sal_Int32 count, const OString& newStr ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newReplaceStrAt( &pNew, pData, index, count, newStr.pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1295,7 +1295,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString replace( sal_Char oldChar, sal_Char newChar ) const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newReplace( &pNew, pData, oldChar, newChar ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1319,13 +1319,13 @@ public: @since LibreOffice 3.6 */ SAL_WARN_UNUSED_RESULT OString replaceFirst( - OString const & from, OString const & to, sal_Int32 * index = 0) const + OString const & from, OString const & to, sal_Int32 * index = NULL) const { - rtl_String * s = 0; + rtl_String * s = NULL; sal_Int32 i = 0; rtl_string_newReplaceFirst( &s, pData, from.pData->buffer, from.pData->length, - to.pData->buffer, to.pData->length, index == 0 ? &i : index); + to.pData->buffer, to.pData->length, index == NULL ? &i : index); return OString(s, SAL_NO_ACQUIRE); } @@ -1343,7 +1343,7 @@ public: @since LibreOffice 3.6 */ SAL_WARN_UNUSED_RESULT OString replaceAll(OString const & from, OString const & to) const { - rtl_String * s = 0; + rtl_String * s = NULL; rtl_string_newReplaceAll( &s, pData, from.pData->buffer, from.pData->length, to.pData->buffer, to.pData->length); @@ -1362,7 +1362,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString toAsciiLowerCase() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newToAsciiLowerCase( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1379,7 +1379,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString toAsciiUpperCase() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newToAsciiUpperCase( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1397,7 +1397,7 @@ public: */ SAL_WARN_UNUSED_RESULT OString trim() const { - rtl_String* pNew = 0; + rtl_String* pNew = NULL; rtl_string_newTrim( &pNew, pData ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1428,7 +1428,7 @@ public: */ OString getToken( sal_Int32 token, sal_Char cTok, sal_Int32& index ) const { - rtl_String * pNew = 0; + rtl_String * pNew = NULL; index = rtl_string_getToken( &pNew, pData, token, cTok, index ); return OString( pNew, SAL_NO_ACQUIRE ); } @@ -1602,7 +1602,7 @@ public: static OString number( long long ll, sal_Int16 radix = 10 ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfInt64( aBuf, ll, radix ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1611,7 +1611,7 @@ public: static OString number( unsigned long long ll, sal_Int16 radix = 10 ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFUINT64]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfUInt64( aBuf, ll, radix ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1628,7 +1628,7 @@ public: static OString number( float f ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFFLOAT]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfFloat( aBuf, f ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1645,7 +1645,7 @@ public: static OString number( double d ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFDOUBLE]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfDouble( aBuf, d ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } @@ -1680,7 +1680,7 @@ public: static OString boolean( bool b ) { sal_Char aBuf[RTL_STR_MAX_VALUEOFBOOLEAN]; - rtl_String* pNewData = 0; + rtl_String* pNewData = NULL; rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfBoolean( aBuf, b ) ); return OString( pNewData, SAL_NO_ACQUIRE ); } diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index fe64ebe48280..911163e2db20 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -153,7 +153,7 @@ public: template< typename T > OUStringBuffer( T&, typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; nCapacity = 10; rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage rtl_string_unittest_invalid_conversion = true; @@ -165,7 +165,7 @@ public: template< typename T > OUStringBuffer( const T&, typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; nCapacity = 10; rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage rtl_string_unittest_invalid_conversion = true; @@ -461,7 +461,7 @@ public: */ OUStringBuffer & append( const sal_Unicode * str, sal_Int32 len) { - assert( len == 0 || str != 0 ); // cannot assert that in rtl_uStringbuffer_insert + assert( len == 0 || str != NULL ); // cannot assert that in rtl_uStringbuffer_insert rtl_uStringbuffer_insert( &pData, &nCapacity, getLength(), str, len ); return *this; } @@ -741,7 +741,7 @@ public: */ sal_Unicode * appendUninitialized(sal_Int32 length) { sal_Int32 n = getLength(); - rtl_uStringbuffer_insert(&pData, &nCapacity, n, 0, length); + rtl_uStringbuffer_insert(&pData, &nCapacity, n, NULL, length); return pData->buffer + n; } @@ -807,7 +807,7 @@ public: */ OUStringBuffer & insert( sal_Int32 offset, const sal_Unicode * str, sal_Int32 len) { - assert( len == 0 || str != 0 ); // cannot assert that in rtl_uStringbuffer_insert + assert( len == 0 || str != NULL ); // cannot assert that in rtl_uStringbuffer_insert rtl_uStringbuffer_insert( &pData, &nCapacity, offset, str, len ); return *this; } @@ -1381,7 +1381,7 @@ public: { assert(beginIndex >= 0 && beginIndex <= getLength()); assert(count >= 0 && count <= getLength() - beginIndex); - rtl_uString *pNew = 0; + rtl_uString *pNew = NULL; rtl_uStringbuffer_newFromStr_WithLength( &pNew, getStr() + beginIndex, count ); return OUStringBuffer( pNew, count + 16 ); } diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 398dd93fbfd3..20becd358589 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -114,7 +114,7 @@ public: */ OUString() { - pData = 0; + pData = NULL; rtl_uString_new( &pData ); } @@ -157,7 +157,7 @@ public: @param value a Unicode character. */ explicit OUString( sal_Unicode value ) - : pData (0) + : pData (NULL) { rtl_uString_newFromStr_WithLength( &pData, &value, 1 ); } @@ -180,7 +180,7 @@ public: */ OUString( const sal_Unicode * value ) { - pData = 0; + pData = NULL; rtl_uString_newFromStr( &pData, value ); } @@ -194,7 +194,7 @@ public: */ OUString( const sal_Unicode * value, sal_Int32 length ) { - pData = 0; + pData = NULL; rtl_uString_newFromStr_WithLength( &pData, value, length ); } @@ -218,7 +218,7 @@ public: { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); - pData = 0; + pData = NULL; if (libreoffice_internal::ConstCharArrayDetector<T>::length == 0) { rtl_uString_new(&pData); } else { @@ -241,7 +241,7 @@ public: template< typename T > OUString( T&, typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage rtl_string_unittest_invalid_conversion = true; } @@ -252,7 +252,7 @@ public: template< typename T > OUString( const T&, typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() ) { - pData = 0; + pData = NULL; rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage rtl_string_unittest_invalid_conversion = true; } @@ -275,7 +275,7 @@ public: @since LibreOffice 5.0 */ - OUString(OUStringLiteral literal): pData(0) { + OUString(OUStringLiteral literal): pData(NULL) { rtl_uString_newFromLiteral(&pData, literal.data, literal.size, 0); } /// @endcond @@ -299,9 +299,9 @@ public: rtl_TextEncoding encoding, sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS ) { - pData = 0; + pData = NULL; rtl_string2UString( &pData, value, length, encoding, convertFlags ); - if (pData == 0) { + if (pData == NULL) { throw std::bad_alloc(); } } @@ -1070,9 +1070,9 @@ public: @since LibreOffice 4.0 */ - bool startsWith(OUString const & str, OUString * rest = 0) const { + bool startsWith(OUString const & str, OUString * rest = NULL) const { bool b = match(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -1085,7 +1085,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type startsWith( - T & literal, OUString * rest = 0) const + T & literal, OUString * rest = NULL) const { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); @@ -1097,7 +1097,7 @@ public: libreoffice_internal::ConstCharArrayDetector<T>::toPointer( literal), libreoffice_internal::ConstCharArrayDetector<T>::length); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -1124,11 +1124,11 @@ public: @since LibreOffice 4.0 */ - bool startsWithIgnoreAsciiCase(OUString const & str, OUString * rest = 0) + bool startsWithIgnoreAsciiCase(OUString const & str, OUString * rest = NULL) const { bool b = matchIgnoreAsciiCase(str); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(str.getLength()); } return b; @@ -1141,7 +1141,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type - startsWithIgnoreAsciiCase(T & literal, OUString * rest = 0) const + startsWithIgnoreAsciiCase(T & literal, OUString * rest = NULL) const { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); @@ -1153,7 +1153,7 @@ public: literal), libreoffice_internal::ConstCharArrayDetector<T>::length) == 0); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( libreoffice_internal::ConstCharArrayDetector<T>::length); } @@ -1174,10 +1174,10 @@ public: @since LibreOffice 3.6 */ - bool endsWith(OUString const & str, OUString * rest = 0) const { + bool endsWith(OUString const & str, OUString * rest = NULL) const { bool b = str.getLength() <= getLength() && match(str, getLength() - str.getLength()); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(0, getLength() - str.getLength()); } return b; @@ -1190,7 +1190,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type - endsWith(T & literal, OUString * rest = 0) const + endsWith(T & literal, OUString * rest = NULL) const { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); @@ -1203,7 +1203,7 @@ public: libreoffice_internal::ConstCharArrayDetector<T>::toPointer( literal), libreoffice_internal::ConstCharArrayDetector<T>::length); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( 0, (getLength() @@ -1252,11 +1252,11 @@ public: @since LibreOffice 3.6 */ - bool endsWithIgnoreAsciiCase(OUString const & str, OUString * rest = 0) const + bool endsWithIgnoreAsciiCase(OUString const & str, OUString * rest = NULL) const { bool b = str.getLength() <= getLength() && matchIgnoreAsciiCase(str, getLength() - str.getLength()); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy(0, getLength() - str.getLength()); } return b; @@ -1269,7 +1269,7 @@ public: */ template< typename T > typename libreoffice_internal::ConstCharArrayDetector< T, bool >::Type - endsWithIgnoreAsciiCase(T & literal, OUString * rest = 0) const + endsWithIgnoreAsciiCase(T & literal, OUString * rest = NULL) const { assert( libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal)); @@ -1284,7 +1284,7 @@ public: literal), libreoffice_internal::ConstCharArrayDetector<T>::length) == 0); - if (b && rest != 0) { + if (b && rest != NULL) { *rest = copy( 0, (getLength() @@ -1721,7 +1721,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString copy( sal_Int32 beginIndex ) const { - rtl_uString *pNew = 0; + rtl_uString *pNew = NULL; rtl_uString_newFromSubString( &pNew, pData, beginIndex, getLength() - beginIndex ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -1740,7 +1740,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString copy( sal_Int32 beginIndex, sal_Int32 count ) const { - rtl_uString *pNew = 0; + rtl_uString *pNew = NULL; rtl_uString_newFromSubString( &pNew, pData, beginIndex, count ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -1755,7 +1755,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString concat( const OUString & str ) const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newConcat( &pNew, pData, str.pData ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -1782,7 +1782,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString replaceAt( sal_Int32 index, sal_Int32 count, const OUString& newStr ) const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newReplaceStrAt( &pNew, pData, index, count, newStr.pData ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -1802,7 +1802,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString replace( sal_Unicode oldChar, sal_Unicode newChar ) const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newReplace( &pNew, pData, oldChar, newChar ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -1826,12 +1826,12 @@ public: @since LibreOffice 3.6 */ SAL_WARN_UNUSED_RESULT OUString replaceFirst( - OUString const & from, OUString const & to, sal_Int32 * index = 0) const + OUString const & from, OUString const & to, sal_Int32 * index = NULL) const { - rtl_uString * s = 0; + rtl_uString * s = NULL; sal_Int32 i = 0; rtl_uString_newReplaceFirst( - &s, pData, from.pData, to.pData, index == 0 ? &i : index); + &s, pData, from.pData, to.pData, index == NULL ? &i : index); return OUString(s, SAL_NO_ACQUIRE); } @@ -1855,16 +1855,16 @@ public: */ template< typename T > SAL_WARN_UNUSED_RESULT typename libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst( T& from, OUString const & to, - sal_Int32 * index = 0) const + sal_Int32 * index = NULL) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from)); - rtl_uString * s = 0; + rtl_uString * s = NULL; sal_Int32 i = 0; rtl_uString_newReplaceFirstAsciiL( &s, pData, libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from), libreoffice_internal::ConstCharArrayDetector<T>::length, to.pData, - index == 0 ? &i : index); + index == NULL ? &i : index); return OUString(s, SAL_NO_ACQUIRE); } @@ -1888,16 +1888,16 @@ public: */ template< typename T > SAL_WARN_UNUSED_RESULT typename libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceFirst( OUString const & from, T& to, - sal_Int32 * index = 0) const + sal_Int32 * index = NULL) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to)); - rtl_uString * s = 0; + rtl_uString * s = NULL; sal_Int32 i = 0; rtl_uString_newReplaceFirstToAsciiL( &s, pData, from.pData, libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to), libreoffice_internal::ConstCharArrayDetector<T>::length, - index == 0 ? &i : index); + index == NULL ? &i : index); return OUString(s, SAL_NO_ACQUIRE); } @@ -1921,11 +1921,11 @@ public: */ template< typename T1, typename T2 > SAL_WARN_UNUSED_RESULT typename libreoffice_internal::ConstCharArrayDetector< T1, typename libreoffice_internal::ConstCharArrayDetector< T2, OUString >::Type >::Type - replaceFirst( T1& from, T2& to, sal_Int32 * index = 0) const + replaceFirst( T1& from, T2& to, sal_Int32 * index = NULL) const { assert(libreoffice_internal::ConstCharArrayDetector<T1>::isValid(from)); assert(libreoffice_internal::ConstCharArrayDetector<T2>::isValid(to)); - rtl_uString * s = 0; + rtl_uString * s = NULL; sal_Int32 i = 0; rtl_uString_newReplaceFirstAsciiLAsciiL( &s, pData, @@ -1933,7 +1933,7 @@ public: libreoffice_internal::ConstCharArrayDetector<T1>::length, libreoffice_internal::ConstCharArrayDetector<T2>::toPointer(to), libreoffice_internal::ConstCharArrayDetector<T2>::length, - index == 0 ? &i : index); + index == NULL ? &i : index); return OUString(s, SAL_NO_ACQUIRE); } @@ -1955,7 +1955,7 @@ public: SAL_WARN_UNUSED_RESULT OUString replaceAll( OUString const & from, OUString const & to, sal_Int32 fromIndex = 0) const { - rtl_uString * s = 0; + rtl_uString * s = NULL; rtl_uString_newReplaceAllFromIndex(&s, pData, from.pData, to.pData, fromIndex); return OUString(s, SAL_NO_ACQUIRE); } @@ -1977,7 +1977,7 @@ public: SAL_WARN_UNUSED_RESULT typename libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll( T& from, OUString const & to) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(from)); - rtl_uString * s = 0; + rtl_uString * s = NULL; rtl_uString_newReplaceAllAsciiL( &s, pData, libreoffice_internal::ConstCharArrayDetector<T>::toPointer(from), @@ -2002,7 +2002,7 @@ public: SAL_WARN_UNUSED_RESULT typename libreoffice_internal::ConstCharArrayDetector< T, OUString >::Type replaceAll( OUString const & from, T& to) const { assert(libreoffice_internal::ConstCharArrayDetector<T>::isValid(to)); - rtl_uString * s = 0; + rtl_uString * s = NULL; rtl_uString_newReplaceAllToAsciiL( &s, pData, from.pData, libreoffice_internal::ConstCharArrayDetector<T>::toPointer(to), @@ -2029,7 +2029,7 @@ public: { assert(libreoffice_internal::ConstCharArrayDetector<T1>::isValid(from)); assert(libreoffice_internal::ConstCharArrayDetector<T2>::isValid(to)); - rtl_uString * s = 0; + rtl_uString * s = NULL; rtl_uString_newReplaceAllAsciiLAsciiL( &s, pData, libreoffice_internal::ConstCharArrayDetector<T1>::toPointer(from), @@ -2051,7 +2051,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString toAsciiLowerCase() const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newToAsciiLowerCase( &pNew, pData ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -2068,7 +2068,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString toAsciiUpperCase() const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newToAsciiUpperCase( &pNew, pData ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -2086,7 +2086,7 @@ public: */ SAL_WARN_UNUSED_RESULT OUString trim() const { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newTrim( &pNew, pData ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -2117,7 +2117,7 @@ public: */ OUString getToken( sal_Int32 token, sal_Unicode cTok, sal_Int32& index ) const { - rtl_uString * pNew = 0; + rtl_uString * pNew = NULL; index = rtl_uString_getToken( &pNew, pData, token, cTok, index ); return OUString( pNew, SAL_NO_ACQUIRE ); } @@ -2272,9 +2272,9 @@ public: */ OUString intern() const { - rtl_uString * pNew = 0; + rtl_uString * pNew = NULL; rtl_uString_intern( &pNew, pData ); - if (pNew == 0) { + if (pNew == NULL) { throw std::bad_alloc(); } return OUString( pNew, SAL_NO_ACQUIRE ); @@ -2310,10 +2310,10 @@ public: sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS, sal_uInt32 *pInfo = NULL ) { - rtl_uString * pNew = 0; + rtl_uString * pNew = NULL; rtl_uString_internConvert( &pNew, value, length, encoding, convertFlags, pInfo ); - if (pNew == 0) { + if (pNew == NULL) { throw std::bad_alloc(); } return OUString( pNew, SAL_NO_ACQUIRE ); @@ -2466,7 +2466,7 @@ public: static OUString number( int i, sal_Int16 radix = 10 ) { sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFINT32]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfInt32( aBuf, i, radix ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2493,7 +2493,7 @@ public: static OUString number( long long ll, sal_Int16 radix = 10 ) { sal_Unicode aBuf[RTL_STR_MAX_VALUEOFINT64]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfInt64( aBuf, ll, radix ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2502,7 +2502,7 @@ public: static OUString number( unsigned long long ll, sal_Int16 radix = 10 ) { sal_Unicode aBuf[RTL_STR_MAX_VALUEOFUINT64]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfUInt64( aBuf, ll, radix ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2519,7 +2519,7 @@ public: static OUString number( float f ) { sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFFLOAT]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfFloat( aBuf, f ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2536,7 +2536,7 @@ public: static OUString number( double d ) { sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFDOUBLE]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfDouble( aBuf, d ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2571,7 +2571,7 @@ public: static OUString boolean( bool b ) { sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFBOOLEAN]; - rtl_uString* pNewData = 0; + rtl_uString* pNewData = NULL; rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfBoolean( aBuf, b ) ); return OUString( pNewData, SAL_NO_ACQUIRE ); } @@ -2663,7 +2663,7 @@ public: */ static OUString createFromAscii( const sal_Char * value ) { - rtl_uString* pNew = 0; + rtl_uString* pNew = NULL; rtl_uString_newFromAscii( &pNew, value ); return OUString( pNew, SAL_NO_ACQUIRE ); } |