diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:18:48 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:20:34 +0100 |
commit | 520cd4e6886db99b6dd47527871f0d573933da8d (patch) | |
tree | 5fd079a770309a6de1647789935699d997032449 /bridges | |
parent | loplugin:nullptr (automatic rewrite; Mac-specific code) (diff) | |
download | core-520cd4e6886db99b6dd47527871f0d573933da8d.tar.gz core-520cd4e6886db99b6dd47527871f0d573933da8d.zip |
loplugin:nullptr (automatic rewrite; Mac-specific code)
Change-Id: If07e4116c43cbddefbf443c4cbd754dde48c90a0
Diffstat (limited to 'bridges')
6 files changed, 40 insertions, 40 deletions
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx index 36de6daa6f14..6e7e18579af8 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx @@ -179,7 +179,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: { - typelib_TypeDescription * pTypeDescr = 0; + typelib_TypeDescription * pTypeDescr = nullptr; TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); const int UNITS_PER_WORD = 8; diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx index f08e9a7f78c0..5e2b30ff551f 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx @@ -67,12 +67,12 @@ static typelib_TypeClass cpp2uno_call( unsigned int nr_fpr = 0; //number of fpr registers used // return - typelib_TypeDescription * pReturnTypeDescr = 0; + typelib_TypeDescription * pReturnTypeDescr = nullptr; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - void * pUnoReturn = 0; - void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need + void * pUnoReturn = nullptr; + void * pCppReturn = nullptr; // complex return ptr: if != 0 && != pUnoReturn, reconversion need if ( pReturnTypeDescr ) { @@ -142,7 +142,7 @@ static typelib_TypeClass cpp2uno_call( } else // struct <= 16 bytes || ptr to complex value || ref { - typelib_TypeDescription * pParamTypeDescr = 0; + typelib_TypeDescription * pParamTypeDescr = nullptr; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); void *pCppStack; @@ -196,7 +196,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 nIndex = pTempIndices[nTempIndices]; if (pParams[nIndex].bIn) // is in/inout => was constructed - uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], 0 ); + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], nullptr ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] ); } if (pReturnTypeDescr) @@ -222,7 +222,7 @@ static typelib_TypeClass cpp2uno_call( pThis->getBridge()->getUno2Cpp() ); } // destroy temp uno param - uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, nullptr ); TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } @@ -234,7 +234,7 @@ static typelib_TypeClass cpp2uno_call( uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() ); // destroy temp uno return - uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); + uno_destructData( pUnoReturn, pReturnTypeDescr, nullptr ); } // complex return ptr is set to return reg *reinterpret_cast<void **>(pRegisterReturn) = pCppReturn; @@ -307,7 +307,7 @@ typelib_TypeClass cpp_vtable_call( { // is GET method eRet = cpp2uno_call( pCppI, aMemberDescr.get(), pAttrTypeRef, - 0, 0, // no params + 0, nullptr, // no params gpreg, fpreg, ovrflw, pRegisterReturn ); } else @@ -319,7 +319,7 @@ typelib_TypeClass cpp_vtable_call( aParam.bOut = sal_False; eRet = cpp2uno_call( pCppI, aMemberDescr.get(), - 0, // indicates void return + nullptr, // indicates void return 1, &aParam, gpreg, fpreg, ovrflw, pRegisterReturn ); } @@ -340,11 +340,11 @@ typelib_TypeClass cpp_vtable_call( break; case 0: // queryInterface() opt { - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; TYPELIB_DANGER_GET( &pTD, static_cast<Type *>( gpreg[2] )->getTypeLibType() ); if ( pTD ) { - XInterface * pInterface = 0; + XInterface * pInterface = nullptr; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface) ( pCppI->getBridge()->getCppEnv(), reinterpret_cast<void **>(&pInterface), @@ -451,8 +451,8 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock( typelib_InterfaceTypeDescription *) { Slot * slots = mapBlockToVtable(block); - slots[-2].fn = 0; - slots[-1].fn = 0; + slots[-2].fn = nullptr; + slots[-1].fn = nullptr; return slots + slotCount; } @@ -468,7 +468,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( Slot * s = *slots; for ( sal_Int32 nPos = 0; nPos < type->nMembers; ++nPos ) { - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; TYPELIB_DANGER_GET( &pTD, type->ppMembers[ nPos ] ); assert(pTD); diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx index bf9a7bf94d73..04a37f912314 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx @@ -159,7 +159,7 @@ public: }; RTTI::RTTI() - : m_hApp( dlopen( 0, RTLD_LAZY ) ) + : m_hApp( dlopen( nullptr, RTLD_LAZY ) ) { } @@ -214,7 +214,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) // symbol and rtti-name is nearly identical, // the symbol is prefixed with _ZTI char * rttiName = strdup(symName.getStr() + 4); - if (rttiName == 0) { + if (rttiName == nullptr) { throw std::bad_alloc(); } #if OSL_DEBUG_LEVEL > 1 @@ -256,7 +256,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) static void deleteException( void * pExc ) { __cxa_exception const * header = static_cast<__cxa_exception const *>(pExc) - 1; - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; OUString unoName( toUNOname( header->exceptionType->name() ) ); ::typelib_typedescription_getByName( &pTD, unoName.pData ); assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!"); @@ -281,7 +281,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) { // construct cpp exception object - typelib_TypeDescription * pTypeDescr = 0; + typelib_TypeDescription * pTypeDescr = nullptr; TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType ); assert(pTypeDescr); if (! pTypeDescr) @@ -295,9 +295,9 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); // destruct uno exception - ::uno_any_destruct( pUnoExc, 0 ); + ::uno_any_destruct( pUnoExc, nullptr ); // avoiding locked counts - static RTTI * s_rtti = 0; + static RTTI * s_rtti = nullptr; if (! s_rtti) { MutexGuard guard( Mutex::getGlobalMutex() ); @@ -336,14 +336,14 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping return; } - typelib_TypeDescription * pExcTypeDescr = 0; + typelib_TypeDescription * pExcTypeDescr = nullptr; OUString unoName( toUNOname( header->exceptionType->name() ) ); #if OSL_DEBUG_LEVEL > 1 OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) ); fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() ); #endif typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); - if (0 == pExcTypeDescr) + if (nullptr == pExcTypeDescr) { RuntimeException aRE( "exception type not found: " + unoName ); Type const & rType = cppu::UnoType<decltype(aRE)>::get(); diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx index 6516fcd64493..718bac16a7f4 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx @@ -96,7 +96,7 @@ void INSERT_INT8( } void appendCString(OUStringBuffer & buffer, char const * text) { - if (text != 0) { + if (text != nullptr) { buffer.append( OStringToOUString(OString(text), RTL_TEXTENCODING_ISO_8859_1)); // use 8859-1 to avoid conversion failure @@ -124,11 +124,11 @@ static void cpp_call( sal_uInt32 nFPR = 0; // Return - typelib_TypeDescription * pReturnTypeDescr = 0; + typelib_TypeDescription * pReturnTypeDescr = nullptr; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); assert(pReturnTypeDescr); - void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion (see below) + void * pCppReturn = nullptr; // if != 0 && != pUnoReturn, needs reconversion (see below) bool bSimpleReturn = true; if ( pReturnTypeDescr ) @@ -163,7 +163,7 @@ static void cpp_call( for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; - typelib_TypeDescription * pParamTypeDescr = 0; + typelib_TypeDescription * pParamTypeDescr = nullptr; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) @@ -258,7 +258,7 @@ static void cpp_call( throw RuntimeException("C++ code threw unknown exception"); } - *ppUnoExc = 0; + *ppUnoExc = nullptr; // reconvert temporary params for ( ; nTempIndices--; ) @@ -270,7 +270,7 @@ static void cpp_call( { if (pParams[nIndex].bOut) // inout { - uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, nullptr ); // destroy uno value uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, pThis->getBridge()->getCpp2Uno() ); } @@ -347,7 +347,7 @@ void unoInterfaceProxyDispatch( cpp_call( pThis, aVtableSlot, reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>(pMemberDescr)->pAttributeTypeRef, - 0, 0, // no params + 0, nullptr, // no params pReturn, pArgs, ppException ); } else @@ -359,7 +359,7 @@ void unoInterfaceProxyDispatch( aParam.bIn = sal_True; aParam.bOut = sal_False; - typelib_TypeDescriptionReference * pReturnTypeRef = 0; + typelib_TypeDescriptionReference * pReturnTypeRef = nullptr; OUString aVoidName("void"); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); @@ -395,19 +395,19 @@ void unoInterfaceProxyDispatch( // standard calls case 1: // acquire uno interface (*pUnoI->acquire)( pUnoI ); - *ppException = 0; + *ppException = nullptr; break; case 2: // release uno interface (*pUnoI->release)( pUnoI ); - *ppException = 0; + *ppException = nullptr; break; case 0: // queryInterface() opt { - typelib_TypeDescription * pTD = 0; + typelib_TypeDescription * pTD = nullptr; TYPELIB_DANGER_GET( &pTD, static_cast< Type * >( pArgs[0] )->getTypeLibType() ); if (pTD) { - uno_Interface * pInterface = 0; + uno_Interface * pInterface = nullptr; (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)( pThis->getBridge()->getUnoEnv(), reinterpret_cast<void **>(&pInterface), pThis->oid.pData, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) ); @@ -416,10 +416,10 @@ void unoInterfaceProxyDispatch( { ::uno_any_construct( static_cast< uno_Any * >( pReturn ), - &pInterface, pTD, 0 ); + &pInterface, pTD, nullptr ); (*pInterface->release)( pInterface ); TYPELIB_DANGER_RELEASE( pTD ); - *ppException = 0; + *ppException = nullptr; break; } TYPELIB_DANGER_RELEASE( pTD ); @@ -444,7 +444,7 @@ void unoInterfaceProxyDispatch( Type const & rExcType = cppu::UnoType<decltype(aExc)>::get(); // binary identical null reference - ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); + ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), nullptr ); } } } diff --git a/bridges/source/cpp_uno/shared/component.cxx b/bridges/source/cpp_uno/shared/component.cxx index f27c6ec10b9e..02b683861c66 100644 --- a/bridges/source/cpp_uno/shared/component.cxx +++ b/bridges/source/cpp_uno/shared/component.cxx @@ -42,7 +42,7 @@ namespace bridges { namespace cpp_uno { namespace shared { namespace { #if (defined(__GNUC__) && defined(__APPLE__)) -static OUString * s_pStaticOidPart = 0; +static OUString * s_pStaticOidPart = nullptr; #endif const OUString & SAL_CALL cppu_cppenv_getStaticOIdPart() diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 893cbfe8878e..94da94d009ac 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -314,7 +314,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const { block.size = getBlockSize(slotCount); block.start = rtl_arena_alloc(m_arena, &block.size); - return block.start != 0; + return block.start != nullptr; } void VtableFactory::freeBlock(Block const & block) const { |