From 499ec43937e926e4f2fa57a9baa455fcb3862262 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 21 Feb 2018 10:41:54 +0100 Subject: use nullptr consistently (clang-tidy) From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann --- src/qml/debugger/qqmlabstractprofileradapter_p.h | 4 ++-- src/qml/debugger/qqmlconfigurabledebugservice_p.h | 2 +- src/qml/debugger/qqmldebugconnector.cpp | 10 +++++----- src/qml/debugger/qqmldebugconnector_p.h | 2 +- src/qml/debugger/qqmldebugserverconnection_p.h | 2 +- src/qml/debugger/qqmldebugservice_p.h | 2 +- src/qml/debugger/qqmlprofiler_p.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/qml/debugger') diff --git a/src/qml/debugger/qqmlabstractprofileradapter_p.h b/src/qml/debugger/qqmlabstractprofileradapter_p.h index 5d1b339324..f86855e964 100644 --- a/src/qml/debugger/qqmlabstractprofileradapter_p.h +++ b/src/qml/debugger/qqmlabstractprofileradapter_p.h @@ -68,8 +68,8 @@ class Q_QML_PRIVATE_EXPORT QQmlAbstractProfilerAdapter : public QObject, public public: static const int s_numMessagesPerBatch = 1000; - QQmlAbstractProfilerAdapter(QObject *parent = 0) : - QObject(parent), service(0), waiting(true), featuresEnabled(0) {} + QQmlAbstractProfilerAdapter(QObject *parent = nullptr) : + QObject(parent), service(nullptr), waiting(true), featuresEnabled(0) {} virtual ~QQmlAbstractProfilerAdapter() {} void setService(QQmlProfilerService *new_service) { service = new_service; } diff --git a/src/qml/debugger/qqmlconfigurabledebugservice_p.h b/src/qml/debugger/qqmlconfigurabledebugservice_p.h index e09d5f779a..96ec46f475 100644 --- a/src/qml/debugger/qqmlconfigurabledebugservice_p.h +++ b/src/qml/debugger/qqmlconfigurabledebugservice_p.h @@ -63,7 +63,7 @@ template class QQmlConfigurableDebugService : public Base { protected: - QQmlConfigurableDebugService(float version, QObject *parent = 0) : + QQmlConfigurableDebugService(float version, QObject *parent = nullptr) : Base(version, parent), m_configMutex(QMutex::Recursive) { init(); diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp index 01f74f08be..d9f51ce09f 100644 --- a/src/qml/debugger/qqmldebugconnector.cpp +++ b/src/qml/debugger/qqmldebugconnector.cpp @@ -66,7 +66,7 @@ struct QQmlDebugConnectorParams { QString arguments; QQmlDebugConnector *instance; - QQmlDebugConnectorParams() : instance(0) + QQmlDebugConnectorParams() : instance(nullptr) { if (qApp) { QCoreApplicationPrivate *appD = @@ -109,7 +109,7 @@ QQmlDebugConnector *QQmlDebugConnector::instance() { QQmlDebugConnectorParams *params = qmlDebugConnectorParams(); if (!params) - return 0; + return nullptr; if (!QQmlEnginePrivate::qml_debugging_enabled) { if (!params->arguments.isEmpty()) { @@ -118,14 +118,14 @@ QQmlDebugConnector *QQmlDebugConnector::instance() "has not been enabled.").arg(params->arguments); params->arguments.clear(); } - return 0; + return nullptr; } if (!params->instance) { if (!params->pluginKey.isEmpty()) { params->instance = loadQQmlDebugConnector(params->pluginKey); } else if (params->arguments.isEmpty()) { - return 0; // no explicit class name given and no command line arguments + return nullptr; // no explicit class name given and no command line arguments } else if (params->arguments.startsWith(QLatin1String("connector:"))) { static const int connectorBegin = int(strlen("connector:")); @@ -169,7 +169,7 @@ QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory() params->arguments.clear(); params->services.clear(); delete params->instance; - params->instance = 0; + params->instance = nullptr; } } diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h index a2a6f5047d..cead6af338 100644 --- a/src/qml/debugger/qqmldebugconnector_p.h +++ b/src/qml/debugger/qqmldebugconnector_p.h @@ -114,7 +114,7 @@ public: static Service *service() { QQmlDebugConnector *inst = instance(); - return inst ? static_cast(inst->service(Service::s_key)) : 0; + return inst ? static_cast(inst->service(Service::s_key)) : nullptr; } protected: diff --git a/src/qml/debugger/qqmldebugserverconnection_p.h b/src/qml/debugger/qqmldebugserverconnection_p.h index 536ad830b4..9c4af4d225 100644 --- a/src/qml/debugger/qqmldebugserverconnection_p.h +++ b/src/qml/debugger/qqmldebugserverconnection_p.h @@ -61,7 +61,7 @@ class Q_QML_PRIVATE_EXPORT QQmlDebugServerConnection : public QObject { Q_OBJECT public: - QQmlDebugServerConnection(QObject *parent = 0) : QObject(parent) {} + QQmlDebugServerConnection(QObject *parent = nullptr) : QObject(parent) {} virtual void setServer(QQmlDebugServer *server) = 0; virtual bool setPortRange(int portFrom, int portTo, bool block, const QString &hostaddress) = 0; diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h index 34bbd631ec..e9f7d2d396 100644 --- a/src/qml/debugger/qqmldebugservice_p.h +++ b/src/qml/debugger/qqmldebugservice_p.h @@ -93,7 +93,7 @@ public: static QObject *objectForId(int id) { return objectsForIds().value(id); } protected: - explicit QQmlDebugService(const QString &, float version, QObject *parent = 0); + explicit QQmlDebugService(const QString &, float version, QObject *parent = nullptr); signals: void attachedToEngine(QJSEngine *); diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 58db26f2ac..deb4d107d6 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -450,7 +450,7 @@ struct QQmlCompilingProfiler : public QQmlProfilerHelper { struct QQmlVmeProfiler : public QQmlProfilerDefinitions { public: - QQmlVmeProfiler() : profiler(0) {} + QQmlVmeProfiler() : profiler(nullptr) {} void init(QQmlProfiler *p, int maxDepth) { -- cgit v1.2.3