From a9b4c9ca3df362cbe0f7904003197bcadd607215 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:26:07 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I4024816e38c0196ec502a5d39b8bd50cf6b142fb --- testtools/source/bridgetest/bridgetest.cxx | 14 +++++++------- testtools/source/bridgetest/constructors.cxx | 10 +++++----- testtools/source/bridgetest/cppobj.cxx | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index f67d9abdb3c4..701415844a5e 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -214,7 +214,7 @@ namespace { template < typename T > bool testAny( T const & value, Reference< XBridgeTest > const & xLBT, - char const * typeName = 0) + char const * typeName = nullptr) { Any any; any <<= value; @@ -231,7 +231,7 @@ bool testAny( RTL_TEXTENCODING_ASCII_US).getStr()); success = false; } - if (typeName != 0 + if (typeName != nullptr && !any2.getValueType().getTypeName().equalsAscii(typeName)) { fprintf( @@ -1046,7 +1046,7 @@ uno_Sequence* cloneSequence(const uno_Sequence* val, const Type& type) sal_Int8* buf = new sal_Int8[pTdElem->nSize * val->nElements]; sal_Int8* pBufCur = buf; - uno_Sequence* retSeq = NULL; + uno_Sequence* retSeq = nullptr; switch (pTdElem->eTypeClass) { case TypeClass_SEQUENCE: @@ -1100,14 +1100,14 @@ inline bool makeSurrogate( // official: uno_getEnvironment( reinterpret_cast< uno_Environment ** >( &aCppEnv_official ), - aCppEnvTypeName.pData, 0 ); + aCppEnvTypeName.pData, nullptr ); // anonymous: uno_createEnvironment( reinterpret_cast< uno_Environment ** >( &aCppEnv_ano ), - aCppEnvTypeName.pData, 0 ); + aCppEnvTypeName.pData, nullptr ); uno_createEnvironment( reinterpret_cast< uno_Environment ** >( &aUnoEnv_ano ), - aUnoEnvTypeName.pData, 0 ); + aUnoEnvTypeName.pData, nullptr ); UnoInterfaceReference unoI; Mapping cpp2uno( aCppEnv_official.get(), aUnoEnv_ano.get() ); @@ -1261,7 +1261,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, SAL_UNUSED_PARAMETER void * ) { - void * pRet = 0; + void * pRet = nullptr; if (pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0) { diff --git a/testtools/source/bridgetest/constructors.cxx b/testtools/source/bridgetest/constructors.cxx index 7ddd9c58666b..16c1a4237cbc 100644 --- a/testtools/source/bridgetest/constructors.cxx +++ b/testtools/source/bridgetest/constructors.cxx @@ -340,9 +340,9 @@ void Impl2::initialize(css::uno::Sequence< css::uno::Any > const & arguments) && (arguments[28] >>= arg28) && arg28.member.getLength() == 1 && arg28.member[0] == 0.456 && (arguments[29] >>= arg29) && arg29.member.getLength() == 1 - && arg29.member[0] != NULL + && arg29.member[0] != nullptr && (arguments[30] >>= arg30) && arg30.member.getLength() == 1 - && arg30.member[0] != NULL + && arg30.member[0] != nullptr && (arguments[31] >>= arg31) && arg31.member.getLength() == 1 && arg31.member[0] == ttb::TestEnum_TWO && (arguments[32] >>= arg32) && arg32.member.getLength() == 1 @@ -471,10 +471,10 @@ css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames2() { ::cppu::ImplementationEntry entries[] = { { &create, &getImplementationName, &getSupportedServiceNames, - &::cppu::createSingleComponentFactory, 0, 0 }, + &::cppu::createSingleComponentFactory, nullptr, 0 }, { &create2, &getImplementationName2, &getSupportedServiceNames2, - &::cppu::createSingleComponentFactory, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } }; + &::cppu::createSingleComponentFactory, nullptr, 0 }, + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 08232f6c5943..280653bb2cd4 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -990,7 +990,7 @@ void Test_Impl::testConstructorsService( TestStruct(10), TestPolyStruct< sal_Bool >(true), TestPolyStruct< Any >(makeAny(true)), - Reference< XInterface >(0)); + Reference< XInterface >(nullptr)); Sequence< Any > args(40); args[0] <<= true; args[1] <<= SAL_MIN_INT8; @@ -1032,7 +1032,7 @@ void Test_Impl::testConstructorsService( args[36] <<= TestStruct(10); args[37] <<= TestPolyStruct< sal_Bool >(true); args[38] <<= TestPolyStruct< Any >(makeAny(true)); - args[39] <<= Reference< XInterface >(0); + args[39] <<= Reference< XInterface >(nullptr); Constructors::create2(context, args); Sequence argSeq1(1); argSeq1[0] = cppu::UnoType::get(); @@ -1183,7 +1183,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, SAL_UNUSED_PARAMETER void * pServiceManager, SAL_UNUSED_PARAMETER void * ) { - void * pRet = 0; + void * pRet = nullptr; if (pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0) { -- cgit v1.2.3