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

@ -205,7 +205,7 @@ wxWindow *CreatePage(wxBookCtrlBase *parent, const wxString&pageName)
wxFAIL_MSG( "unknown page name" );
return NULL;
return nullptr;
}
@ -274,7 +274,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
wxEND_EVENT_TABLE()
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, wxString("wxWidgets book controls sample"))
: wxFrame(nullptr, wxID_ANY, wxString("wxWidgets book controls sample"))
{
#if wxUSE_HELP
SetExtraStyle(wxFRAME_EX_CONTEXTHELP);
@ -389,8 +389,8 @@ MyFrame::MyFrame()
SetMenuBar(menuBar);
// books creation
m_panel = NULL;
m_bookCtrl = NULL;
m_panel = nullptr;
m_bookCtrl = nullptr;
// use some random images for the book control pages
const wxSize imageSize(32, 32);
@ -533,7 +533,7 @@ void MyFrame::RecreateBook()
wxBookCtrlBase *oldBook = m_bookCtrl;
m_bookCtrl = NULL;
m_bookCtrl = nullptr;
DISPATCH_ON_TYPE(m_bookCtrl = new,
wxNotebook,
@ -562,7 +562,7 @@ void MyFrame::RecreateBook()
// we only need the old treebook if we're recreating another treebook
wxTreebook *tbkOld = m_type == Type_Treebook
? wxDynamicCast(oldBook, wxTreebook)
: NULL;
: nullptr;
#endif // wxUSE_TREEBOOK
const int count = oldBook->GetPageCount();
@ -925,7 +925,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
{
static int s_nPages = wxNOT_FOUND;
static int s_nSel = wxNOT_FOUND;
static wxBookCtrlBase *s_currBook = NULL;
static wxBookCtrlBase *s_currBook = nullptr;
wxBookCtrlBase *currBook = GetCurrentBook();