From 109103e69b51b014e4720a70044faee03ad495f8 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 30 Sep 2025 15:22:48 +0300 Subject: util/unicode: use prinft-style syntax with qDebug() The QDebug streaming operators would expand to more code. We can also remove the qdebug.h include (with all the other transitive includes that brings) which may make compiling faster. Explicitly include qmap.h, which used to be included transitively. Pick-to: 6.10 6.8 6.5 Change-Id: Ic2039e7b18801876c42e043d56c34e2220f3a46f Reviewed-by: Marc Mutz --- util/unicode/main.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'util/unicode/main.cpp') diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index 72fcd2335b2..ffd7d185905 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -3,10 +3,10 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -2256,7 +2256,7 @@ static void readIdnaMappingTable() // Some deviations have empty mappings, others should not... if (mapping.isEmpty()) { Q_ASSERT(rawStatus == IdnaRawStatus::Deviation); - qDebug() << " Empty IDNA mapping for" << fields[0]; + qDebug(" Empty IDNA mapping for: %.*s", qPrintableView(fields[0])); } break; @@ -2319,7 +2319,7 @@ static void resolveIdnaStatus() } if (allow) { - qDebug() << " Allowing" << Qt::hex << codepoint; + qDebug(" Allowing %x", codepoint); ud.p.idnaStatus = IdnaStatus::Mapped; } else { ud.p.idnaStatus = IdnaStatus::Disallowed; @@ -2480,8 +2480,8 @@ static QByteArray createIdnaMapping() } QString idnaMappingData = buildSuperstring(std::move(values)); - qDebug() << " uncompressed size:" << uncompressedSize << "characters"; - qDebug() << " consolidated size:" << idnaMappingData.size() << "characters"; + qDebug(" uncompressed size: %lld characters", qlonglong(uncompressedSize)); + qDebug(" consolidated size: %lld characters", qlonglong(idnaMappingData.size())); qsizetype memoryUsage = 0; @@ -2536,7 +2536,7 @@ static QByteArray createIdnaMapping() memoryUsage += 8; } - qDebug() << " memory usage:" << memoryUsage << "bytes"; + qDebug(" memory usage: %lld bytes", qlonglong(memoryUsage)); out += "};\n\n" @@ -3322,7 +3322,6 @@ QByteArray createCasingInfo() return out; } - int main(int, char **) { initAgeMap(); @@ -3438,11 +3437,11 @@ int main(int, char **) "#endif // QUNICODETABLES_P_H\n"); f.close(); - qDebug() << "maxMirroredDiff = " << Qt::hex << maxMirroredDiff; - qDebug() << "maxLowerCaseDiff = " << Qt::hex << maxLowerCaseDiff; - qDebug() << "maxUpperCaseDiff = " << Qt::hex << maxUpperCaseDiff; - qDebug() << "maxTitleCaseDiff = " << Qt::hex << maxTitleCaseDiff; - qDebug() << "maxCaseFoldDiff = " << Qt::hex << maxCaseFoldDiff; + qDebug("maxMirroredDiff = %x", maxMirroredDiff); + qDebug("maxLowerCaseDiff = %x", maxLowerCaseDiff); + qDebug("maxUpperCaseDiff = %x", maxUpperCaseDiff); + qDebug("maxTitleCaseDiff = %x", maxTitleCaseDiff); + qDebug("maxCaseFoldDiff = %x", maxCaseFoldDiff); #if 0 // dump(0, 0x7f); // dump(0x620, 0x640); -- cgit v1.2.3