Skip to content

Commit 3d7c2b4

Browse files
committed
Less warnings with Qt6
1 parent 6f17799 commit 3d7c2b4

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

src/irisnet/noncore/icetransport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ class IceTransport : public QObject {
6060
void debugLine(const QString &str);
6161
};
6262

63+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
6364
inline uint qHash(const QWeakPointer<IceTransport> &p) { return qHash(p.toStrongRef().data()); }
65+
#else
66+
inline size_t qHash(const QWeakPointer<IceTransport> &p) { return qHash(p.toStrongRef().data()); }
67+
#endif
6468

6569
} // namespace XMPP
6670

src/irisnet/noncore/transportaddress.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ class TransportAddress {
2323
}
2424
};
2525

26+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
27+
2628
inline uint qHash(const TransportAddress &key, uint seed = 0)
29+
#else
30+
inline size_t qHash(const TransportAddress &key, size_t seed = 0)
31+
#endif
2732
{
2833
return ::qHash(key.addr, seed) ^ ::qHash(key.port, seed);
2934
}

src/xmpp/jid/jid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Q_DECL_PURE_FUNCTION inline uint qHash(const XMPP::Jid &key, uint seed = 0) Q_DE
9797
return qHash(key.full(), seed);
9898
}
9999
#else
100-
Q_DECL_PURE_FUNCTION inline uint qHash(const XMPP::Jid &key, size_t seed = 0) Q_DECL_NOTHROW
100+
Q_DECL_PURE_FUNCTION inline size_t qHash(const XMPP::Jid &key, size_t seed = 0) Q_DECL_NOTHROW
101101
{
102102
return qHash(key.full(), seed);
103103
}

src/xmpp/xmpp-im/jingle.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ namespace Jingle {
4343

4444
enum class Origin { None, Both, Initiator, Responder };
4545

46+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
4647
inline uint qHash(const XMPP::Jingle::Origin &o, uint seed = 0) { return ::qHash(int(o), seed); }
48+
#else
49+
inline size_t qHash(const XMPP::Jingle::Origin &o, size_t seed = 0) { return ::qHash(int(o), seed); }
50+
#endif
4751

4852
/*
4953
Session states:
@@ -121,7 +125,11 @@ namespace Jingle {
121125
SessionTerminate
122126
};
123127

128+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
124129
inline uint qHash(const XMPP::Jingle::Action &o, uint seed = 0) { return ::qHash(int(o), seed); }
130+
#else
131+
inline size_t qHash(const XMPP::Jingle::Action &o, size_t seed = 0) { return ::qHash(int(o), seed); }
132+
#endif
125133

126134
/*
127135
Categorization by speed, reliability and connectivity

src/xmpp/xmpp-im/xmpp_externalservicediscovery.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ struct ExternalServiceId {
6666
}
6767
};
6868

69+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
6970
inline uint qHash(const ExternalServiceId &id, uint seed = 0)
71+
#else
72+
inline size_t qHash(const ExternalServiceId &id, size_t seed = 0)
73+
#endif
7074
{
7175
return ::qHash(id.host, seed) ^ ::qHash(id.type, seed) ^ ::qHash(id.port, seed);
7276
}

src/xmpp/xmpp-im/xmpp_hash.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ class StreamHash {
9999
std::unique_ptr<StreamHashPrivate> d;
100100
};
101101

102+
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
102103
Q_DECL_PURE_FUNCTION inline uint qHash(const Hash &hash, uint seed = 0) Q_DECL_NOTHROW
104+
#else
105+
Q_DECL_PURE_FUNCTION inline size_t qHash(const Hash &hash, size_t seed = 0) Q_DECL_NOTHROW
106+
#endif
103107
{
104108
return qHash(hash.data(), seed);
105109
}

0 commit comments

Comments
 (0)