diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-08-31 16:08:30 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-09-01 19:44:19 +0200 |
commit | 711105058afe68407a0ed613335a83b6181112ed (patch) | |
tree | 82f549dafc18558cf0801e67b1ebfd18c8d73f8d /src/plugins/platforms/cocoa | |
parent | 44a1782a9bb6b2db8847ab332682b3af386e67ae (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/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qmultitouch_mac.mm | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 38cae4c432..a65311175f 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -417,7 +417,7 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface) // NSOpenGLContext is not re-entrant. Even when using separate contexts per thread, // view, and window, calls into the API will still deadlock. For more information // see https://openradar.appspot.com/37064579 -static QMutex s_reentrancyMutex; +Q_CONSTINIT static QMutex s_reentrancyMutex; void QCocoaGLContext::update() { diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm index 73d103c5e3..f818b04acd 100644 --- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm +++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm @@ -12,10 +12,10 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -QHash<qint64, QCocoaTouch*> QCocoaTouch::_currentTouches; -QHash<quint64, QPointingDevice*> QCocoaTouch::_touchDevices; -QPointF QCocoaTouch::_screenReferencePos; -QPointF QCocoaTouch::_trackpadReferencePos; +Q_CONSTINIT QHash<qint64, QCocoaTouch*> QCocoaTouch::_currentTouches; +Q_CONSTINIT QHash<quint64, QPointingDevice*> QCocoaTouch::_touchDevices; +Q_CONSTINIT QPointF QCocoaTouch::_screenReferencePos; +Q_CONSTINIT QPointF QCocoaTouch::_trackpadReferencePos; int QCocoaTouch::_idAssignmentCount = 0; int QCocoaTouch::_touchCount = 0; bool QCocoaTouch::_updateInternalStateOnly = true; |