diff options
Diffstat (limited to 'src/stringfilter.cpp')
-rw-r--r-- | src/stringfilter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/stringfilter.cpp b/src/stringfilter.cpp index 88eb5f28a..d0bffb270 100644 --- a/src/stringfilter.cpp +++ b/src/stringfilter.cpp @@ -33,14 +33,14 @@ void StringFilter::SetFilterTerm(const char *str) this->word_matches = 0; free(this->filter_buffer); - assert(str != NULL); + assert(str != nullptr); char *dest = MallocT<char>(strlen(str) + 1); this->filter_buffer = dest; WChar state = STATE_WHITESPACE; const char *pos = str; - WordState *word = NULL; + WordState *word = nullptr; size_t len; for (;; pos += len) { WChar c; @@ -48,9 +48,9 @@ void StringFilter::SetFilterTerm(const char *str) if (c == 0 || (state == STATE_WORD && IsWhitespace(c))) { /* Finish word */ - if (word != NULL) { + if (word != nullptr) { *(dest++) = '\0'; - word = NULL; + word = nullptr; } state = STATE_WHITESPACE; if (c != 0) continue; else break; @@ -75,7 +75,7 @@ void StringFilter::SetFilterTerm(const char *str) } /* Add to word */ - if (word == NULL) { + if (word == nullptr) { /*C++17: word = &*/ this->word_index.push_back({dest, false}); word = &this->word_index.back(); } @@ -106,12 +106,12 @@ void StringFilter::ResetState() */ void StringFilter::AddLine(const char *str) { - if (str == NULL) return; + if (str == nullptr) return; - bool match_case = this->case_sensitive != NULL && *this->case_sensitive; + bool match_case = this->case_sensitive != nullptr && *this->case_sensitive; for (WordState &ws : this->word_index) { if (!ws.match) { - if ((match_case ? strstr(str, ws.start) : strcasestr(str, ws.start)) != NULL) { + if ((match_case ? strstr(str, ws.start) : strcasestr(str, ws.start)) != nullptr) { ws.match = true; this->word_matches++; } |