summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-08-31 16:08:30 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-09-01 19:44:19 +0200
commit711105058afe68407a0ed613335a83b6181112ed (patch)
tree82f549dafc18558cf0801e67b1ebfd18c8d73f8d /src/dbus
parent44a1782a9bb6b2db8847ab332682b3af386e67ae (diff)
Apply Q_CONSTINIT where beneficial
Applied Q_CONSTINIT to variables with static storage duration, but skipped the POD types with core constant initializers. Task-number: QTBUG-100486 Change-Id: Iaabf824e9cb0f29a405a149912200d4e4b3573c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusintegrator.cpp2
-rw-r--r--src/dbus/qdbusmetatype.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index e9b4bd0b1d..710dfb286f 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -50,7 +50,7 @@ QT_IMPL_METATYPE_EXTERN(QDBusSlotCache)
// used with dbus_server_allocate_data_slot
static dbus_int32_t server_slot = -1;
-static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1);
+Q_CONSTINIT static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1);
#define qDBusDebug if (::isDebugging.loadRelaxed() == 0); else qDebug
static inline QDebug operator<<(QDebug dbg, const QThread *th)
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 6f710bab87..8b96253039 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -48,7 +48,7 @@ public:
void QDBusMetaTypeId::init()
{
- static QBasicAtomicInt initialized = Q_BASIC_ATOMIC_INITIALIZER(false);
+ Q_CONSTINIT static QBasicAtomicInt initialized = Q_BASIC_ATOMIC_INITIALIZER(false);
// reentrancy is not a problem since everything else is locked on their own
// set the guard variable at the end