summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobalstatic.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-20 11:42:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-21 21:15:17 +0200
commitff776a3059b25f8dd3c3abbd6aa8ffa95ec9cf7a (patch)
treeae627fb3b96e7675c22219747d0baf1cd29da013 /src/corelib/global/qglobalstatic.h
parent33617c03a47c930b8abe6ad3c583bf4251845f24 (diff)
Whitespace cleanup in corelib/global
Change-Id: I087d7d949cfd43e48e8a008621a4eeaa9d104ceb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
-rw-r--r--src/corelib/global/qglobalstatic.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index e56fe1dbcb..a0dfd462fd 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -132,17 +132,29 @@ struct QGlobalStatic
bool isDestroyed() const { return guard.loadRelaxed() <= QtGlobalStatic::Destroyed; }
bool exists() const { return guard.loadRelaxed() == QtGlobalStatic::Initialized; }
- operator Type *() { if (isDestroyed()) return nullptr; return innerFunction(); }
- Type *operator()() { if (isDestroyed()) return nullptr; return innerFunction(); }
+ operator Type *()
+ {
+ if (isDestroyed())
+ return nullptr;
+ return innerFunction();
+ }
+ Type *operator()()
+ {
+ if (isDestroyed())
+ return nullptr;
+ return innerFunction();
+ }
Type *operator->()
{
- Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC", "The global static was used after being destroyed");
- return innerFunction();
+ Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC",
+ "The global static was used after being destroyed");
+ return innerFunction();
}
Type &operator*()
{
- Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC", "The global static was used after being destroyed");
- return *innerFunction();
+ Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC",
+ "The global static was used after being destroyed");
+ return *innerFunction();
}
};