From 34761c4214e95d877f0f1b2f29d479169885d646 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 20 Sep 2017 09:16:15 -0400 Subject: [PATCH] Clang: reduce 0-as-nullptr warnings --- src/libcalamares/utils/PluginFactory.cpp | 2 +- src/libcalamares/utils/PluginFactory.h | 10 +++++----- src/modules/welcome/checker/RequirementsChecker.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libcalamares/utils/PluginFactory.cpp b/src/libcalamares/utils/PluginFactory.cpp index c22c90ff7..b1c3a0793 100644 --- a/src/libcalamares/utils/PluginFactory.cpp +++ b/src/libcalamares/utils/PluginFactory.cpp @@ -104,7 +104,7 @@ QObject* PluginFactory::create( const char* iface, QWidget* parentWidget, QObjec { Q_D( PluginFactory ); - QObject* obj = 0; + QObject* obj = nullptr; const QList candidates( d->createInstanceHash.values( keyword ) ); // for !keyword.isEmpty() candidates.count() is 0 or 1 diff --git a/src/libcalamares/utils/PluginFactory.h b/src/libcalamares/utils/PluginFactory.h index 945a3eaaf..55c44249c 100644 --- a/src/libcalamares/utils/PluginFactory.h +++ b/src/libcalamares/utils/PluginFactory.h @@ -223,7 +223,7 @@ public: * \returns A pointer to the created object is returned, or 0 if an error occurred. */ template - T* create( QObject* parent = 0 ); + T* create( QObject* parent = nullptr ); /** * Use this method to create an object. It will try to create an object which inherits @@ -236,7 +236,7 @@ public: * \returns A pointer to the created object is returned, or 0 if an error occurred. */ template - T* create( const QString& keyword, QObject* parent = 0 ); + T* create( const QString& keyword, QObject* parent = nullptr ); Q_SIGNALS: void objectCreated( QObject* object ); @@ -322,7 +322,7 @@ protected: static QObject* createInstance( QWidget* parentWidget, QObject* parent ) { Q_UNUSED( parentWidget ); - ParentType* p = 0; + ParentType* p = nullptr; if ( parent ) { p = qobject_cast( parent ); @@ -339,7 +339,7 @@ template inline T* PluginFactory::create( QObject* parent ) { QObject* o = create( T::staticMetaObject.className(), - parent && parent->isWidgetType() ? reinterpret_cast( parent ) : 0, + parent && parent->isWidgetType() ? reinterpret_cast( parent ) : nullptr, parent, QString() ); @@ -353,7 +353,7 @@ template inline T* PluginFactory::create( const QString& keyword, QObject* parent ) { QObject* o = create( T::staticMetaObject.className(), - parent && parent->isWidgetType() ? reinterpret_cast( parent ) : 0, + parent && parent->isWidgetType() ? reinterpret_cast( parent ) : nullptr, parent, keyword ); diff --git a/src/modules/welcome/checker/RequirementsChecker.cpp b/src/modules/welcome/checker/RequirementsChecker.cpp index 720c17955..3d4e394c4 100644 --- a/src/modules/welcome/checker/RequirementsChecker.cpp +++ b/src/modules/welcome/checker/RequirementsChecker.cpp @@ -357,7 +357,7 @@ RequirementsChecker::checkHasPower() QDBusInterface upowerIntf( UPOWER_SVC_NAME, UPOWER_PATH, UPOWER_INTF_NAME, - QDBusConnection::systemBus(), 0 ); + QDBusConnection::systemBus() ); bool onBattery = upowerIntf.property( "OnBattery" ).toBool();