diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-01-23 11:34:46 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-02-03 21:48:19 +0100 |
commit | 438096371c32ea6fdcd31d6d4ad2b6d3f29fab71 (patch) | |
tree | 7d1e8d94c47b439d3c3a1f0de9b4365d20edce72 /src/gui/util | |
parent | 03ac8c7397b9f070a8ef5f33b4675411293b0723 (diff) |
QtGui: Disambiguate static variables
They cause clashes in CMake Unity (Jumbo) builds.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I3c51fb41d29e5c649537b999dced7e2d413b26a7
Done-with: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qktxhandler.cpp | 12 | ||||
-rw-r--r-- | src/gui/util/qpkmhandler.cpp | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/util/qktxhandler.cpp b/src/gui/util/qktxhandler.cpp index f7e0e60330..f04da929c3 100644 --- a/src/gui/util/qktxhandler.cpp +++ b/src/gui/util/qktxhandler.cpp @@ -41,7 +41,7 @@ struct KTXHeader { quint32 bytesOfKeyValueData; }; -static const quint32 headerSize = sizeof(KTXHeader); +static const quint32 qktxh_headerSize = sizeof(KTXHeader); // Currently unused, declared for future reference struct KTXKeyValuePairItem { @@ -94,7 +94,7 @@ QTextureFileData QKtxHandler::read() const QByteArray buf = device()->readAll(); const quint32 dataSize = quint32(buf.size()); - if (dataSize < headerSize || !canRead(QByteArray(), buf)) { + if (dataSize < qktxh_headerSize || !canRead(QByteArray(), buf)) { qCDebug(lcQtGuiTextureIO, "Invalid KTX file %s", logName().constData()); return QTextureFileData(); } @@ -117,10 +117,10 @@ QTextureFileData QKtxHandler::read() texData.setNumFaces(decode(header->numberOfFaces)); const quint32 bytesOfKeyValueData = decode(header->bytesOfKeyValueData); - if (headerSize + bytesOfKeyValueData < quint64(buf.size())) // oob check - texData.setKeyValueMetadata( - decodeKeyValues(QByteArrayView(buf.data() + headerSize, bytesOfKeyValueData))); - quint32 offset = headerSize + bytesOfKeyValueData; + if (qktxh_headerSize + bytesOfKeyValueData < quint64(buf.size())) // oob check + texData.setKeyValueMetadata(decodeKeyValues( + QByteArrayView(buf.data() + qktxh_headerSize, bytesOfKeyValueData))); + quint32 offset = qktxh_headerSize + bytesOfKeyValueData; constexpr int MAX_ITERATIONS = 32; // cap iterations in case of corrupt data diff --git a/src/gui/util/qpkmhandler.cpp b/src/gui/util/qpkmhandler.cpp index 7b0fb020df..d84ce2ce7f 100644 --- a/src/gui/util/qpkmhandler.cpp +++ b/src/gui/util/qpkmhandler.cpp @@ -13,7 +13,7 @@ QT_BEGIN_NAMESPACE -static const int headerSize = 16; +static const int qpkmh_headerSize = 16; struct PkmType { @@ -46,7 +46,7 @@ QTextureFileData QPkmHandler::read() return texData; QByteArray fileData = device()->readAll(); - if (fileData.size() < headerSize || !canRead(QByteArray(), fileData)) { + if (fileData.size() < qpkmh_headerSize || !canRead(QByteArray(), fileData)) { qCDebug(lcQtGuiTextureIO, "Invalid PKM file %s", logName().constData()); return QTextureFileData(); } @@ -75,7 +75,7 @@ QTextureFileData QPkmHandler::read() QSize texSize(qFromBigEndian<quint16>(rawData + 12), qFromBigEndian<quint16>(rawData + 14)); texData.setSize(texSize); - texData.setDataOffset(headerSize); + texData.setDataOffset(qpkmh_headerSize); if (!texData.isValid()) { qCDebug(lcQtGuiTextureIO, "Invalid values in header of PKM file %s", logName().constData()); |