Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Henry Wilson
2019-04-10 22:07:06 +01:00
committed by Michael Lutz
parent 3b4f224c0b
commit 7c8e7c6b6e
463 changed files with 5674 additions and 5674 deletions

View File

@@ -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