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/cppunit | |
| parent | 942992e8abbe00aad7d0671671124a046cae2cda (diff) | |
| download | cppunit-3836794be3e10b8a65f666f07fa721c7ea205a17.tar.gz | |
Replace NULL with nullptr
Diffstat (limited to 'src/cppunit')
| -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 |
7 files changed, 14 insertions, 14 deletions
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. } |
