diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/error_gui.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/error_gui.cpp')
-rw-r--r-- | src/error_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp index 47bca2638..1fa83db16 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -76,7 +76,7 @@ ErrorMessageData::ErrorMessageData(const ErrorMessageData &data) { *this = data; for (size_t i = 0; i < lengthof(this->strings); i++) { - if (this->strings[i] != NULL) { + if (this->strings[i] != nullptr) { this->strings[i] = stredup(this->strings[i]); this->decode_params[i] = (size_t)this->strings[i]; } @@ -357,7 +357,7 @@ void ShowFirstError() void UnshowCriticalError() { ErrmsgWindow *w = (ErrmsgWindow*)FindWindowById(WC_ERRMSG, 0); - if (_window_system_initialized && w != NULL) { + if (_window_system_initialized && w != nullptr) { if (w->IsCritical()) _error_list.push_front(*w); _window_system_initialized = false; delete w; @@ -377,7 +377,7 @@ void UnshowCriticalError() */ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x, int y, const GRFFile *textref_stack_grffile, uint textref_stack_size, const uint32 *textref_stack) { - assert(textref_stack_size == 0 || (textref_stack_grffile != NULL && textref_stack != NULL)); + assert(textref_stack_size == 0 || (textref_stack_grffile != nullptr && textref_stack != nullptr)); if (summary_msg == STR_NULL) summary_msg = STR_EMPTY; if (wl != WL_INFO) { @@ -408,7 +408,7 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel data.CopyOutDParams(); ErrmsgWindow *w = (ErrmsgWindow*)FindWindowById(WC_ERRMSG, 0); - if (w != NULL && w->IsCritical()) { + if (w != nullptr && w->IsCritical()) { /* A critical error is currently shown. */ if (wl == WL_CRITICAL) { /* Push another critical error in the queue of errors, |