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

@ -104,7 +104,7 @@ public:
// not set yet and hence must be passed explicitly to it so that we could
// check whether it contains wxDIALOG_NO_PARENT bit.
//
// This function always returns a valid top level window or NULL.
// This function always returns a valid top level window or nullptr.
wxWindow *GetParentForModalDialog(wxWindow *parent, long style) const
{
return DoGetParentForDialog(wxDIALOG_MODALITY_APP_MODAL, parent, style);
@ -142,7 +142,7 @@ public:
// returns a horizontal wxBoxSizer containing the given buttons
//
// notice that the returned sizer can be NULL if no buttons are put in the
// notice that the returned sizer can be null if no buttons are put in the
// sizer (this mostly happens under smart phones and other atypical
// platforms which have hardware buttons replacing OK/Cancel and such)
wxSizer *CreateButtonSizer(long flags);
@ -171,7 +171,7 @@ public:
// Returns a content window if there is one. This can be used by the layout adapter, for
// example to make the pages of a book control into scrolling windows
virtual wxWindow* GetContentWindow() const { return NULL; }
virtual wxWindow* GetContentWindow() const { return nullptr; }
// Add an id to the list of main button identifiers that should be in the button sizer
void AddMainButtonId(wxWindowID id) { m_mainButtonIds.Add((int) id); }
@ -262,7 +262,7 @@ private:
long style) const;
// helper of DoGetParentForDialog(): returns the passed in window if it
// can be used as parent for this kind of dialog or NULL if it can't
// can be used as parent for this kind of dialog or nullptr if it can't
wxWindow *CheckIfCanBeUsedAsParent(wxDialogModality modality,
wxWindow *parent) const;
@ -349,8 +349,8 @@ public:
#endif // wxUSE_BUTTON
// Reparent the controls to the scrolled window, except those in buttonSizer
virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
static void DoReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = nullptr);
static void DoReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = nullptr);
// A function to fit the dialog around its contents, and then adjust for screen size.
// If scrolled windows are passed, scrolling is enabled in the required orientation(s).