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/thread/qthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/thread/qthread.cpp') diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 994d77926c..edff18fcf5 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -176,7 +176,7 @@ QThreadPrivate::QThreadPrivate(QThreadData *d) #ifdef Q_OS_INTEGRITY stackSize = 128 * 1024; #elif defined(Q_OS_RTEMS) - static bool envStackSizeOk = false; + Q_CONSTINIT static bool envStackSizeOk = false; static const int envStackSize = qEnvironmentVariableIntValue("QT_DEFAULT_THREAD_STACK_SIZE", &envStackSizeOk); if (envStackSizeOk) stackSize = envStackSize; @@ -923,7 +923,7 @@ bool QThread::isRunning() const } // No threads: so we can just use static variables -static QThreadData *data = nullptr; +Q_CONSTINIT static QThreadData *data = nullptr; QThreadData *QThreadData::current(bool createIfNecessary) { -- cgit v1.2.3