OSDN Git Service

remove unused qMetaTypeId<T>() argument
authorIvailo Monev <xakepa10@gmail.com>
Wed, 6 Jan 2021 23:51:06 +0000 (01:51 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 6 Jan 2021 23:57:17 +0000 (01:57 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/kernel/qmetatype.h
src/core/kernel/qvariant.h
src/dbus/qdbusmetatype.h
src/dbus/qdbusreply.h

index cb8283c..bcb7b22 100644 (file)
@@ -200,7 +200,7 @@ void qRegisterMetaTypeStreamOperators(const char *typeName, T * /* dummy */ = Q_
 #endif // QT_NO_DATASTREAM
 
 template <typename T>
-inline int qMetaTypeId( T * /* dummy */ = Q_NULLPTR)
+inline int qMetaTypeId()
 {
     return QMetaTypeId2<T>::qt_metatype_id();
 }
@@ -208,7 +208,7 @@ inline int qMetaTypeId( T * /* dummy */ = Q_NULLPTR)
 template <typename T>
 inline int qRegisterMetaType(T * dummy = Q_NULLPTR)
 {
-    return qMetaTypeId(dummy);
+    return qMetaTypeId<T>();
 }
 
 #ifndef QT_NO_DATASTREAM
index 65547f5..8c64fc3 100644 (file)
@@ -406,7 +406,7 @@ inline bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr
 template <typename T>
 inline QVariant qVariantFromValue(const T &t)
 {
-    return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t, QTypeInfo<T>::isPointer);
+    return QVariant(qMetaTypeId<T>(), &t, QTypeInfo<T>::isPointer);
 }
 
 template <>
@@ -416,7 +416,7 @@ template <typename T>
 inline void qVariantSetValue(QVariant &v, const T &t)
 {
     //if possible we reuse the current QVariant private
-    const int type = qMetaTypeId<T>(reinterpret_cast<T *>(0));
+    const int type = qMetaTypeId<T>();
     QVariant::Private &d = v.data_ptr();
     if (v.isDetached() && (type == d.type || (type <= QVariant::Char && d.type <= QVariant::Char))) {
         d.type = type;
@@ -451,7 +451,7 @@ Q_CORE_EXPORT QDataStream& operator<< (QDataStream& s, const QVariant::Type p);
 #ifndef QT_MOC
 template<typename T> inline T qvariant_cast(const QVariant &v)
 {
-    const int vid = qMetaTypeId<T>(static_cast<T *>(Q_NULLPTR));
+    const int vid = qMetaTypeId<T>();
     if (vid == v.userType())
         return *reinterpret_cast<const T *>(v.constData());
     if (vid < int(QMetaType::User)) {
index c473efb..96ecbce 100644 (file)
@@ -66,7 +66,7 @@ void qDBusDemarshallHelper(const QDBusArgument &arg, T *t)
 { arg >> *t; }
 
 template<typename T>
-int qDBusRegisterMetaType(T * /* dummy */ = Q_NULLPTR)
+int qDBusRegisterMetaType()
 {
     void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
     void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
index c2e3c4b..ab9c4bb 100644 (file)
@@ -58,7 +58,7 @@ public:
     }
     inline QDBusReply& operator=(const QDBusMessage &reply)
     {
-        QVariant data(qMetaTypeId(&m_data), reinterpret_cast<void*>(0));
+        QVariant data(qMetaTypeId<T>(), reinterpret_cast<void*>(0));
         qDBusReplyFill(reply, m_error, data);
         m_data = qvariant_cast<Type>(data);
         return *this;
@@ -120,7 +120,7 @@ private:
 template<> inline QDBusReply<QVariant>&
 QDBusReply<QVariant>::operator=(const QDBusMessage &reply)
 {
-    void *null = 0;
+    void *null = Q_NULLPTR;
     QVariant data(qMetaTypeId<QDBusVariant>(), null);
     qDBusReplyFill(reply, m_error, data);
     m_data = qvariant_cast<QDBusVariant>(data).variant();