diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-22 14:46:58 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-06 12:13:20 +0100 |
commit | ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 (patch) | |
tree | fa4a0fdbda040d24f1a2d07a320635c76980f431 /src/dbus/qdbusutil.cpp | |
parent | b19220d17fa66de5ded41690ffff263ee2af5c63 (diff) |
Tidy nullptr usage
Move away from using 0 as pointer literal.
Done using clang-tidy. This is not complete as
run-clang-tidy can't handle all of qtbase in one go.
Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/dbus/qdbusutil.cpp')
-rw-r--r-- | src/dbus/qdbusutil.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index dc94897ac4..09311d1ad4 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -246,12 +246,12 @@ static const char fixedTypes[] = "ybnqiuxtdh"; static bool isBasicType(int c) { - return c != DBUS_TYPE_INVALID && strchr(basicTypes, c) != NULL; + return c != DBUS_TYPE_INVALID && strchr(basicTypes, c) != nullptr; } static bool isFixedType(int c) { - return c != DBUS_TYPE_INVALID && strchr(fixedTypes, c) != NULL; + return c != DBUS_TYPE_INVALID && strchr(fixedTypes, c) != nullptr; } // Returns a pointer to one-past-end of this type if it's valid; @@ -260,10 +260,10 @@ static const char *validateSingleType(const char *signature) { char c = *signature; if (c == DBUS_TYPE_INVALID) - return 0; + return nullptr; // is it one of the one-letter types? - if (strchr(oneLetterTypes, c) != NULL) + if (strchr(oneLetterTypes, c) != nullptr) return signature + 1; // is it an array? @@ -277,9 +277,9 @@ static const char *validateSingleType(const char *signature) // and a free value c = *++signature; if (!isBasicType(c)) - return 0; + return nullptr; signature = validateSingleType(signature + 1); - return signature && *signature == DBUS_DICT_ENTRY_END_CHAR ? signature + 1 : 0; + return signature && *signature == DBUS_DICT_ENTRY_END_CHAR ? signature + 1 : nullptr; } return validateSingleType(signature); @@ -291,14 +291,14 @@ static const char *validateSingleType(const char *signature) while (true) { signature = validateSingleType(signature); if (!signature) - return 0; + return nullptr; if (*signature == DBUS_STRUCT_END_CHAR) return signature + 1; } } // invalid/unknown type - return 0; + return nullptr; } /*! |