diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-14 15:04:18 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-06-07 17:19:16 +0200 |
commit | b4ead572501179244aa036e7a590fa7536929f2b (patch) | |
tree | f1e706b221e78e294b3169965c005df768730203 /src/corelib/io/qipaddress.cpp | |
parent | 327bfdb671e0e263c6fb027133a54985a65194c4 (diff) |
Move away from using 0 as a pointer constant
Cleans up most of corelib to use nullptr or default enums
where appropriate.
Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qipaddress.cpp')
-rw-r--r-- | src/corelib/io/qipaddress.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp index d9f7916dd4..131795330b 100644 --- a/src/corelib/io/qipaddress.cpp +++ b/src/corelib/io/qipaddress.cpp @@ -67,7 +67,7 @@ static const QChar *checkedToAscii(Buffer &buffer, const QChar *begin, const QCh *dst++ = *src++; } *dst = '\0'; - return 0; + return nullptr; } static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptLeadingZero); @@ -175,7 +175,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end memset(address, 0, sizeof address); if (colonCount == 2 && end - begin == 2) // "::" - return 0; + return nullptr; // if there's a double colon ("::"), this is how many zeroes it means int zeroWordsToFill; @@ -236,7 +236,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end address[13] = ip4 >> 16; address[14] = ip4 >> 8; address[15] = ip4; - return 0; + return nullptr; } address[pos++] = x >> 8; @@ -248,7 +248,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end return begin + (endptr - buffer.data()); ptr = endptr + 1; } - return pos == 16 ? 0 : end; + return pos == 16 ? nullptr : end; } static inline QChar toHex(uchar c) |