Fix using 0 as null pointer

Fixes: error: zero as null pointer constant.

Change-Id: I850d51075263dac6dd135d3cadc136cbd08b40ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Jesus Fernandez 2016-12-05 13:50:53 +01:00
parent 6ff4d8c61a
commit 3c4febf557
3 changed files with 4 additions and 4 deletions

View File

@ -77,7 +77,7 @@ namespace QDBusPendingReplyTypes {
typedef T1 Type;
};
template<typename T1> inline int metaTypeFor(T1 * = 0)
template<typename T1> inline int metaTypeFor(T1 * = nullptr)
{ return qMetaTypeId<T1>(); }
// specialize for QVariant, allowing it to be used in place of QDBusVariant
template<> inline int metaTypeFor<QVariant>(QVariant *)
@ -91,7 +91,7 @@ namespace QDBusPendingReplyTypes {
enum { Total = Next::Total + 1 };
static inline void fillMetaTypes(int *p)
{
*p = metaTypeFor<T1>(0);
*p = metaTypeFor<T1>(nullptr);
Next::fillMetaTypes(++p);
}
};

View File

@ -66,7 +66,7 @@ public:
}
inline QDBusReply& operator=(const QDBusMessage &reply)
{
QVariant data(qMetaTypeId<Type>(), reinterpret_cast<void*>(0));
QVariant data(qMetaTypeId<Type>(), nullptr);
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<Type>(data);
return *this;

View File

@ -514,7 +514,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
// constructors/destructors:
hs << "public:" << endl
<< " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);" << endl
<< " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << endl
<< endl
<< " ~" << className << "();" << endl
<< endl;