From e7f330fa4aad63873a552e84bfdbf6452832b007 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 20 Apr 2016 17:15:51 +0200 Subject: loplugin:salbool: Automatic rewrite of sal_False/True Change-Id: I47acc5590a935c7f9089231efbb1319664942f16 --- .../source/helper/purpenv/helper_purpenv_Proxy.cxx | 4 +-- cppu/source/threadpool/current.cxx | 24 ++++++++-------- cppu/source/threadpool/threadident.cxx | 4 +-- cppu/source/typelib/static_types.cxx | 16 +++++------ cppu/source/typelib/typelib.cxx | 32 +++++++++++----------- cppu/source/uno/constr.hxx | 2 +- cppu/source/uno/copy.hxx | 2 +- cppu/source/uno/data.cxx | 8 +++--- 8 files changed, 46 insertions(+), 46 deletions(-) (limited to 'cppu/source') diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx index 2c0b789de0fb..5067a2f3be4c 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx @@ -141,8 +141,8 @@ extern "C" { static void SAL_CALL s_Proxy_dispatch( { param.pTypeRef = reinterpret_cast( pMemberType)->pAttributeTypeRef; - param.bIn = sal_True; - param.bOut = sal_False; + param.bIn = true; + param.bOut = false; nParams = 1; pParams = ¶m; } diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index 6eaed4dec760..eafb0bbb0705 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.cxx @@ -73,15 +73,15 @@ static typelib_InterfaceTypeDescription * get_type_XCurrentContext() aParameters[0].pParamName = sParamName0.pData; aParameters[0].eTypeClass = typelib_TypeClass_STRING; aParameters[0].pTypeName = sParamType0.pData; - aParameters[0].bIn = sal_True; - aParameters[0].bOut = sal_False; + aParameters[0].bIn = true; + aParameters[0].bOut = false; rtl_uString * pExceptions[1]; OUString sExceptionName0("com.sun.star.uno.RuntimeException"); pExceptions[0] = sExceptionName0.pData; OUString sReturnType0("any"); typelib_typedescription_newInterfaceMethod( &pMethod, - 3, sal_False, + 3, false, sMethodName0.pData, typelib_TypeClass_ANY, sReturnType0.pData, 1, aParameters, 1, pExceptions ); @@ -212,15 +212,15 @@ extern "C" sal_Bool SAL_CALL uno_setCurrentContext( else { (*pEnv->release)( pEnv ); - return sal_False; + return false; } } else { - return sal_False; + return false; } } - return sal_True; + return true; } extern "C" sal_Bool SAL_CALL uno_getCurrentContext( @@ -238,11 +238,11 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( target_env = Environment(rtl::OUString(pEnvTypeName), pEnvContext); OSL_ASSERT( target_env.is() ); if (! target_env.is()) - return sal_False; + return false; uno_ExtEnvironment * pEnv = target_env.get()->pExtEnv; OSL_ASSERT( nullptr != pEnv ); if (nullptr == pEnv) - return sal_False; + return false; (*pEnv->releaseInterface)( pEnv, *ppCurrentContext ); *ppCurrentContext = nullptr; @@ -250,24 +250,24 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( // case: null-ref if (nullptr == pId->pCurrentContext) - return sal_True; + return true; if (! target_env.is()) { target_env = Environment(rtl::OUString(pEnvTypeName), pEnvContext); OSL_ASSERT( target_env.is() ); if (! target_env.is()) - return sal_False; + return false; } Mapping mapping(&pId->pCurrentContextEnv->aBase, target_env.get()); OSL_ASSERT( mapping.is() ); if (! mapping.is()) - return sal_False; + return false; mapping.mapInterface(ppCurrentContext, pId->pCurrentContext, ::cppu::get_type_XCurrentContext() ); - return sal_True; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx index 87daa491342c..a9b1dcefd623 100644 --- a/cppu/source/threadpool/threadident.cxx +++ b/cppu/source/threadpool/threadident.cxx @@ -117,11 +117,11 @@ extern "C" sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId } else { - return sal_False; + return false; } } - return sal_True; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx index 2611ad4f7dab..2d8aa12e3478 100644 --- a/cppu/source/typelib/static_types.cxx +++ b/cppu/source/typelib/static_types.cxx @@ -236,26 +236,26 @@ typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass( aParameters[0].pParamName = sParamName0.pData; aParameters[0].eTypeClass = typelib_TypeClass_TYPE; aParameters[0].pTypeName = sParamType0.pData; - aParameters[0].bIn = sal_True; - aParameters[0].bOut = sal_False; + aParameters[0].bIn = true; + aParameters[0].bOut = false; rtl_uString * pExceptions[1]; OUString sExceptionName0("com.sun.star.uno.RuntimeException"); pExceptions[0] = sExceptionName0.pData; OUString sReturnType0("any"); typelib_typedescription_newInterfaceMethod( - &pMethod, 0, sal_False, sMethodName0.pData, + &pMethod, 0, false, sMethodName0.pData, typelib_TypeClass_ANY, sReturnType0.pData, 1, aParameters, 1, pExceptions ); ::typelib_typedescription_register( reinterpret_cast(&pMethod) ); OUString sReturnType1("void"); ::typelib_typedescription_newInterfaceMethod( - &pMethod, 1, sal_True, sMethodName1.pData, + &pMethod, 1, true, sMethodName1.pData, typelib_TypeClass_VOID, sReturnType1.pData, 0, nullptr, 0, nullptr ); ::typelib_typedescription_register( reinterpret_cast(&pMethod) ); ::typelib_typedescription_newInterfaceMethod( - &pMethod, 2, sal_True, sMethodName2.pData, + &pMethod, 2, true, sMethodName2.pData, typelib_TypeClass_VOID, sReturnType1.pData, 0, nullptr, 0, nullptr ); ::typelib_typedescription_register( reinterpret_cast(&pMethod) ); @@ -400,7 +400,7 @@ void init( // sizeof(void) not allowed pReg->nSize = ::typelib_typedescription_getAlignedUnoSize( pReg, 0, pReg->nAlignment ); pReg->nAlignment = adjustAlignment( pReg->nAlignment ); - pReg->bComplete = sal_False; + pReg->bComplete = false; ::typelib_typedescription_register( &pReg ); *ppRef = reinterpret_cast(pReg); @@ -498,7 +498,7 @@ void SAL_CALL typelib_static_mi_interface_type_init( pReg->nSize = ::typelib_typedescription_getAlignedUnoSize( pReg, 0, pReg->nAlignment ); pReg->nAlignment = adjustAlignment( pReg->nAlignment ); - pReg->bComplete = sal_False; + pReg->bComplete = false; ::typelib_typedescription_register( &pReg ); *ppRef = reinterpret_cast(pReg); @@ -538,7 +538,7 @@ void SAL_CALL typelib_static_enum_type_init( // sizeof(void) not allowed pReg->nSize = ::typelib_typedescription_getAlignedUnoSize( pReg, 0, pReg->nAlignment ); pReg->nAlignment = ::adjustAlignment( pReg->nAlignment ); - pReg->bComplete = sal_False; + pReg->bComplete = false; ::typelib_typedescription_register( &pReg ); *ppRef = reinterpret_cast(pReg); diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index e84e5ce53cc3..f19a48a69c7f 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -280,7 +280,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() if( pTDR->pType && !pTDR->pType->bOnDemand ) { - pTDR->pType->bOnDemand = sal_True; + pTDR->pType->bOnDemand = true; typelib_typedescription_release( pTDR->pType ); } typelib_typedescriptionreference_release( pTDR ); @@ -429,7 +429,7 @@ static inline void typelib_typedescription_initTables( } // must be the last action after all initialization is done pITD->nMapFunctionIndexToMemberIndex = pITD->nAllMembers + nAdditionalOffset; - pTD->bComplete = sal_True; + pTD->bComplete = true; } } @@ -490,7 +490,7 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { OSL_ASSERT( typelib_TypeClass_TYPEDEF != pTD->eTypeClass ); // typedescription found // set to on demand - pTD->bOnDemand = sal_True; + pTD->bOnDemand = true; if (pTD->eTypeClass == typelib_TypeClass_INTERFACE && !pTD->bComplete && initTables) @@ -499,7 +499,7 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { OSL_ASSERT( reinterpret_cast(pTD)->ppAllMembers ); // complete except of tables init typelib_typedescription_initTables( pTD ); - pTD->bComplete = sal_True; + pTD->bComplete = true; } // The type description is hold by the reference until @@ -694,11 +694,11 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty( pRet->pReserved = nullptr; rtl_uString_acquire( pRet->pTypeName = pTypeName ); pRet->pSelf = pRet; - pRet->bComplete = sal_True; + pRet->bComplete = true; pRet->nSize = 0; pRet->nAlignment = 0; pRet->pWeakRef = nullptr; - pRet->bOnDemand = sal_False; + pRet->bOnDemand = false; *ppRet = pRet; } @@ -1074,7 +1074,7 @@ extern "C" void SAL_CALL typelib_typedescription_newMIInterface( pTmp->pWeakRef = reinterpret_cast(pTmp); pTmp->nSize = typelib_typedescription_getAlignedUnoSize( pTmp, 0, pTmp->nAlignment ); pTmp->nAlignment = adjustAlignment( pTmp->nAlignment ); - pTmp->bComplete = sal_False; + pTmp->bComplete = false; *ppRet = pITD; } @@ -2021,7 +2021,7 @@ extern "C" void SAL_CALL typelib_typedescription_getByName( else { // set to on demand - (*ppRet)->bOnDemand = sal_True; + (*ppRet)->bOnDemand = true; // The type description is hold by the reference until // on demand is activated. typelib_typedescription_register( ppRet ); @@ -2079,7 +2079,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_new( else { // set to on demand - pRet->bOnDemand = sal_True; + pRet->bOnDemand = true; // The type description is hold by the reference until // on demand is activated. typelib_typedescription_register( &pRet ); @@ -2135,8 +2135,8 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_new( { typelib_typedescription_newEmpty( reinterpret_cast(ppTDR), eTypeClass, pTypeName ); // description will be registered but not acquired - (*reinterpret_cast(ppTDR))->bOnDemand = sal_True; - (*reinterpret_cast(ppTDR))->bComplete = sal_False; + (*reinterpret_cast(ppTDR))->bOnDemand = true; + (*reinterpret_cast(ppTDR))->bComplete = false; } if( !rInit.pWeakMap ) @@ -2349,12 +2349,12 @@ extern "C" sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom( typelib_TypeClass eFrom = pFrom->eTypeClass; if (eAssignable == typelib_TypeClass_ANY) // anything can be assigned to an any .) - return sal_True; + return true; if (eAssignable == eFrom) { if (type_equals( pAssignable, pFrom )) // first shot { - return sal_True; + return true; } else { @@ -2368,7 +2368,7 @@ extern "C" sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom( if (!reinterpret_cast(pFromDescr)->pBaseTypeDescription) { TYPELIB_DANGER_RELEASE( pFromDescr ); - return sal_False; + return false; } bool bRet = typelib_typedescriptionreference_isAssignableFrom( pAssignable, @@ -2398,7 +2398,7 @@ extern "C" sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom( } default: { - return sal_False; + return false; } } } @@ -2407,7 +2407,7 @@ extern "C" sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom( eFrom >= typelib_TypeClass_CHAR && eFrom <= typelib_TypeClass_DOUBLE && s_aAssignableFromTab[eAssignable-1][eFrom-1]); } - return sal_False; + return false; } extern "C" sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom( diff --git a/cppu/source/uno/constr.hxx b/cppu/source/uno/constr.hxx index 1b77ce4e6d18..8c15a6fb0142 100644 --- a/cppu/source/uno/constr.hxx +++ b/cppu/source/uno/constr.hxx @@ -64,7 +64,7 @@ inline void _defaultConstructData( *static_cast(pMem) = '\0'; break; case typelib_TypeClass_BOOLEAN: - *static_cast(pMem) = sal_False; + *static_cast(pMem) = false; break; case typelib_TypeClass_BYTE: *static_cast(pMem) = 0; diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx index 1e132c06ac87..b6ecb3036577 100644 --- a/cppu/source/uno/copy.hxx +++ b/cppu/source/uno/copy.hxx @@ -275,7 +275,7 @@ inline void _copyConstructAny( break; case typelib_TypeClass_BOOLEAN: pDestAny->pData = &pDestAny->pReserved; - *static_cast(pDestAny->pData) = sal_False; + *static_cast(pDestAny->pData) = false; break; case typelib_TypeClass_BYTE: pDestAny->pData = &pDestAny->pReserved; diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx index 2104280fa903..d351dcf6ae6f 100644 --- a/cppu/source/uno/data.cxx +++ b/cppu/source/uno/data.cxx @@ -296,19 +296,19 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData( SAL_THROW_EXTERN_C() { if (::typelib_typedescriptionreference_isAssignableFrom( pAssignable, pFromType )) - return sal_True; + return true; if (typelib_TypeClass_INTERFACE != pFromType->eTypeClass || typelib_TypeClass_INTERFACE != pAssignable->eTypeClass) { - return sal_False; + return false; } // query if (nullptr == pFrom) - return sal_False; + return false; void * pInterface = *static_cast(pFrom); if (nullptr == pInterface) - return sal_False; + return false; if (nullptr == queryInterface) queryInterface = binuno_queryInterface; -- cgit