From 57960ab075b9e7a471c42ddea6a2abbc2994ec83 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 12 Sep 2021 20:07:40 -0700 Subject: Q{Elf,Mach}Parser: simplify the return codes The multi-state return code was a legacy of how Arvid wrote the ELF parser code back in the day, the fact that it scanned for two different types of plugins in Qt 4 and that the metadata could exist in different places. None of that matters nowadays: who cares if the file is a corrupt binary, not a valid binary, does not have the right architecture, or has no suitable section? It's not a plugin, period. The Qt 4 plugin mechanism was removed for Qt 5.0 in commit 7443895857fdaee132c8efc643e471f02b3d0fa4 ("Remove support for Qt 4 style plugins"). Change-Id: I42eb903a916645db9900fffd16a442d800399b98 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/corelib/plugin/qmachparser_p.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/corelib/plugin/qmachparser_p.h') diff --git a/src/corelib/plugin/qmachparser_p.h b/src/corelib/plugin/qmachparser_p.h index 290b68876f..499c63aa94 100644 --- a/src/corelib/plugin/qmachparser_p.h +++ b/src/corelib/plugin/qmachparser_p.h @@ -51,8 +51,7 @@ // We mean it. // -#include -#include +#include "qlibrary_p.h" QT_REQUIRE_CONFIG(library); @@ -66,8 +65,8 @@ class QLibraryPrivate; class Q_AUTOTEST_EXPORT QMachOParser { public: - enum { QtMetaDataSection, NoQtSection, NotSuitable }; - static int parse(const char *m_s, ulong fdlen, const QString &library, QString *errorString, qsizetype *pos, qsizetype *sectionlen); + static QLibraryScanResult parse(const char *m_s, ulong fdlen, const QString &library, + QString *errorString); }; QT_END_NAMESPACE -- cgit v1.2.3