From df33637d3269bc5cd0c55fac153a82491b195d0c Mon Sep 17 00:00:00 2001 From: Tom Dewey Date: Wed, 17 Jul 2024 10:09:59 +0100 Subject: [PATCH] qt6: Replace qAsConst() usage --- src/devicewrapperfatpartition.cpp | 8 ++++---- src/downloadthread.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devicewrapperfatpartition.cpp b/src/devicewrapperfatpartition.cpp index 5696927..249ae4f 100644 --- a/src/devicewrapperfatpartition.cpp +++ b/src/devicewrapperfatpartition.cpp @@ -134,7 +134,7 @@ uint32_t DeviceWrapperFatPartition::allocateCluster(uint32_t previousCluster) void DeviceWrapperFatPartition::setFAT16(uint16_t cluster, uint16_t value) { /* Modify all FATs (usually 2) */ - for (auto fatStart : qAsConst(_fatStartOffset)) + for (auto fatStart : std::as_const(_fatStartOffset)) { seek(fatStart + cluster * 2); write((char *) &value, 2); @@ -146,7 +146,7 @@ void DeviceWrapperFatPartition::setFAT32(uint32_t cluster, uint32_t value) uint32_t prev_value, reserved_bits; /* Modify all FATs (usually 2) */ - for (auto fatStart : qAsConst(_fatStartOffset)) + for (auto fatStart : std::as_const(_fatStartOffset)) { /* Spec (p. 16) mentions we must preserve high 4 bits of FAT32 FAT entry when modifiying */ seek(fatStart + cluster * 4); @@ -234,7 +234,7 @@ QByteArray DeviceWrapperFatPartition::readFile(const QString &filename) uint32_t len = entry.DIR_FileSize, pos = 0; QByteArray result(len, 0); - for (uint32_t cluster : qAsConst(clusterList)) + for (uint32_t cluster : std::as_const(clusterList)) { seekCluster(cluster); read(result.data()+pos, qMin(_bytesPerCluster, len-pos)); @@ -311,7 +311,7 @@ void DeviceWrapperFatPartition::writeFile(const QString &filename, const QByteAr //qDebug() << "First cluster:" << firstCluster << "Clusters:" << clusterList; /* Write file data */ - for (uint32_t cluster : qAsConst(clusterList)) + for (uint32_t cluster : std::as_const(clusterList)) { seekCluster(cluster); write(contents.data()+pos, qMin((qsizetype)_bytesPerCluster, (qsizetype)(contents.length()-pos))); diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp index 73fcda1..3db9c23 100644 --- a/src/downloadthread.cpp +++ b/src/downloadthread.cpp @@ -921,7 +921,7 @@ bool DownloadThread::_customizeImage() configItems.removeAll(""); QByteArray config = fat->readFile("config.txt"); - for (const QByteArray& item : qAsConst(configItems)) + for (const QByteArray& item : std::as_const(configItems)) { if (config.contains("#"+item)) { /* Uncomment existing line */