Mark Q_UNUSED the private members that aren't used

Apple Clang 4.2 has a new warning, letting you know when a private
member isn't used by any member function (and, I guess, if the class
has no friends):

  private field 'd' is not used [-Werror,-Wunused-private-field]

Qt has a few of those for future expansion. It's not an error for us.

Change-Id: Id2edb1159589572f97a07f93181c9c96c5dd983c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Thiago Macieira 2013-03-21 13:51:51 -07:00 committed by The Qt Project
parent 1622dca213
commit caffabc798
4 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
*/
QAbstractNativeEventFilter::QAbstractNativeEventFilter()
{
Q_UNUSED(d);
}
/*!

View File

@ -164,6 +164,7 @@ QByteArrayMatcher::QByteArrayMatcher(const QByteArrayMatcher &other)
*/
QByteArrayMatcher::~QByteArrayMatcher()
{
Q_UNUSED(d);
}
/*!

View File

@ -198,6 +198,7 @@ QStringMatcher::QStringMatcher(const QStringMatcher &other)
*/
QStringMatcher::~QStringMatcher()
{
Q_UNUSED(d_ptr);
}
/*!

View File

@ -229,6 +229,7 @@ QTextBoundaryFinder &QTextBoundaryFinder::operator=(const QTextBoundaryFinder &o
*/
QTextBoundaryFinder::~QTextBoundaryFinder()
{
Q_UNUSED(unused);
if (freePrivate)
free(d);
}