summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/osk_gui.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r--src/osk_gui.cpp10
1 files changed, 5 insertions, 5 deletions
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<NWidgetCore>(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<OskWindow *>(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<OskWindow *>(FindWindowById(WC_OSK, 0));
- return osk != NULL && osk->parent == w && osk->text_btn == button;
+ return osk != nullptr && osk->parent == w && osk->text_btn == button;
}