Skip to content

Commit

Permalink
Declarative: Fix gcc 4.6 warnings about assigned/unused variables.
Browse files Browse the repository at this point in the history
Change-Id: Iac4bb4a6b1aa4071a239bb25f25f01b71e36868b
Reviewed-by: Alexis Menard <alexis.menard@openbossa.org>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
  • Loading branch information
Friedemann Kleint authored and Qt by Nokia committed Nov 1, 2011
1 parent 8006625 commit c29b3c0
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/declarative/items/context2d/qquickcontext2d.cpp
Expand Up @@ -120,6 +120,7 @@ QColor qt_color_from_string(v8::Local<v8::Value> name)
return QColor(p);
else {
bool isRgb(false), isHsl(false), hasAlpha(false);
Q_UNUSED(isHsl)

while (isspace(*p)) p++;
if (strncmp(p, "rgb", 3) == 0)
Expand Down
1 change: 0 additions & 1 deletion src/declarative/items/qquickitemview.cpp
Expand Up @@ -1146,7 +1146,6 @@ qreal QQuickItemViewPrivate::endPosition() const

qreal QQuickItemViewPrivate::contentStartPosition() const
{
Q_Q(const QQuickItemView);
qreal pos = -headerSize();
if (layoutOrientation() == Qt::Vertical)
pos -= vData.startMargin;
Expand Down
2 changes: 0 additions & 2 deletions src/declarative/items/qquicklistview.cpp
Expand Up @@ -2321,8 +2321,6 @@ void QQuickListView::updateSections()

bool QQuickListViewPrivate::applyInsertionChange(const QDeclarativeChangeSet::Insert &change, FxViewItem *firstVisible, InsertionsResult *insertResult)
{
Q_Q(QQuickListView);

int modelIndex = change.index;
int count = change.count;

Expand Down
1 change: 1 addition & 0 deletions src/declarative/items/qquickshadereffectmesh.cpp
Expand Up @@ -76,6 +76,7 @@ QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, const QVector

if (!geometry) {
bool error = true;
Q_UNUSED(error)
switch (attrCount) {
case 0:
qWarning("QQuickGridMesh:: No attributes specified.");
Expand Down
3 changes: 1 addition & 2 deletions src/declarative/items/qquickspriteimage.cpp
Expand Up @@ -151,7 +151,7 @@ QQuickSpriteMaterial::~QQuickSpriteMaterial()
class SpriteMaterialData : public QSGMaterialShader
{
public:
SpriteMaterialData(const char *vertexFile = 0, const char *fragmentFile = 0)
SpriteMaterialData(const char * /* vertexFile */ = 0, const char * /* fragmentFile */ = 0)
{
}

Expand Down Expand Up @@ -438,7 +438,6 @@ void QQuickSpriteImage::prepareNextFrame()
m_material->interpolate = m_interpolate;

//Advance State
SpriteVertices *p = (SpriteVertices *) m_node->geometry()->vertexData();
m_spriteEngine->updateSprites(timeInt);
int curY = m_spriteEngine->spriteY();
if (curY != m_material->animY){
Expand Down
1 change: 0 additions & 1 deletion src/declarative/items/qquicktextedit.cpp
Expand Up @@ -1396,7 +1396,6 @@ void QQuickTextEdit::inputMethodEvent(QInputMethodEvent *event)

void QQuickTextEdit::itemChange(ItemChange change, const ItemChangeData &value)
{
Q_D(QQuickTextEdit);
if (change == ItemActiveFocusHasChanged) {
setCursorVisible(value.boolValue); // ### refactor: focus handling && d->canvas && d->canvas->hasFocus());
}
Expand Down
6 changes: 3 additions & 3 deletions src/declarative/qml/qdeclarativecompiler.cpp
Expand Up @@ -303,23 +303,23 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p
case QVariant::PointF:
{
bool ok;
QPointF point = QDeclarativeStringConverters::pointFFromString(value.asString(), &ok);
QDeclarativeStringConverters::pointFFromString(value.asString(), &ok);
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: point expected"));
}
break;
case QVariant::Size:
case QVariant::SizeF:
{
bool ok;
QSizeF size = QDeclarativeStringConverters::sizeFFromString(value.asString(), &ok);
QDeclarativeStringConverters::sizeFFromString(value.asString(), &ok);
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: size expected"));
}
break;
case QVariant::Rect:
case QVariant::RectF:
{
bool ok;
QRectF rect = QDeclarativeStringConverters::rectFFromString(value.asString(), &ok);
QDeclarativeStringConverters::rectFFromString(value.asString(), &ok);
if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: rect expected"));
}
break;
Expand Down
1 change: 0 additions & 1 deletion src/declarative/qml/qdeclarativeexpression.cpp
Expand Up @@ -506,7 +506,6 @@ QDeclarativeJavaScriptExpression::GuardList::updateGuards(QDeclarativeJavaScript
}

bool outputWarningHeader = false;
bool noChanges = true;
for (int ii = 0; ii < properties.count(); ++ii) {
Endpoint &guard = endpoints[ii];
const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
Expand Down
1 change: 0 additions & 1 deletion src/declarative/qml/qdeclarativeproperty.cpp
Expand Up @@ -1619,7 +1619,6 @@ QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObject, int in
const QMetaObject *subObject, int subIndex,
QDeclarativeEngine *)
{
QMetaProperty prop = metaObject->property(index);
QMetaProperty subProp = subObject->property(subIndex);

QDeclarativePropertyData core;
Expand Down
1 change: 0 additions & 1 deletion src/declarative/qml/v4/qv4irbuilder.cpp
Expand Up @@ -75,7 +75,6 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine,
else if (t == qMetaTypeId<QQuickAnchorLine>())
return IR::SGAnchorLineType;
else if (const QMetaObject *m = engine->metaObjectForType(t)) {
meta = m;
return IR::ObjectType;
}

Expand Down
1 change: 0 additions & 1 deletion src/declarative/qml/v8/qv8qobjectwrapper.cpp
Expand Up @@ -1834,7 +1834,6 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Invoke(const v8::Arguments &args)
}

if (method.coreIndex == -1) {
QMetaMethod mm = object->metaObject()->method(index);
method.load(object->metaObject()->method(index));

if (method.coreIndex == -1)
Expand Down
2 changes: 0 additions & 2 deletions src/declarative/qml/v8/qv8typewrapper.cpp
Expand Up @@ -159,7 +159,6 @@ QVariant QV8TypeWrapper::toVariant(QV8ObjectResource *r)
v8::Handle<v8::Value> QV8TypeWrapper::Getter(v8::Local<v8::String> property,
const v8::AccessorInfo &info)
{
v8::Object::ExternalResource *r = info.This()->GetExternalResource();
QV8TypeResource *resource = v8_resource_cast<QV8TypeResource>(info.This());

if (!resource)
Expand Down Expand Up @@ -257,7 +256,6 @@ v8::Handle<v8::Value> QV8TypeWrapper::Setter(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::AccessorInfo &info)
{
v8::Object::ExternalResource *r = info.This()->GetExternalResource();
QV8TypeResource *resource = v8_resource_cast<QV8TypeResource>(info.This());

if (!resource)
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/scenegraph/coreapi/qsgmaterial.cpp
Expand Up @@ -220,7 +220,7 @@ void QSGMaterialShader::deactivate()
\sa activate(), deactivate()
*/

void QSGMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
void QSGMaterialShader::updateState(const RenderState & /* state */, QSGMaterial * /* newMaterial */, QSGMaterial * /* oldMaterial */)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/qmltest/quicktest.cpp
Expand Up @@ -76,7 +76,7 @@ class QTestRootObject : public QObject
Q_PROPERTY(bool hasTestCase READ hasTestCase WRITE setHasTestCase NOTIFY hasTestCaseChanged)
public:
QTestRootObject(QObject *parent = 0)
: QObject(parent), hasQuit(false), m_hasTestCase(false), m_windowShown(false) {}
: QObject(parent), hasQuit(false), m_windowShown(false), m_hasTestCase(false) {}

bool hasQuit:1;
bool hasTestCase() const { return m_hasTestCase; }
Expand Down
1 change: 0 additions & 1 deletion src/qmltest/quicktestresult.cpp
Expand Up @@ -314,7 +314,6 @@ void QuickTestResult::startLogging()
{
// The program name is used for logging headers and footers if it
// is set. Otherwise the test case name is used.
Q_D(QuickTestResult);
if (loggingStarted)
return;
QTestLog::startLogging();
Expand Down

0 comments on commit c29b3c0

Please sign in to comment.