aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authoraavit <eirik.aavitsland@digia.com>2014-03-17 16:30:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 10:13:00 +0100
commit8c1864296e1254d61c8c8e761ad94529ef368ec6 (patch)
treea01b5d77057de9834ecc25acd33a531675003a3f /src/qml/compiler
parent354d3a17e2a772c467343a47f7b328ea8482f7fa (diff)
Compilation fix
gcc 4.6 chokes on this construct. Replace with a shorter and more readable one :) Change-Id: I02ff7a2c5300de656e61ee5ca8effabdd74991bb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index 43157930fd..0b9f9faf09 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1666,6 +1666,11 @@ QQmlBinding::Identifier QQmlPropertyValidator::bindingIdentifier(const QV4::Comp
typedef QVarLengthArray<const QV4::CompiledData::Binding *, 8> GroupPropertyVector;
+static bool compareNameIndices(const QV4::CompiledData::Binding *binding, quint32 name)
+{
+ return binding->propertyNameIndex < name;
+}
+
bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledData::Binding *instantiatingBinding, bool populatingValueTypeGroupProperty)
{
const QV4::CompiledData::Object *obj = qmlUnit->objectAt(objectIndex);
@@ -1696,12 +1701,6 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD
QQmlCustomParser *customParser = customParsers.value(obj->inheritedTypeNameIndex);
QList<const QV4::CompiledData::Binding*> customBindings;
- struct GroupPropertyFinder {
- bool operator()(const QV4::CompiledData::Binding *binding, quint32 name) const {
- return binding->propertyNameIndex < name;
- }
- };
-
// Collect group properties first for sanity checking
// vector values are sorted by property name string index.
GroupPropertyVector groupProperties;
@@ -1718,7 +1717,7 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD
return false;
}
- GroupPropertyVector::const_iterator pos = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, GroupPropertyFinder());
+ GroupPropertyVector::const_iterator pos = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, compareNameIndices);
groupProperties.insert(pos, binding);
}
@@ -1836,7 +1835,7 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD
}
if (pd) {
- GroupPropertyVector::const_iterator assignedGroupProperty = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, GroupPropertyFinder());
+ GroupPropertyVector::const_iterator assignedGroupProperty = std::lower_bound(groupProperties.constBegin(), groupProperties.constEnd(), binding->propertyNameIndex, compareNameIndices);
const bool assigningToGroupProperty = assignedGroupProperty != groupProperties.constEnd() && !(binding->propertyNameIndex < (*assignedGroupProperty)->propertyNameIndex);
if (!pd->isWritable()