Fix ICC warnings about functions declared but not used

Added Q_DECL_UNUSED for the function used in Q_ASSERT; removed the
functions that really weren't used and added the #ifdef for the
function that was only used under #ifdef.

qmetaobjectbuilder.cpp(93): warning #177: function "priv" was declared but never referenced
qobject.cpp(2349): warning #177: function "check_and_warn_compat" was declared but never referenced
qpathsimplifier.cpp(141): error #177: function "<unnamed>::Rational::isValid" was declared but never referenced
qtextengine.cpp(2584): error #177: function "<unnamed>::QScriptItemComparator::operator()(const QScriptItem &, const QScriptItem &)" was declared but never referenced

Change-Id: I89a140d59211f10ecd88d751f0bcc0ea2fedff7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Thiago Macieira 2013-08-29 23:30:42 -07:00 committed by The Qt Project
parent f62b05ccf1
commit 7ac6ce2133
4 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ Q_CORE_EXPORT bool isBuiltinType(const QByteArray &type)
} // namespace QtPrivate } // namespace QtPrivate
// copied from qmetaobject.cpp // copied from qmetaobject.cpp
static inline const QMetaObjectPrivate *priv(const uint* data) static inline Q_DECL_UNUSED const QMetaObjectPrivate *priv(const uint* data)
{ return reinterpret_cast<const QMetaObjectPrivate*>(data); } { return reinterpret_cast<const QMetaObjectPrivate*>(data); }
class QMetaMethodBuilderPrivate class QMetaMethodBuilderPrivate

View File

@ -2346,6 +2346,7 @@ void QMetaObjectPrivate::memberIndexes(const QObject *obj,
} }
} }
#ifndef QT_NO_DEBUG
static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaMethod &signal, static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaMethod &signal,
const QMetaObject *receiver, const QMetaMethod &method) const QMetaObject *receiver, const QMetaMethod &method)
{ {
@ -2360,6 +2361,7 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM
receiver->className(), method.methodSignature().constData()); receiver->className(), method.methodSignature().constData());
} }
} }
#endif
/*! /*!
\threadsafe \threadsafe

View File

@ -138,7 +138,6 @@ Fraction fraction(unsigned int n, unsigned int d) {
struct Rational struct Rational
{ {
bool isValid() const { return fraction.isValid(); }
int integer; int integer;
Fraction fraction; Fraction fraction;
}; };

View File

@ -2581,7 +2581,6 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
namespace { namespace {
struct QScriptItemComparator { struct QScriptItemComparator {
bool operator()(const QScriptItem &a, const QScriptItem &b) { return a.position < b.position; }
bool operator()(int p, const QScriptItem &b) { return p < b.position; } bool operator()(int p, const QScriptItem &b) { return p < b.position; }
#if defined(Q_CC_MSVC) && _MSC_VER < 1600 #if defined(Q_CC_MSVC) && _MSC_VER < 1600
//The STL implementation of MSVC 2008 requires the definition //The STL implementation of MSVC 2008 requires the definition