From 7c8e7c6b6e16d4a26259a676db32d8776b99817e Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Wed, 10 Apr 2019 22:07:06 +0100 Subject: Codechange: Use null pointer literal instead of the NULL macro --- src/osk_gui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/osk_gui.cpp') diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index de8be373e..a706a9160 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -46,10 +46,10 @@ struct OskWindow : public Window { OskWindow(WindowDesc *desc, Window *parent, int button) : Window(desc) { this->parent = parent; - assert(parent != NULL); + assert(parent != nullptr); NWidgetCore *par_wid = parent->GetWidget(button); - assert(par_wid != NULL); + assert(par_wid != nullptr); assert(parent->querystrings.Contains(button)); this->qs = parent->querystrings.Find(button)->second; @@ -166,7 +166,7 @@ struct OskWindow : public Window { break; case WID_OSK_OK: - if (this->qs->orig == NULL || strcmp(this->qs->text.buf, this->qs->orig) != 0) { + if (this->qs->orig == nullptr || strcmp(this->qs->text.buf, this->qs->orig) != 0) { /* pass information by simulating a button press on parent window */ if (this->qs->ok_button >= 0) { this->parent->OnClick(pt, this->qs->ok_button, 1); @@ -427,7 +427,7 @@ void ShowOnScreenKeyboard(Window *parent, int button) void UpdateOSKOriginalText(const Window *parent, int button) { OskWindow *osk = dynamic_cast(FindWindowById(WC_OSK, 0)); - if (osk == NULL || osk->parent != parent || osk->text_btn != button) return; + if (osk == nullptr || osk->parent != parent || osk->text_btn != button) return; free(osk->orig_str_buf); osk->orig_str_buf = stredup(osk->qs->text.buf); @@ -444,5 +444,5 @@ void UpdateOSKOriginalText(const Window *parent, int button) bool IsOSKOpenedFor(const Window *w, int button) { OskWindow *osk = dynamic_cast(FindWindowById(WC_OSK, 0)); - return osk != NULL && osk->parent == w && osk->text_btn == button; + return osk != nullptr && osk->parent == w && osk->text_btn == button; } -- cgit v1.2.3-54-g00ecf