summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-02 15:51:52 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-20 21:59:21 +0200
commit373845dfd8acae0c941432c8cd615b77bcae0a2a (patch)
treed8d88bdd6657a18f55456bfe2ac5dfff682e76aa /src/corelib/plugin
parent291938aea6771a0ce4c11a164583a73c6eef026e (diff)
Add Q_DECL_NOTHROW to some qHash functions
The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/quuid.cpp2
-rw-r--r--src/corelib/plugin/quuid.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index dc8958de4f..095fcda1f7 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -1006,7 +1006,7 @@ QDebug operator<<(QDebug dbg, const QUuid &id)
\relates QUuid
Returns a hash of the UUID \a uuid, using \a seed to seed the calculation.
*/
-uint qHash(const QUuid &uuid, uint seed)
+uint qHash(const QUuid &uuid, uint seed) Q_DECL_NOTHROW
{
return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 7fd32a307b..acc073c1a9 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -227,7 +227,7 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QUuid &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QUuid &);
#endif
-Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0);
+Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0) Q_DECL_NOTHROW;
QT_END_NAMESPACE