From 59a6ea0e4bde610dd55f735367a1097b79cc4383 Mon Sep 17 00:00:00 2001 From: Arvid Ephraim Picciani Date: Fri, 22 Oct 2010 17:10:35 +0200 Subject: Fix compiler warnings in qelfparser from magical conversion to signed int in arithmetics Reviewed-by: Friedemann Kleint --- src/corelib/plugin/qelfparser_p.cpp | 4 ++-- src/corelib/plugin/qlibrary.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index 2e77ae7..4ae7f85 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -139,7 +139,7 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library qelfhalf_t e_shtrndx = read (data); data += sizeof(qelfhalf_t); // e_shtrndx - if ((e_shnum * e_shentsize) > fdlen) { + if ((quint32)(e_shnum * e_shentsize) > fdlen) { if (lib) lib->errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)").arg(library) .arg(QLatin1String("announced %2 sections, each %3 bytes, exceed file size")) @@ -165,7 +165,7 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library parseSectionHeader(dataStart + soff, &strtab); m_stringTableFileOffset = strtab.offset; - if ((m_stringTableFileOffset + e_shentsize) >= fdlen || m_stringTableFileOffset == 0) { + if ((quint32)(m_stringTableFileOffset + e_shentsize) >= fdlen || m_stringTableFileOffset == 0) { if (lib) lib->errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)").arg(library) .arg(QLatin1String("string table seems to be at %1")) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 5683c66..fc8721c 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -1,3 +1,4 @@ + /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). @@ -385,7 +386,7 @@ static bool qt_unix_query(const QString &library, uint *version, bool *debug, QB } } else if (r != QElfParser::Ok) { if (lib && qt_debug_component()) { - qWarning(qPrintable(lib->errorString)); + qWarning("QElfParser: %s",qPrintable(lib->errorString)); } return false; } -- cgit v0.12