diff options
| author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-09 16:34:49 +0100 |
|---|---|---|
| committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-25 19:16:29 +0100 |
| commit | 753a08ae0e1204b148cf3935f87349eefe75d338 (patch) | |
| tree | 193ff5b6a131bba519336c31727d708ddab43032 /src/corelib/plugin/qcoffpeparser.cpp | |
| parent | 1fefff6d1f99dbcf1a453424753ad5562fb675ef (diff) | |
QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicable
As a drive-by, did also minor refactorings/improvements.
Task-number: QTBUG-98434
Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Diffstat (limited to 'src/corelib/plugin/qcoffpeparser.cpp')
| -rw-r--r-- | src/corelib/plugin/qcoffpeparser.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/plugin/qcoffpeparser.cpp b/src/corelib/plugin/qcoffpeparser.cpp index 15d1f644269..1ebca08c322 100644 --- a/src/corelib/plugin/qcoffpeparser.cpp +++ b/src/corelib/plugin/qcoffpeparser.cpp @@ -49,14 +49,15 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + // Whether we include some extra validity checks // (checks to ensure we don't read out-of-bounds are always included) static constexpr bool IncludeValidityChecks = true; -static constexpr char rawSectionName[] = ".qtmetadata"; -static constexpr QLatin1String metadataSectionName(rawSectionName, sizeof(rawSectionName) - 1); +static constexpr inline auto metadataSectionName() noexcept { return ".qtmetadata"_L1; } static constexpr QLatin1String truncatedSectionName = - metadataSectionName.left(sizeof(IMAGE_SECTION_HEADER::Name)); + metadataSectionName().left(sizeof(IMAGE_SECTION_HEADER::Name)); #ifdef QT_BUILD_INTERNAL # define QCOFFPEPARSER_DEBUG @@ -389,7 +390,7 @@ QLibraryScanResult QCoffPeParser::parse(QByteArrayView data, QString *errMsg) continue; // if we do have a string table, the name may be complete - if (sectionName != truncatedSectionName && sectionName != metadataSectionName) + if (sectionName != truncatedSectionName && sectionName != metadataSectionName()) continue; peDebug << "found .qtmetadata section"; |
