diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-05 08:45:47 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-05 19:57:34 +0000 |
commit | e7a846b61d4635a1524fa16ce029ce47bc378c7e (patch) | |
tree | 3e59a46f50b7a3c35922ad584209fa902ee3482f /src | |
parent | cf00f2a1d967e8413d138ffe010e6928b469cb30 (diff) |
ShaderData: fix unnecessary cast between enums
QVariant::Type and QMetaType::Type are in sync, but static checkers
don't know this, so they complain about mixed-enum type conversions.
It turns out that the code is overly complicated. Instead of casting
QVariant::type()'s return value to QMetaType::Type and comparing it
against QMetaType::QVector3D, simply compare directly to QVariant::
Vector3D instead.
Introduced in 1e0fb6c74d81a5b6c17a7f127566e4fb8ed2f28b.
Coverity-Id: 168163
Change-Id: I563bebcf869555238db0135125e221ba12ed41ae
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/render/materialsystem/shaderdata.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/materialsystem/shaderdata.cpp b/src/render/materialsystem/shaderdata.cpp index e7c8a1c37..fec1e66ac 100644 --- a/src/render/materialsystem/shaderdata.cpp +++ b/src/render/materialsystem/shaderdata.cpp @@ -113,7 +113,7 @@ void ShaderData::initializeFromPeer(const QNodeCreatedChangeBasePtr &change) const QHash<QString, QVariant>::iterator end = m_originalProperties.end(); while (it != end) { - if (static_cast<QMetaType::Type>(it.value().type()) == QMetaType::QVector3D) { + if (it.value().type() == QVariant::Vector3D) { // if there is a matching QShaderData::TransformType propertyTransformed QVariant value = m_originalProperties.value(it.key() + QLatin1String("Transformed")); // if that's the case, we apply a space transformation to the property |