summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-09-10 20:04:38 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-09-13 20:59:50 -0700
commit55e565c763cdd381904d9378b8a668331c4e40f5 (patch)
treef187b6831a92298790793d2b31d5ffd8182d717d
parent96d21faa0156bbf0707b6ef1642245fdd2d55d00 (diff)
QElfParser: don't use int for the enum
An enum shows the proper values in the debugger... Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a3a5848196983c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
-rw-r--r--src/corelib/plugin/qelfparser_p.cpp3
-rw-r--r--src/corelib/plugin/qelfparser_p.h4
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp
index 777eed3c34..84373795f6 100644
--- a/src/corelib/plugin/qelfparser_p.cpp
+++ b/src/corelib/plugin/qelfparser_p.cpp
@@ -63,7 +63,8 @@ const char *QElfParser::parseSectionHeader(const char *data, ElfSectionHeader *s
return data;
}
-int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library, QLibraryPrivate *lib, qsizetype *pos, qsizetype *sectionlen)
+auto QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library,
+ QLibraryPrivate *lib, qsizetype *pos, qsizetype *sectionlen) -> ScanResult
{
#if defined(QELFPARSER_DEBUG)
qDebug() << "QElfParser::parse " << library;
diff --git a/src/corelib/plugin/qelfparser_p.h b/src/corelib/plugin/qelfparser_p.h
index 72ee30d282..796b987eb3 100644
--- a/src/corelib/plugin/qelfparser_p.h
+++ b/src/corelib/plugin/qelfparser_p.h
@@ -71,7 +71,7 @@ typedef quintptr qelfaddr_t;
class QElfParser
{
public:
- enum { QtMetaDataSection, NoQtSection, NotElf, Corrupt };
+ enum ScanResult { QtMetaDataSection, NoQtSection, NotElf, Corrupt };
enum { ElfLittleEndian = 0, ElfBigEndian = 1 };
struct ElfSectionHeader
@@ -96,7 +96,7 @@ public:
}
const char *parseSectionHeader(const char* s, ElfSectionHeader *sh);
- int parse(const char *m_s, ulong fdlen, const QString &library, QLibraryPrivate *lib, qsizetype *pos, qsizetype *sectionlen);
+ ScanResult parse(const char *m_s, ulong fdlen, const QString &library, QLibraryPrivate *lib, qsizetype *pos, qsizetype *sectionlen);
};
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 810cbc5a79..e3783c9cb4 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -274,7 +274,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
pattern[0] = 'Q'; // Ensure the pattern "QTMETADATA" is not found in this library should QPluginLoader ever encounter it.
const ulong plen = ulong(qstrlen(pattern));
#if defined (Q_OF_ELF) && defined(Q_CC_GNU)
- int r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);
+ QElfParser::ScanResult r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);
if (r == QElfParser::Corrupt || r == QElfParser::NotElf) {
if (lib && qt_debug_component()) {
qWarning("QElfParser: %ls", qUtf16Printable(lib->errorString));