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

@ -152,8 +152,8 @@ public:
, floating_pos(wxDefaultPosition)
, floating_size(wxDefaultSize)
{
window = NULL;
frame = NULL;
window = nullptr;
frame = nullptr;
state = 0;
dock_direction = wxAUI_DOCK_LEFT;
dock_layer = 0;
@ -180,7 +180,7 @@ public:
*this = source;
}
bool IsOk() const { return window != NULL; }
bool IsOk() const { return window != nullptr; }
bool IsFixed() const { return !HasFlag(optionResizable); }
bool IsResizable() const { return HasFlag(optionResizable); }
bool IsShown() const { return !HasFlag(optionHidden); }
@ -405,7 +405,7 @@ class WXDLLIMPEXP_AUI wxAuiManager : public wxEvtHandler
public:
wxAuiManager(wxWindow* managedWnd = NULL,
wxAuiManager(wxWindow* managedWnd = nullptr,
unsigned int flags = wxAUI_MGR_DEFAULT);
virtual ~wxAuiManager();
void UnInit();
@ -533,7 +533,7 @@ protected:
void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt);
void OnFloatingPaneResized(wxWindow* window, const wxRect& rect);
void Render(wxDC* dc);
void Repaint(wxDC* dc = NULL);
void Repaint(wxDC* dc = nullptr);
void ProcessMgrEvent(wxAuiManagerEvent& event);
void UpdateButtonOnScreen(wxAuiDockUIPart* buttonUiPart,
const wxMouseEvent& event);
@ -596,7 +596,7 @@ protected:
wxPoint m_actionStart; // position where the action click started
wxPoint m_actionOffset; // offset from upper left of the item clicked
wxAuiDockUIPart* m_actionPart; // ptr to the part the action happened to
wxWindow* m_actionWindow; // action frame or window (NULL if none)
wxWindow* m_actionWindow; // action frame or window (nullptr if none)
wxRect m_actionHintRect; // hint rectangle for the action
wxRect m_lastRect;
wxAuiDockUIPart* m_hoverButton;// button uipart being hovered over
@ -630,12 +630,12 @@ class WXDLLIMPEXP_AUI wxAuiManagerEvent : public wxEvent
public:
wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type)
{
manager = NULL;
pane = NULL;
manager = nullptr;
pane = nullptr;
button = 0;
veto_flag = false;
canveto_flag = true;
dc = NULL;
dc = nullptr;
}
wxEvent *Clone() const override { return new wxAuiManagerEvent(*this); }