Use nullptr instead of NULL in the code and documentation

This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
This commit is contained in:
Vadim Zeitlin 2022-10-16 01:24:34 +02:00
parent 39ea524943
commit 4f4c5fcfdf
1844 changed files with 13721 additions and 13734 deletions

View file

@ -82,11 +82,11 @@ TEST_CASE("FTP", "[net][.]")
// test RETR
wxInputStream *in1 = ftp.GetInputStream("bloordyblop");
CPPUNIT_ASSERT( in1 == NULL );
CPPUNIT_ASSERT( in1 == nullptr );
delete in1;
wxInputStream *in2 = ftp.GetInputStream(valid_filename);
CPPUNIT_ASSERT( in2 != NULL );
CPPUNIT_ASSERT( in2 != nullptr );
size_t size = in2->GetSize();
wxChar *data = new wxChar[size];
@ -131,7 +131,7 @@ TEST_CASE("FTP", "[net][.]")
// upload a file
static const wxChar *file1 = wxT("test1");
wxOutputStream *out = ftp.GetOutputStream(file1);
CPPUNIT_ASSERT( out != NULL );
CPPUNIT_ASSERT( out != nullptr );
CPPUNIT_ASSERT( out->Write("First hello", 11).GetLastError() == wxSTREAM_NO_ERROR );
delete out;

View file

@ -421,7 +421,7 @@ void URITestCase::URLCompat()
CPPUNIT_ASSERT(urlProblem.GetError() == wxURL_NOERR);
wxInputStream* is = urlProblem.GetInputStream();
CPPUNIT_ASSERT(is != NULL);
CPPUNIT_ASSERT(is != nullptr);
wxFile fOut(wxT("test.html"), wxFile::write);
wxASSERT(fOut.IsOpened());
@ -453,7 +453,7 @@ void URITestCase::URLProxy()
wxURL::SetDefaultProxy(wxT("fol.singnet.com.sg:8080"));
wxURL url2(wxT("http://server-name/path/to/file?query_data=value"));
wxInputStream *data = url2.GetInputStream();
CPPUNIT_ASSERT(data != NULL);
CPPUNIT_ASSERT(data != nullptr);
}
#endif // wxUSE_PROTOCOL_HTTP