summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-06-20 14:56:16 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-21 18:20:26 +0200
commit67f3a9a48f17b09b9e56c50080040ee73f3f4ec2 (patch)
treea109d1239b6e7c9ddf764b20f5dc8b2b78a7862b /bridges
parent371ddde018459143e4b3598a68c3786f46d989fd (diff)
bridges: [loplugin:nullptr]
Change-Id: I7386569030fc95553bfb423d23d291430388992b
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx32
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/except.cxx14
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx28
3 files changed, 37 insertions, 37 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx
index e272f41ade52..f888ab49a0ba 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx
@@ -49,12 +49,12 @@ void cpp2uno_call(
char * pCppStack = reinterpret_cast<char *>(pCallStack +1);
// 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)
{
@@ -91,7 +91,7 @@ void cpp2uno_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
@@ -163,7 +163,7 @@ void 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)
@@ -189,7 +189,7 @@ void 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 );
}
@@ -201,7 +201,7 @@ void 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 eax
*static_cast< void ** >(pReturnValue) = pCppReturn;
@@ -268,7 +268,7 @@ extern "C" void cpp_vtable_call(
cpp2uno_call(
pCppI, aMemberDescr.get(),
reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(aMemberDescr.get())->pAttributeTypeRef,
- 0, 0, // no params
+ 0, nullptr, // no params
pCallStack, pReturnValue );
}
else
@@ -282,7 +282,7 @@ extern "C" void cpp_vtable_call(
cpp2uno_call(
pCppI, aMemberDescr.get(),
- 0, // indicates void return
+ nullptr, // indicates void return
1, &aParam,
pCallStack, pReturnValue );
}
@@ -301,11 +301,11 @@ extern "C" void cpp_vtable_call(
break;
case 0: // queryInterface() opt
{
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( &pTD, static_cast< Type * >( pCallStack[3] )->getTypeLibType() );
if (pTD)
{
- XInterface * pInterface = 0;
+ XInterface * pInterface = nullptr;
(*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
pCppI->getBridge()->getCppEnv(),
reinterpret_cast<void **>(&pInterface), pCppI->getOid().pData,
@@ -457,8 +457,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;
}
@@ -470,9 +470,9 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
(*slots) -= functionCount;
Slot * s = *slots;
for (sal_Int32 i = 0; i < type->nMembers; ++i) {
- typelib_TypeDescription * member = 0;
+ typelib_TypeDescription * member = nullptr;
TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
- assert(member != 0);
+ assert(member != nullptr);
switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
// Getter:
@@ -489,7 +489,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
(s++)->fn = code + writetoexecdiff;
code = codeSnippet(
code, writetoexecdiff, functionOffset++, vtableOffset,
- NULL);
+ nullptr);
}
break;
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
index feaa3945d231..4c5105dfccf8 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx
@@ -100,7 +100,7 @@ public:
};
RTTI::RTTI()
- : m_hApp( dlopen( 0, RTLD_LAZY ) )
+ : m_hApp( dlopen(nullptr, RTLD_LAZY) )
{
}
@@ -193,7 +193,7 @@ extern "C" {
static void _GLIBCXX_CDTOR_CALLABI 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!!!");
@@ -219,7 +219,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)
@@ -233,9 +233,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() );
@@ -274,14 +274,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_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
index d69e25256d89..9365f84cb308 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
@@ -50,11 +50,11 @@ static void cpp_call(
char * pCppStackStart = pCppStack;
// return
- typelib_TypeDescription * pReturnTypeDescr = 0;
+ typelib_TypeDescription * pReturnTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
assert(pReturnTypeDescr);
- void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
+ void * pCppReturn = nullptr; // if != 0 && != pUnoReturn, needs reconversion
bool bSimpleReturn = true;
if (pReturnTypeDescr)
@@ -95,7 +95,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
@@ -160,7 +160,7 @@ static void cpp_call(
pCppReturn, pReturnTypeDescr, bSimpleReturn,
reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
// NO exception occurred...
- *ppUnoExc = 0;
+ *ppUnoExc = nullptr;
// reconvert temporary params
for ( ; nTempIndices--; )
@@ -172,7 +172,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() );
}
@@ -277,7 +277,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
@@ -289,7 +289,7 @@ void unoInterfaceProxyDispatch(
aParam.bIn = true;
aParam.bOut = false;
- typelib_TypeDescriptionReference * pReturnTypeRef = 0;
+ typelib_TypeDescriptionReference * pReturnTypeRef = nullptr;
OUString aVoidName("void");
typelib_typedescriptionreference_new(
&pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
@@ -319,19 +319,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->pBridge->getUnoEnv()->getRegisteredInterface)(
pThis->pBridge->getUnoEnv(),
reinterpret_cast<void **>(&pInterface), pThis->oid.pData, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) );
@@ -340,10 +340,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 );
@@ -369,7 +369,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 );
}
}
}