From 09c1bd2eb053d00bbd221d15c211867865247765 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 3 Apr 2015 21:46:36 +0200 Subject: QUuid: add some noexcept Change-Id: I43647e558a761ff6e7a275e30382919ba038f467 Reviewed-by: Thiago Macieira --- src/corelib/plugin/quuid.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/corelib/plugin/quuid.h') diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index 13fd236a5e..38f3bdfb8b 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -75,13 +75,13 @@ public: }; #if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_QDOC) - Q_DECL_CONSTEXPR QUuid() : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {} + Q_DECL_CONSTEXPR QUuid() Q_DECL_NOTHROW : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {} Q_DECL_CONSTEXPR QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, - uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) + uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW : data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {} #else - QUuid() + QUuid() Q_DECL_NOTHROW { data1 = 0; data2 = 0; @@ -89,7 +89,7 @@ public: for(int i = 0; i < 8; i++) data4[i] = 0; } - QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) + QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW { data1 = l; data2 = w1; @@ -112,9 +112,9 @@ public: QByteArray toByteArray() const; QByteArray toRfc4122() const; static QUuid fromRfc4122(const QByteArray &); - bool isNull() const; + bool isNull() const Q_DECL_NOTHROW; - Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const + Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const Q_DECL_NOTHROW { if (data1 != orig.data1 || data2 != orig.data2 || data3 != orig.data3) @@ -127,24 +127,24 @@ public: return true; } - Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const + Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const Q_DECL_NOTHROW { return !(*this == orig); } - bool operator<(const QUuid &other) const; - bool operator>(const QUuid &other) const; + bool operator<(const QUuid &other) const Q_DECL_NOTHROW; + bool operator>(const QUuid &other) const Q_DECL_NOTHROW; #if defined(Q_OS_WIN) // On Windows we have a type GUID that is used by the platform API, so we // provide convenience operators to cast from and to this type. #if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_QDOC) - Q_DECL_CONSTEXPR QUuid(const GUID &guid) + Q_DECL_CONSTEXPR QUuid(const GUID &guid) Q_DECL_NOTHROW : data1(guid.Data1), data2(guid.Data2), data3(guid.Data3), data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]} {} #else - QUuid(const GUID &guid) + QUuid(const GUID &guid) Q_DECL_NOTHROW { data1 = guid.Data1; data2 = guid.Data2; @@ -154,24 +154,24 @@ public: } #endif - Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) + Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) Q_DECL_NOTHROW { *this = QUuid(guid); return *this; } - Q_DECL_RELAXED_CONSTEXPR operator GUID() const + Q_DECL_RELAXED_CONSTEXPR operator GUID() const Q_DECL_NOTHROW { GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; return guid; } - Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const + Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const Q_DECL_NOTHROW { return *this == QUuid(guid); } - Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const + Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const Q_DECL_NOTHROW { return !(*this == guid); } @@ -192,8 +192,8 @@ public: #endif - QUuid::Variant variant() const; - QUuid::Version version() const; + QUuid::Variant variant() const Q_DECL_NOTHROW; + QUuid::Version version() const Q_DECL_NOTHROW; uint data1; ushort data2; -- cgit v1.2.3