Add Q_UNUSED for reserved fields.

Prevents the following compiler errors with Clang

src/quick/scenegraph/coreapi/qsggeometry.h:183:10: error: private field
      'm_reserved_bits' is not used [-Werror,-Wunused-private-field]
    uint m_reserved_bits : 25;
         ^
 src/quick/scenegraph/util/qsgsimplerectnode.h:66:11: error: private field
      'reserved' is not used [-Werror,-Wunused-private-field]
    void *reserved;
          ^
 src/quick/items/qquickclipnode_p.h:66:10: error: private field 'm_reserved' is not
      used [-Werror,-Wunused-private-field]
    uint m_reserved : 31;
         ^
 src/quick/scenegraph/coreapi/qsgmaterial.h:143:11: error: private field
      'm_reserved' is not used [-Werror,-Wunused-private-field]
    void *m_reserved;
          ^
 src/quick/scenegraph/coreapi/qsgnode.h:267:10: error: private field 'm_reserved'
      is not used [-Werror,-Wunused-private-field]
    uint m_reserved : 31;

Change-Id: I0ea00fbd4b45156dedabfd16a3cb3e5f6170f2ff
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
This commit is contained in:
Alan Alpert 2013-09-10 00:38:55 -07:00 committed by The Qt Project
parent 84e83e5ab5
commit d68e1bc836
5 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,7 @@ QQuickDefaultClipNode::QQuickDefaultClipNode(const QRectF &rect)
, m_dirty_geometry(true)
, m_geometry(QSGGeometry::defaultAttributes_Point2D(), 0)
{
Q_UNUSED(m_reserved);
setGeometry(&m_geometry);
setIsRectangular(true);
}

View File

@ -406,6 +406,7 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
, m_vertex_usage_pattern(AlwaysUploadPattern)
, m_line_width(1.0)
{
Q_UNUSED(m_reserved_bits);
Q_ASSERT(m_attributes.count > 0);
Q_ASSERT(m_attributes.stride > 0);

View File

@ -166,6 +166,7 @@ static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
*/
QSGMaterialShader::QSGMaterialShader()
{
Q_UNUSED(m_reserved);
}
/*!
@ -544,6 +545,7 @@ static void qt_print_material_count()
QSGMaterial::QSGMaterial()
: m_flags(0)
{
Q_UNUSED(m_reserved);
#ifndef QT_NO_DEBUG
if (qsg_leak_check) {
++qt_material_count;

View File

@ -1053,6 +1053,7 @@ void QSGGeometryNode::setInheritedOpacity(qreal opacity)
QSGClipNode::QSGClipNode()
: QSGBasicGeometryNode(ClipNodeType)
{
Q_UNUSED(m_reserved);
}

View File

@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
QSGSimpleRectNode::QSGSimpleRectNode(const QRectF &rect, const QColor &color)
: m_geometry(QSGGeometry::defaultAttributes_Point2D(), 4)
{
Q_UNUSED(reserved);
QSGGeometry::updateRectGeometry(&m_geometry, rect);
m_material.setColor(color);
setMaterial(&m_material);