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/qdbusmetatype.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/qdbusmetatype.cpp')
-rw-r--r-- | src/dbus/qdbusmetatype.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index 58ce4f8930..e3804f74f8 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE class QDBusCustomTypeInfo { public: - QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0) + QDBusCustomTypeInfo() : signature(), marshall(nullptr), demarshall(nullptr) { } // Suggestion: @@ -78,7 +78,7 @@ public: }; template<typename T> -inline static void registerHelper(T * = 0) +inline static void registerHelper(T * = nullptr) { void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>; void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>; @@ -259,7 +259,7 @@ bool QDBusMetaType::marshall(QDBusArgument &arg, int id, const void *data) const QDBusCustomTypeInfo &info = (*ct).at(id); if (!info.marshall) { - mf = 0; // make gcc happy + mf = nullptr; // make gcc happy return false; } else mf = info.marshall; @@ -288,7 +288,7 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data) const QDBusCustomTypeInfo &info = (*ct).at(id); if (!info.demarshall) { - df = 0; // make gcc happy + df = nullptr; // make gcc happy return false; } else df = info.demarshall; @@ -460,7 +460,7 @@ const char *QDBusMetaType::typeToSignature(int type) { QReadLocker locker(customTypesLock()); if (type >= ct->size()) - return 0; // type not registered with us + return nullptr; // type not registered with us const QDBusCustomTypeInfo &info = (*ct).at(type); @@ -468,7 +468,7 @@ const char *QDBusMetaType::typeToSignature(int type) return info.signature; if (!info.marshall) - return 0; // type not registered with us + return nullptr; // type not registered with us } // call to user code to construct the signature type |