diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-07 14:35:47 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-07-09 00:12:37 +0000 |
commit | f35be0bc5afe940bb95695a319176e45fec1f594 (patch) | |
tree | f6e610550a3efbbaea02b177c8fab526416e1515 /src/qml/qml/qqmlproperty.cpp | |
parent | f558bc48585c69de36151248c969a484a969ebb4 (diff) |
QtQml: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.
Change-Id: Ia0aac2f09e9245339951ffff13c958364a2e9859
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index ae452b727e..800f650075 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1304,12 +1304,12 @@ bool QQmlPropertyPrivate::write(QObject *object, QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, argv); } else if (variantType == propertyType) { - void *a[] = { (void *)value.constData(), 0, &status, &flags }; + void *a[] = { const_cast<void *>(value.constData()), 0, &status, &flags }; QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a); } else if (qMetaTypeId<QVariant>() == propertyType) { - void *a[] = { (void *)&value, 0, &status, &flags }; + void *a[] = { const_cast<QVariant *>(&value), 0, &status, &flags }; QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a); } else if (property.isQObject()) { @@ -1319,7 +1319,7 @@ bool QQmlPropertyPrivate::write(QObject *object, if (valMo.isNull()) return false; - QObject *o = *(QObject **)value.constData(); + QObject *o = *(QObject *const *)value.constData(); QQmlMetaObject propMo = rawMetaObjectForType(enginePriv, propertyType); if (o) valMo = o; @@ -1465,7 +1465,7 @@ bool QQmlPropertyPrivate::write(QObject *object, } if (ok) { - void *a[] = { (void *)v.constData(), 0, &status, &flags}; + void *a[] = { const_cast<void *>(v.constData()), 0, &status, &flags}; QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a); } else { return false; @@ -1603,7 +1603,7 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object, const char *propertyType = 0; if (value.userType() == QMetaType::QObjectStar) { - if (QObject *o = *(QObject **)value.constData()) { + if (QObject *o = *(QObject *const *)value.constData()) { valueType = o->metaObject()->className(); QQmlMetaObject propertyMetaObject = rawMetaObjectForType(QQmlEnginePrivate::get(engine), type); |