From 44e638f06965e1022a0da7a48105c83a6d373547 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Aug 2012 16:01:40 +0200 Subject: Add Q_DECL_NOTHROW to QRefCount. For the same reason as the previous commit (about the atomic classes), mark these functions as never throwing an exception. Change-Id: Idf46e41b226f54cb8658416efdf985ca40dd2952 Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll --- src/corelib/tools/qrefcount.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/corelib/tools/qrefcount.h') diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h index 16b1d339b3..4306b65cb9 100644 --- a/src/corelib/tools/qrefcount.h +++ b/src/corelib/tools/qrefcount.h @@ -55,7 +55,7 @@ namespace QtPrivate class RefCount { public: - inline bool ref() { + inline bool ref() Q_DECL_NOTHROW { int count = atomic.load(); if (count == 0) // !isSharable return false; @@ -64,7 +64,7 @@ public: return true; } - inline bool deref() { + inline bool deref() Q_DECL_NOTHROW { int count = atomic.load(); if (count == 0) // !isSharable return false; @@ -73,7 +73,7 @@ public: return atomic.deref(); } - bool setSharable(bool sharable) + bool setSharable(bool sharable) Q_DECL_NOTHROW { Q_ASSERT(!isShared()); if (sharable) @@ -82,26 +82,26 @@ public: return atomic.testAndSetRelaxed(1, 0); } - bool isStatic() const + bool isStatic() const Q_DECL_NOTHROW { // Persistent object, never deleted return atomic.load() == -1; } - bool isSharable() const + bool isSharable() const Q_DECL_NOTHROW { // Sharable === Shared ownership. return atomic.load() != 0; } - bool isShared() const + bool isShared() const Q_DECL_NOTHROW { int count = atomic.load(); return (count != 1) && (count != 0); } - void initializeOwned() { atomic.store(1); } - void initializeUnsharable() { atomic.store(0); } + void initializeOwned() Q_DECL_NOTHROW { atomic.store(1); } + void initializeUnsharable() Q_DECL_NOTHROW { atomic.store(0); } QBasicAtomicInt atomic; }; -- cgit v1.2.3