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/textbuf.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/textbuf.cpp')
-rw-r--r-- | src/textbuf.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/textbuf.cpp b/src/textbuf.cpp index 61e449d3a..384757566 100644 --- a/src/textbuf.cpp +++ b/src/textbuf.cpp @@ -164,18 +164,18 @@ bool Textbuf::InsertChar(WChar key) bool Textbuf::InsertString(const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end) { uint16 insertpos = (marked && this->marklength != 0) ? this->markpos : this->caretpos; - if (insert_location != NULL) { + if (insert_location != nullptr) { insertpos = insert_location - this->buf; if (insertpos > this->bytes) return false; - if (replacement_end != NULL) { - this->DeleteText(insertpos, replacement_end - this->buf, str == NULL); + if (replacement_end != nullptr) { + this->DeleteText(insertpos, replacement_end - this->buf, str == nullptr); } } else { - if (marked) this->DiscardMarkedText(str == NULL); + if (marked) this->DiscardMarkedText(str == nullptr); } - if (str == NULL) return false; + if (str == nullptr) return false; uint16 bytes = 0, chars = 0; WChar c; @@ -205,7 +205,7 @@ bool Textbuf::InsertString(const char *str, bool marked, const char *caret, cons this->bytes += bytes; this->chars += chars; - if (!marked && caret == NULL) this->caretpos += bytes; + if (!marked && caret == nullptr) this->caretpos += bytes; assert(this->bytes <= this->max_bytes); assert(this->chars <= this->max_chars); this->buf[this->bytes - 1] = '\0'; // terminating zero |