Style: Replaces uses of 0/NULL by nullptr (C++11)

Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
This commit is contained in:
Rémi Verschelde
2021-05-04 16:00:45 +02:00
parent 2b429b24b5
commit a828398655
633 changed files with 4454 additions and 4410 deletions

View File

@@ -1852,7 +1852,7 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
* necessary unless F is present. The "E" may
* actually be an "e". E and X may both be
* omitted (but not just one). */
C **endPtr = NULL) /* If non-NULL, store terminating Cacter's
C **endPtr = nullptr) /* If non-NULL, store terminating Cacter's
* address here. */
{
static const int maxExponent = 511; /* Largest possible base 10 exponent. Any
@@ -2039,7 +2039,7 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
}
done:
if (endPtr != NULL) {
if (endPtr != nullptr) {
*endPtr = (C *)p;
}
@@ -3298,7 +3298,7 @@ String String::http_unescape() const {
CharType ord2 = ord_at(i + 2);
if ((ord2 >= '0' && ord2 <= '9') || (ord2 >= 'A' && ord2 <= 'Z')) {
char bytes[3] = { (char)ord1, (char)ord2, 0 };
res += (char)strtol(bytes, NULL, 16);
res += (char)strtol(bytes, nullptr, 16);
i += 2;
}
} else {
@@ -3464,7 +3464,7 @@ static _FORCE_INLINE_ int _xml_unescape(const CharType *p_src, int p_src_len, Ch
String String::xml_unescape() const {
String str;
int l = length();
int len = _xml_unescape(c_str(), l, NULL);
int len = _xml_unescape(c_str(), l, nullptr);
if (len == 0)
return String();
str.resize(len + 1);