From 32692667a625f31aa02e0303f2139c780ae42694 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 17 Mar 2022 12:07:44 +0100 Subject: Apply Q_CONSTINIT across the codebase Still not complete. Just grepping for static and thread_local. Task-number: QTBUG-100486 Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3 Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/text/qlocale.cpp') diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index dd92cfe354..6a191dfce6 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; #ifndef QT_NO_SYSTEMLOCALE -static QSystemLocale *_systemLocale = nullptr; +Q_CONSTINIT static QSystemLocale *_systemLocale = nullptr; class QSystemLocaleSingleton: public QSystemLocale { public: @@ -95,7 +95,7 @@ public: }; Q_GLOBAL_STATIC(QSystemLocaleSingleton, QSystemLocale_globalSystemLocale) -static QLocaleData systemLocaleData; +Q_CONSTINIT static QLocaleData systemLocaleData = {}; #endif /****************************************************************************** @@ -695,7 +695,7 @@ int qt_repeatCount(QStringView s) return int(j); } -static const QLocaleData *default_data = nullptr; +Q_CONSTINIT static const QLocaleData *default_data = nullptr; static const QLocaleData *const c_data = locale_data; static QLocalePrivate *c_private() @@ -852,7 +852,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) static const int locale_data_size = sizeof(locale_data)/sizeof(QLocaleData) - 1; -QBasicAtomicInt QLocalePrivate::s_generation = Q_BASIC_ATOMIC_INITIALIZER(0); +Q_CONSTINIT QBasicAtomicInt QLocalePrivate::s_generation = Q_BASIC_ATOMIC_INITIALIZER(0); Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer, defaultLocalePrivate, (new QLocalePrivate(defaultData(), defaultIndex()))) -- cgit v1.2.3