From 433cfc3907b96c4172be03c267b6cb357f896e40 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 22 Mar 2016 11:09:26 +0100 Subject: Make public headers compile with -Wzero-as-null-pointer-constant ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Change-Id: Iae48c528666459ebb368cd57615f4ead4147f872 Task-number: QTBUG-45291 Reviewed-by: Friedemann Kleint --- src/activeqt/container/qaxbase.h | 6 +++--- src/activeqt/container/qaxobject.h | 10 +++++----- src/activeqt/container/qaxscript.h | 4 ++-- src/activeqt/container/qaxselect.h | 2 +- src/activeqt/container/qaxwidget.h | 10 +++++----- src/activeqt/control/qaxfactory.h | 20 ++++++++++---------- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/activeqt/container/qaxbase.h b/src/activeqt/container/qaxbase.h index 7b667af..208a8ba 100644 --- a/src/activeqt/container/qaxbase.h +++ b/src/activeqt/container/qaxbase.h @@ -64,7 +64,7 @@ class QAxBase public: typedef QMap PropertyBag; - QAxBase(IUnknown *iface = 0); + QAxBase(IUnknown *iface = Q_NULLPTR); virtual ~QAxBase(); QString control() const; @@ -173,13 +173,13 @@ private: template <> inline QAxBase *qobject_cast(const QObject *o) { - void *result = o ? const_cast(o)->qt_metacast("QAxBase") : 0; + void *result = o ? const_cast(o)->qt_metacast("QAxBase") : Q_NULLPTR; return (QAxBase*)(result); } template <> inline QAxBase *qobject_cast(QObject *o) { - void *result = o ? o->qt_metacast("QAxBase") : 0; + void *result = o ? o->qt_metacast("QAxBase") : Q_NULLPTR; return (QAxBase*)(result); } diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h index 5c62303..41a8f59 100644 --- a/src/activeqt/container/qaxobject.h +++ b/src/activeqt/container/qaxobject.h @@ -53,9 +53,9 @@ public: QObject* qObject() const Q_DECL_OVERRIDE { return static_cast(const_cast(this)); } const char *className() const Q_DECL_OVERRIDE; - QAxObject(QObject *parent = 0); - QAxObject(const QString &c, QObject *parent = 0); - QAxObject(IUnknown *iface, QObject *parent = 0); + QAxObject(QObject *parent = Q_NULLPTR); + QAxObject(const QString &c, QObject *parent = Q_NULLPTR); + QAxObject(IUnknown *iface, QObject *parent = Q_NULLPTR); ~QAxObject(); bool doVerb(const QString &verb); @@ -70,13 +70,13 @@ private: template <> inline QAxObject *qobject_cast(const QObject *o) { - void *result = o ? const_cast(o)->qt_metacast("QAxObject") : 0; + void *result = o ? const_cast(o)->qt_metacast("QAxObject") : Q_NULLPTR; return (QAxObject*)(result); } template <> inline QAxObject *qobject_cast(QObject *o) { - void *result = o ? o->qt_metacast("QAxObject") : 0; + void *result = o ? o->qt_metacast("QAxObject") : Q_NULLPTR; return (QAxObject*)(result); } diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h index 8abd72a..b00ed06 100644 --- a/src/activeqt/container/qaxscript.h +++ b/src/activeqt/container/qaxscript.h @@ -149,7 +149,7 @@ class QAxScriptManager : public QObject Q_OBJECT public: - QAxScriptManager(QObject *parent = 0); + QAxScriptManager(QObject *parent = Q_NULLPTR); ~QAxScriptManager(); void addObject(QAxBase *object); @@ -212,7 +212,7 @@ inline QAxScriptEngine *QAxScript::scriptEngine() const inline bool QAxScriptEngine::isValid() const { - return engine != 0; + return engine != Q_NULLPTR; } inline QString QAxScriptEngine::scriptLanguage() const diff --git a/src/activeqt/container/qaxselect.h b/src/activeqt/container/qaxselect.h index 0b21c02..dc0a082 100644 --- a/src/activeqt/container/qaxselect.h +++ b/src/activeqt/container/qaxselect.h @@ -51,7 +51,7 @@ class QAxSelect : public QDialog { Q_OBJECT public: - QAxSelect(QWidget *parent = 0, Qt::WindowFlags flags = 0); + QAxSelect(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags()); ~QAxSelect(); QString clsid() const; diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h index 2cfa37f..93ab7c1 100644 --- a/src/activeqt/container/qaxwidget.h +++ b/src/activeqt/container/qaxwidget.h @@ -59,9 +59,9 @@ public: QObject* qObject() const { return (QWidget*)this; } const char *className() const; - QAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0); - QAxWidget(const QString &c, QWidget *parent = 0, Qt::WindowFlags f = 0); - QAxWidget(IUnknown *iface, QWidget *parent = 0, Qt::WindowFlags f = 0); + QAxWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + QAxWidget(const QString &c, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + QAxWidget(IUnknown *iface, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); ~QAxWidget(); void clear(); @@ -94,13 +94,13 @@ private: template <> inline QAxWidget *qobject_cast(const QObject *o) { - void *result = o ? const_cast(o)->qt_metacast("QAxWidget") : 0; + void *result = o ? const_cast(o)->qt_metacast("QAxWidget") : Q_NULLPTR; return (QAxWidget*)(result); } template <> inline QAxWidget *qobject_cast(QObject *o) { - void *result = o ? o->qt_metacast("QAxWidget") : 0; + void *result = o ? o->qt_metacast("QAxWidget") : Q_NULLPTR; return (QAxWidget*)(result); } diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h index 0ae6cd4..bda81f0 100644 --- a/src/activeqt/control/qaxfactory.h +++ b/src/activeqt/control/qaxfactory.h @@ -148,13 +148,13 @@ inline bool QAxFactory::stopServer() { \ if (key == className) \ return &Class::staticMetaObject; \ - return 0; \ + return Q_NULLPTR; \ } \ QObject *createObject(const QString &key) \ { \ if (key == className) \ - return new Class(0); \ - return 0; \ + return new Class(Q_NULLPTR); \ + return Q_NULLPTR; \ } \ QUuid classID(const QString &key) const \ { \ @@ -194,10 +194,10 @@ public: { const QMetaObject &mo = T::staticMetaObject; if (key != QLatin1String(mo.className())) - return 0; + return Q_NULLPTR; if (!qstrcmp(mo.classInfo(mo.indexOfClassInfo("Creatable")).value(), "no")) - return 0; - return new T(0); + return Q_NULLPTR; + return new T(Q_NULLPTR); } }; @@ -212,7 +212,7 @@ public: QAxFactoryList() \ : QAxFactory(IDTypeLib, IDApp) \ { \ - QAxFactory *factory = 0; \ + QAxFactory *factory = Q_NULLPTR; \ QStringList keys; \ QStringList::Iterator it; \ @@ -242,13 +242,13 @@ public: QStringList featureList() const { return factoryKeys; } \ const QMetaObject *metaObject(const QString&key) const { \ QAxFactory *f = factories[key]; \ - return f ? f->metaObject(key) : 0; \ + return f ? f->metaObject(key) : Q_NULLPTR; \ } \ QObject *createObject(const QString &key) { \ if (!creatable.value(key)) \ - return 0; \ + return Q_NULLPTR; \ QAxFactory *f = factories[key]; \ - return f ? f->createObject(key) : 0; \ + return f ? f->createObject(key) : Q_NULLPTR; \ } \ QUuid classID(const QString &key) { \ QAxFactory *f = factories.value(key); \ -- cgit v1.2.3