diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:44:06 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-10 20:28:09 +0200 |
commit | 2303ee38ead0a4eafa9f8af629fd8495c45d1442 (patch) | |
tree | 7452bd4541af302a6749881b7fdef0f1c7283990 /src/hardwareintegration | |
parent | 7f0d702f4e568790dfdfd916fa3c2da5ec78c6df (diff) | |
download | qtwayland-2303ee38ead0a4eafa9f8af629fd8495c45d1442.tar.gz |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: Ia64c6615ee81f7ad5d0658449b0ee347c3db8c29
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/hardwareintegration')
-rw-r--r-- | src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp | 4 | ||||
-rw-r--r-- | src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp b/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp index 4cb6bb28..c30bf5ae 100644 --- a/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp +++ b/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp @@ -162,7 +162,7 @@ wl_kms_buffer *Vsp2Layer::nextKmsBuffer() void Vsp2HardwareLayerIntegration::enableVspLayers() { - for (auto &layer : qAsConst(m_layers)) { + for (auto &layer : std::as_const(m_layers)) { Q_ASSERT(!layer->isEnabled()); layer->enableVspLayer(); } @@ -225,7 +225,7 @@ void Vsp2HardwareLayerIntegration::remove(QWaylandQuickHardwareLayer *hwLayer) void Vsp2HardwareLayerIntegration::sendFrameCallbacks() { - for (auto &layer : qAsConst(m_layers)) { + for (auto &layer : std::as_const(m_layers)) { if (auto *surface = layer->hwLayer()->waylandItem()->surface()) surface->sendFrameCallbacks(); } diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp index dec94e79..f509809e 100644 --- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp +++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.cpp @@ -32,7 +32,7 @@ void LinuxDmabuf::zwp_linux_dmabuf_v1_bind_resource(Resource *resource) // send DRM_FORMAT_MOD_INVALID when no modifiers are supported for a format if (modifiers.isEmpty()) modifiers << DRM_FORMAT_MOD_INVALID; - for (const auto &modifier : qAsConst(modifiers)) { + for (const auto &modifier : std::as_const(modifiers)) { if (resource->version() >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { const uint32_t modifier_lo = modifier & 0xFFFFFFFF; const uint32_t modifier_hi = modifier >> 32; |