summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:24:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:43 +0100
commitda95f17cb69fe9eb18be44aaac9f71a68445e91c (patch)
tree6e46ab7b819efc6107b8acaf33e86f881992c2c9 /stoc/source/corereflection
parent374b4f349f1d1cb3b33004580ebc903d206f28ff (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I162b47199e959f97c3bed1f307225db944017e4f
Diffstat (limited to 'stoc/source/corereflection')
-rw-r--r--stoc/source/corereflection/base.hxx8
-rw-r--r--stoc/source/corereflection/crarray.cxx6
-rw-r--r--stoc/source/corereflection/crbase.cxx4
-rw-r--r--stoc/source/corereflection/crcomp.cxx10
-rw-r--r--stoc/source/corereflection/crefl.cxx12
-rw-r--r--stoc/source/corereflection/crenum.cxx2
-rw-r--r--stoc/source/corereflection/criface.cxx50
7 files changed, 46 insertions, 46 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx
index 3033479ab252..fc081a69f576 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -206,7 +206,7 @@ public:
const OUString & rName, typelib_TypeClass eTypeClass,
typelib_TypeDescription * pTypeDescr )
: IdlClassImpl( pReflection, rName, eTypeClass, pTypeDescr )
- , _pSortedMemberInit( 0 )
+ , _pSortedMemberInit( nullptr )
, _nMethods( 0 )
, _nAttributes( 0 )
{}
@@ -241,7 +241,7 @@ public:
const OUString & rName, typelib_TypeClass eTypeClass,
typelib_TypeDescription * pTypeDescr )
: IdlClassImpl( pReflection, rName, eTypeClass, pTypeDescr )
- , _pFields( 0 )
+ , _pFields( nullptr )
{}
virtual ~CompoundIdlClassImpl();
@@ -304,7 +304,7 @@ public:
const OUString & rName, typelib_TypeClass eTypeClass,
typelib_TypeDescription * pTypeDescr )
: IdlClassImpl( pReflection, rName, eTypeClass, pTypeDescr )
- , _pFields( 0 )
+ , _pFields( nullptr )
{}
virtual ~EnumIdlClassImpl();
@@ -354,7 +354,7 @@ inline bool extract(
IdlReflectionServiceImpl * pRefl )
{
rDest.clear();
- if (0 != pTo)
+ if (nullptr != pTo)
{
if (! rObj.hasValue())
return true;
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index 7d70747670f6..1241430aebcc 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -54,7 +54,7 @@ void ArrayIdlClassImpl::release() throw()
Sequence< Type > ArrayIdlClassImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static ::cppu::OTypeCollection * s_pTypes = 0;
+ static ::cppu::OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
::osl::MutexGuard aGuard( getMutexAccess() );
@@ -136,7 +136,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
}
Any aRet;
- typelib_TypeDescription * pElemTypeDescr = 0;
+ typelib_TypeDescription * pElemTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElemTypeDescr, getTypeDescr()->pType );
uno_any_destruct( &aRet, reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
uno_any_construct( &aRet, &pSeq->elements[nIndex * pElemTypeDescr->nSize],
@@ -174,7 +174,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
rArray.pData = ppSeq;
pSeq = *ppSeq;
- typelib_TypeDescription * pElemTypeDescr = 0;
+ typelib_TypeDescription * pElemTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pElemTypeDescr, getTypeDescr()->pType );
if (! coerce_assign( &pSeq->elements[nIndex * pElemTypeDescr->nSize],
diff --git a/stoc/source/corereflection/crbase.cxx b/stoc/source/corereflection/crbase.cxx
index 903f94501679..f74620bdbc5c 100644
--- a/stoc/source/corereflection/crbase.cxx
+++ b/stoc/source/corereflection/crbase.cxx
@@ -35,7 +35,7 @@ ClassNameList g_aClassNames;
::osl::Mutex & getMutexAccess()
{
- static ::osl::Mutex * s_pMutex = 0;
+ static ::osl::Mutex * s_pMutex = nullptr;
if (! s_pMutex)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
@@ -149,7 +149,7 @@ void IdlClassImpl::createObject( Any & rObj )
{
rObj.clear();
uno_any_destruct( &rObj, reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
- uno_any_construct( &rObj, 0, getTypeDescr(), 0 );
+ uno_any_construct( &rObj, nullptr, getTypeDescr(), nullptr );
}
// what TODO ????
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index e23c41f3d39f..6bf3f72092ca 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -96,7 +96,7 @@ void IdlCompFieldImpl::release() throw()
Sequence< Type > IdlCompFieldImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static ::cppu::OTypeCollection * s_pTypes = 0;
+ static ::cppu::OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
::osl::MutexGuard aGuard( getMutexAccess() );
@@ -174,7 +174,7 @@ Any IdlCompFieldImpl::get( const Any & rObj )
if (rObj.getValueTypeClass() == css::uno::TypeClass_STRUCT ||
rObj.getValueTypeClass() == css::uno::TypeClass_EXCEPTION)
{
- typelib_TypeDescription * pObjTD = 0;
+ typelib_TypeDescription * pObjTD = nullptr;
TYPELIB_DANGER_GET( &pObjTD, rObj.getValueTypeRef() );
typelib_TypeDescription * pTD = pObjTD;
@@ -207,7 +207,7 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue )
if (rObj.getValueTypeClass() == css::uno::TypeClass_STRUCT ||
rObj.getValueTypeClass() == css::uno::TypeClass_EXCEPTION)
{
- typelib_TypeDescription * pObjTD = 0;
+ typelib_TypeDescription * pObjTD = nullptr;
TYPELIB_DANGER_GET( &pObjTD, rObj.getValueTypeRef() );
typelib_TypeDescription * pTD = pObjTD;
@@ -244,7 +244,7 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue )
if (rObj.getValueTypeClass() == css::uno::TypeClass_STRUCT ||
rObj.getValueTypeClass() == css::uno::TypeClass_EXCEPTION)
{
- typelib_TypeDescription * pObjTD = 0;
+ typelib_TypeDescription * pObjTD = nullptr;
TYPELIB_DANGER_GET( &pObjTD, rObj.getValueTypeRef() );
typelib_TypeDescription * pTD = pObjTD;
@@ -366,7 +366,7 @@ Sequence< Reference< XIdlField > > CompoundIdlClassImpl::getFields()
for ( sal_Int32 nPos = pCompTypeDescr->nMembers; nPos--; )
{
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( &pTD, ppTypeRefs[nPos] );
OSL_ENSURE( pTD, "### cannot get field in struct!" );
if (pTD)
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index b97d03e38a43..fc077043f219 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -100,7 +100,7 @@ void IdlReflectionServiceImpl::release() throw()
Sequence< Type > IdlReflectionServiceImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static OTypeCollection * s_pTypes = 0;
+ static OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
MutexGuard aGuard( _aComponentMutex );
@@ -236,7 +236,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forName( const OUString & rType
else
{
// try to get _type_ by name
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
typelib_typedescription_getByName( &pTD, rTypeName.pData );
if (pTD)
{
@@ -279,7 +279,7 @@ Any IdlReflectionServiceImpl::getByHierarchicalName( const OUString & rName )
// so the second retrieving via c typelib callback chain should succeed...
// try to get _type_ by name
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
typelib_typedescription_getByName( &pTD, rName.pData );
aRet.clear(); // kick XTypeDescription interface
@@ -343,7 +343,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptio
Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptionReference * pRef )
throw(css::uno::RuntimeException)
{
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( &pTD, pRef );
if (pTD)
{
@@ -434,9 +434,9 @@ static const struct ImplementationEntry g_entries[] =
{
IdlReflectionServiceImpl_create, core_getImplementationName,
core_getSupportedServiceNames, createSingleComponentFactory,
- 0, 0
+ nullptr, 0
},
- { 0, 0, 0, 0, 0, 0 }
+ { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL reflection_component_getFactory(
diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx
index b8802908a888..5003574629e4 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -95,7 +95,7 @@ void IdlEnumFieldImpl::release() throw()
Sequence< Type > IdlEnumFieldImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static ::cppu::OTypeCollection * s_pTypes = 0;
+ static ::cppu::OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
::osl::MutexGuard aGuard( getMutexAccess() );
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx
index f84c60f5bc4b..de8e73c959c1 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -108,7 +108,7 @@ void IdlAttributeFieldImpl::release() throw()
Sequence< Type > IdlAttributeFieldImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static ::cppu::OTypeCollection * s_pTypes = 0;
+ static ::cppu::OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
::osl::MutexGuard aGuard( getMutexAccess() );
@@ -186,7 +186,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj )
uno_Any * pExc = &aExc;
void * pReturn = alloca( pTD->nSize );
- (*pUnoI->pDispatcher)( pUnoI, getTypeDescr(), pReturn, 0, &pExc );
+ (*pUnoI->pDispatcher)( pUnoI, getTypeDescr(), pReturn, nullptr, &pExc );
(*pUnoI->release)( pUnoI );
checkException(
@@ -196,7 +196,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj )
uno_any_destruct(
&aRet, reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
uno_any_constructAndConvert( &aRet, pReturn, pTD, getReflection()->getUno2Cpp().get() );
- uno_destructData( pReturn, pTD, 0 );
+ uno_destructData( pReturn, pTD, nullptr );
return aRet;
}
throw IllegalArgumentException(
@@ -253,7 +253,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
}
else
{
- typelib_TypeDescription * pValueTD = 0;
+ typelib_TypeDescription * pValueTD = nullptr;
TYPELIB_DANGER_GET( &pValueTD, rValue.getValueTypeRef() );
// construct temp uno val to do proper assignment: todo opt
void * pTemp = alloca( pValueTD->nSize );
@@ -263,9 +263,9 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
pArg, pTD );
// assignment does simple conversion
bAssign = uno_assignData(
- pArg, pTD, pTemp, pValueTD, 0, 0, 0 );
+ pArg, pTD, pTemp, pValueTD, nullptr, nullptr, nullptr );
uno_destructData(
- pTemp, pValueTD, 0 );
+ pTemp, pValueTD, nullptr );
TYPELIB_DANGER_RELEASE( pValueTD );
}
@@ -273,10 +273,10 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
{
uno_Any aExc;
uno_Any * pExc = &aExc;
- (*pUnoI->pDispatcher)( pUnoI, getTypeDescr(), 0, pArgs, &pExc );
+ (*pUnoI->pDispatcher)( pUnoI, getTypeDescr(), nullptr, pArgs, &pExc );
(*pUnoI->release)( pUnoI );
- uno_destructData( pArg, pTD, 0 );
+ uno_destructData( pArg, pTD, nullptr );
checkException(
pExc,
*static_cast< Reference< XInterface > const * >(
@@ -303,13 +303,13 @@ void IdlAttributeFieldImpl::set( const Any & rObj, const Any & rValue )
void IdlAttributeFieldImpl::checkException(
uno_Any * exception, Reference< XInterface > const & context)
{
- if (exception != 0) {
+ if (exception != nullptr) {
Any e;
uno_any_destruct(&e, reinterpret_cast< uno_ReleaseFunc >(cpp_release));
uno_type_any_constructAndConvert(
&e, exception->pData, exception->pType,
getReflection()->getUno2Cpp().get());
- uno_any_destruct(exception, 0);
+ uno_any_destruct(exception, nullptr);
if (e.isExtractableTo(
cppu::UnoType<RuntimeException>::get()))
{
@@ -344,9 +344,9 @@ public:
IdlInterfaceMethodImpl( IdlReflectionServiceImpl * pReflection, const OUString & rName,
typelib_TypeDescription * pTypeDescr, typelib_TypeDescription * pDeclTypeDescr )
: IdlMemberImpl( pReflection, rName, pTypeDescr, pDeclTypeDescr )
- , _pExceptionTypes( 0 )
- , _pParamTypes( 0 )
- , _pParamInfos( 0 )
+ , _pExceptionTypes( nullptr )
+ , _pParamTypes( nullptr )
+ , _pParamInfos( nullptr )
{}
virtual ~IdlInterfaceMethodImpl();
@@ -402,7 +402,7 @@ void IdlInterfaceMethodImpl::release() throw()
Sequence< Type > IdlInterfaceMethodImpl::getTypes()
throw (css::uno::RuntimeException, std::exception)
{
- static ::cppu::OTypeCollection * s_pTypes = 0;
+ static ::cppu::OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes)
{
::osl::MutexGuard aGuard( getMutexAccess() );
@@ -613,7 +613,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
Any * pCppArgs = rArgs.getArray();
typelib_MethodParameter * pParams = getMethodTypeDescr()->pParams;
- typelib_TypeDescription * pReturnType = 0;
+ typelib_TypeDescription * pReturnType = nullptr;
TYPELIB_DANGER_GET(
&pReturnType, getMethodTypeDescr()->pReturnTypeRef );
@@ -624,7 +624,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
// convert arguments
for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
{
- ppParamTypes[nPos] = 0;
+ ppParamTypes[nPos] = nullptr;
TYPELIB_DANGER_GET( ppParamTypes + nPos, pParams[nPos].pTypeRef );
typelib_TypeDescription * pTD = ppParamTypes[nPos];
@@ -661,7 +661,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
}
else
{
- typelib_TypeDescription * pValueTD = 0;
+ typelib_TypeDescription * pValueTD = nullptr;
TYPELIB_DANGER_GET( &pValueTD, pCppArgs[nPos].getValueTypeRef() );
// construct temp uno val to do proper assignment: todo opt
void * pTemp = alloca( pValueTD->nSize );
@@ -672,9 +672,9 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
ppUnoArgs[nPos], pTD );
// assignment does simple conversion
bAssign = uno_assignData(
- ppUnoArgs[nPos], pTD, pTemp, pValueTD, 0, 0, 0 );
+ ppUnoArgs[nPos], pTD, pTemp, pValueTD, nullptr, nullptr, nullptr );
uno_destructData(
- pTemp, pValueTD, 0 );
+ pTemp, pValueTD, nullptr );
TYPELIB_DANGER_RELEASE( pValueTD );
}
@@ -688,7 +688,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
while (nPos--)
{
if (pParams[nPos].bIn)
- uno_destructData( ppUnoArgs[nPos], ppParamTypes[nPos], 0 );
+ uno_destructData( ppUnoArgs[nPos], ppParamTypes[nPos], nullptr );
TYPELIB_DANGER_RELEASE( ppParamTypes[nPos] );
}
TYPELIB_DANGER_RELEASE( pReturnType );
@@ -713,7 +713,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
while (nParams--)
{
if (pParams[nParams].bIn)
- uno_destructData( ppUnoArgs[nParams], ppParamTypes[nParams], 0 );
+ uno_destructData( ppUnoArgs[nParams], ppParamTypes[nParams], nullptr );
TYPELIB_DANGER_RELEASE( ppParamTypes[nParams] );
}
TYPELIB_DANGER_RELEASE( pReturnType );
@@ -727,7 +727,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
uno_type_copyAndConvertData(
&aExc.TargetException, pUnoExc, cppu::UnoType<Any>::get().getTypeLibType(),
getReflection()->getUno2Cpp().get() );
- uno_any_destruct( pUnoExc, 0 );
+ uno_any_destruct( pUnoExc, nullptr );
throw aExc;
}
else
@@ -744,7 +744,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
&pCppArgs[nParams], ppUnoArgs[nParams], ppParamTypes[nParams],
getReflection()->getUno2Cpp().get() );
}
- uno_destructData( ppUnoArgs[nParams], ppParamTypes[nParams], 0 );
+ uno_destructData( ppUnoArgs[nParams], ppParamTypes[nParams], nullptr );
TYPELIB_DANGER_RELEASE( ppParamTypes[nParams] );
}
uno_any_destruct(
@@ -752,7 +752,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
uno_any_constructAndConvert(
&aRet, pUnoReturn, pReturnType,
getReflection()->getUno2Cpp().get() );
- uno_destructData( pUnoReturn, pReturnType, 0 );
+ uno_destructData( pUnoReturn, pReturnType, nullptr );
TYPELIB_DANGER_RELEASE( pReturnType );
}
return aRet;
@@ -816,7 +816,7 @@ void InterfaceIdlClassImpl::initMembers()
// attributes at the back
}
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
typelib_typedescriptionreference_getDescription( &pTD, ppAllMembers[nPos] );
assert(pTD && "### cannot get type description!");
pSortedMemberInit[nIndex].first = reinterpret_cast<typelib_InterfaceMemberTypeDescription *>(pTD)->pMemberName;