diff options
author | Florian Becker <fb@vxapps.com> | 2021-09-19 22:33:50 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2021-10-01 01:55:43 +0800 |
commit | 3836794be3e10b8a65f666f07fa721c7ea205a17 (patch) | |
tree | 1c133941eaa296f48f9231074258e64f27e14b13 /src | |
parent | 942992e8abbe00aad7d0671671124a046cae2cda (diff) |
Replace NULL with nullptr
Diffstat (limited to 'src')
-rw-r--r-- | src/DllPlugInTester/CommandLineParserTest.cpp | 24 | ||||
-rw-r--r-- | src/cppunit/DynamicLibraryManager.cpp | 12 | ||||
-rw-r--r-- | src/cppunit/PlugInManager.cpp | 2 | ||||
-rw-r--r-- | src/cppunit/TestFactoryRegistry.cpp | 2 | ||||
-rw-r--r-- | src/cppunit/TestFailure.cpp | 2 | ||||
-rw-r--r-- | src/cppunit/TestLeaf.cpp | 2 | ||||
-rw-r--r-- | src/cppunit/Win32DynamicLibraryManager.cpp | 6 | ||||
-rw-r--r-- | src/cppunit/XmlElement.cpp | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/src/DllPlugInTester/CommandLineParserTest.cpp b/src/DllPlugInTester/CommandLineParserTest.cpp index 2ee2a52..ecdb12f 100644 --- a/src/DllPlugInTester/CommandLineParserTest.cpp +++ b/src/DllPlugInTester/CommandLineParserTest.cpp @@ -17,7 +17,7 @@ CommandLineParserTest::~CommandLineParserTest() void CommandLineParserTest::setUp() { - _parser = NULL; + _parser = nullptr; } @@ -32,7 +32,7 @@ void CommandLineParserTest::parse( const char **lines ) { int count =0; - for ( const char **line = lines; *line != NULL; ++line, ++count ) + for ( const char **line = lines; *line != nullptr; ++line, ++count ) ; delete _parser; @@ -44,7 +44,7 @@ CommandLineParserTest::parse( const char **lines ) void CommandLineParserTest::testEmptyCommandLine() { - static const char *lines[] = { "", NULL }; + static const char *lines[] = { "", nullptr }; parse( lines ); std::string none; @@ -64,7 +64,7 @@ CommandLineParserTest::testEmptyCommandLine() void CommandLineParserTest::testFlagCompiler() { - static const char *lines[] = { "", "-c", NULL }; + static const char *lines[] = { "", "-c", nullptr }; parse( lines ); std::string none; @@ -85,7 +85,7 @@ CommandLineParserTest::testFlagCompiler() void CommandLineParserTest::testLongFlagBriefProgress() { - static const char *lines[] = { "", "--brief-progress", NULL }; + static const char *lines[] = { "", "--brief-progress", nullptr }; parse( lines ); std::string none; @@ -106,7 +106,7 @@ CommandLineParserTest::testLongFlagBriefProgress() void CommandLineParserTest::testFileName() { - static const char *lines[] = { "", "TestPlugIn.dll", NULL }; + static const char *lines[] = { "", "TestPlugIn.dll", nullptr }; parse( lines ); std::string none; @@ -132,7 +132,7 @@ CommandLineParserTest::testFileName() void CommandLineParserTest::testTestPath() { - static const char *lines[] = { "", ":Core", NULL }; + static const char *lines[] = { "", ":Core", nullptr }; parse( lines ); std::string none; @@ -153,7 +153,7 @@ CommandLineParserTest::testTestPath() void CommandLineParserTest::testParameterWithSpace() { - static const char *lines[] = { "", "--xml", "Test Results.xml", NULL }; + static const char *lines[] = { "", "--xml", "Test Results.xml", nullptr }; parse( lines ); std::string none; @@ -175,7 +175,7 @@ CommandLineParserTest::testParameterWithSpace() void CommandLineParserTest::testMissingStyleSheetParameterThrow() { - static const char *lines[] = { "", "--xsl", NULL }; + static const char *lines[] = { "", "--xsl", nullptr }; parse( lines ); } @@ -183,7 +183,7 @@ CommandLineParserTest::testMissingStyleSheetParameterThrow() void CommandLineParserTest::testMissingEncodingParameterThrow() { - static const char *lines[] = { "", "--encoding", NULL }; + static const char *lines[] = { "", "--encoding", nullptr }; parse( lines ); } @@ -191,7 +191,7 @@ CommandLineParserTest::testMissingEncodingParameterThrow() void CommandLineParserTest::testXmlFileNameIsOptional() { - static const char *lines[] = { "", "--xml", NULL }; + static const char *lines[] = { "", "--xml", nullptr }; parse( lines ); std::string none; @@ -203,7 +203,7 @@ void CommandLineParserTest::testPlugInsWithParameters() { static const char *lines[] = { "", "TestPlugIn1.dll=login = lain", - "Clocker.dll", NULL }; + "Clocker.dll", nullptr }; parse( lines ); CPPUNIT_ASSERT_EQUAL( 2, _parser->getPlugInCount() ); diff --git a/src/cppunit/DynamicLibraryManager.cpp b/src/cppunit/DynamicLibraryManager.cpp index e6f6294..9471870 100644 --- a/src/cppunit/DynamicLibraryManager.cpp +++ b/src/cppunit/DynamicLibraryManager.cpp @@ -7,7 +7,7 @@ CPPUNIT_NS_BEGIN DynamicLibraryManager::DynamicLibraryManager( const std::string &libraryFileName ) - : m_libraryHandle( NULL ) + : m_libraryHandle( nullptr ) , m_libraryName( libraryFileName ) { loadLibrary( libraryFileName ); @@ -26,7 +26,7 @@ DynamicLibraryManager::findSymbol( const std::string &symbol ) try { Symbol symbolPointer = doFindSymbol( symbol ); - if ( symbolPointer != NULL ) + if ( symbolPointer != nullptr ) return symbolPointer; } catch ( ... ) @@ -36,7 +36,7 @@ DynamicLibraryManager::findSymbol( const std::string &symbol ) throw DynamicLibraryManagerException( m_libraryName, symbol, DynamicLibraryManagerException::symbolNotFound ); - return NULL; // keep compiler happy + return nullptr; // keep compiler happy } @@ -47,7 +47,7 @@ DynamicLibraryManager::loadLibrary( const std::string &libraryName ) { releaseLibrary(); m_libraryHandle = doLoadLibrary( libraryName ); - if ( m_libraryHandle != NULL ) + if ( m_libraryHandle != nullptr ) return; } catch (...) @@ -63,10 +63,10 @@ DynamicLibraryManager::loadLibrary( const std::string &libraryName ) void DynamicLibraryManager::releaseLibrary() { - if ( m_libraryHandle != NULL ) + if ( m_libraryHandle != nullptr ) { doReleaseLibrary(); - m_libraryHandle = NULL; + m_libraryHandle = nullptr; } } diff --git a/src/cppunit/PlugInManager.cpp b/src/cppunit/PlugInManager.cpp index 4f8b371..80ac89f 100644 --- a/src/cppunit/PlugInManager.cpp +++ b/src/cppunit/PlugInManager.cpp @@ -85,7 +85,7 @@ PlugInManager::unload( PlugInInfo &plugIn ) catch (...) { delete plugIn.m_manager; - plugIn.m_manager = NULL; + plugIn.m_manager = nullptr; throw; } } diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp index f1623cc..35448a6 100644 --- a/src/cppunit/TestFactoryRegistry.cpp +++ b/src/cppunit/TestFactoryRegistry.cpp @@ -70,7 +70,7 @@ public: // validity beforehand using TestFactoryRegistry::isValid() beforehand. assert( isValid() ); if ( !isValid() ) // release mode - return NULL; // => force CRASH + return nullptr; // => force CRASH return getInstance()->getInternalRegistry( name ); } diff --git a/src/cppunit/TestFailure.cpp b/src/cppunit/TestFailure.cpp index e31e138..63b98d7 100644 --- a/src/cppunit/TestFailure.cpp +++ b/src/cppunit/TestFailure.cpp @@ -29,7 +29,7 @@ TestFailure::failedTest() const } -/// Gets the thrown exception. Never \c NULL. +/// Gets the thrown exception. Never \c nullptr. Exception * TestFailure::thrownException() const { diff --git a/src/cppunit/TestLeaf.cpp b/src/cppunit/TestLeaf.cpp index 3d8767c..f4e1a93 100644 --- a/src/cppunit/TestLeaf.cpp +++ b/src/cppunit/TestLeaf.cpp @@ -22,7 +22,7 @@ Test * TestLeaf::doGetChildTestAt( int index ) const { checkIsValidIndex( index ); - return NULL; // never called, checkIsValidIndex() always throw. + return nullptr; // never called, checkIsValidIndex() always throw. } CPPUNIT_NS_END diff --git a/src/cppunit/Win32DynamicLibraryManager.cpp b/src/cppunit/Win32DynamicLibraryManager.cpp index 5dac4fa..81f9ee2 100644 --- a/src/cppunit/Win32DynamicLibraryManager.cpp +++ b/src/cppunit/Win32DynamicLibraryManager.cpp @@ -49,18 +49,18 @@ DynamicLibraryManager::getLastErrorDetail() const FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, + nullptr, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPSTR) &lpMsgBuf, 0, - NULL + nullptr ); std::string message = (LPCSTR)lpMsgBuf; // Display the string. -// ::MessageBoxA( NULL, (LPCSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION ); +// ::MessageBoxA( nullptr, (LPCSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION ); // Free the buffer. ::LocalFree( lpMsgBuf ); diff --git a/src/cppunit/XmlElement.cpp b/src/cppunit/XmlElement.cpp index b16d2fe..691cde1 100644 --- a/src/cppunit/XmlElement.cpp +++ b/src/cppunit/XmlElement.cpp @@ -124,7 +124,7 @@ XmlElement::elementFor( const std::string &name ) const } throw std::invalid_argument( "XmlElement::elementFor(), not matching child element found" ); - return NULL; // make some compilers happy. + return nullptr; // make some compilers happy. } |