Fix compilation with clang
authorLars Knoll <lars.knoll@digia.com>
Fri, 28 Jun 2013 10:02:29 +0000 (12:02 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Jun 2013 12:56:41 +0000 (14:56 +0200)
Change-Id: I5884d8f10d9d864578376964e038fa8e477dbff2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4/qv4internalclass.cpp
src/qml/qml/v4/qv4internalclass_p.h

index 635b796..128d4b9 100644 (file)
@@ -55,11 +55,6 @@ uint QV4::qHash(const QV4::InternalClassTransition &t, uint)
 
 using namespace QV4;
 
-static bool operator==(const InternalClassTransition &a, const InternalClassTransition &b)
-{
-    return a.id == b.id && a.flags == b.flags;
-}
-
 static const uchar prime_deltas[] = {
     0,  0,  1,  3,  1,  5,  3,  3,  1,  9,  7,  5,  3,  9, 25,  3,
     1, 21,  3, 21,  7, 15,  9,  5,  3, 29, 15,  0,  0,  0,  0,  0
@@ -156,7 +151,7 @@ InternalClass *InternalClass::changeMember(String *string, PropertyAttributes da
         return this;
 
 
-    Transition t = { string->identifier, data.flags() };
+    Transition t = { string->identifier, (int)data.flags() };
     QHash<Transition, InternalClass *>::const_iterator tit = transitions.constFind(t);
     if (tit != transitions.constEnd())
         return tit.value();
@@ -177,7 +172,7 @@ InternalClass *InternalClass::addMember(String *string, PropertyAttributes data,
     if (propertyTable.lookup(string->identifier) < size)
         return changeMember(string, data, index);
 
-    Transition t = { string->identifier, data.flags() };
+    Transition t = { string->identifier, (int)data.flags() };
     QHash<Transition, InternalClass *>::const_iterator tit = transitions.constFind(t);
 
     if (index)
index 9bc95da..fc6c535 100644 (file)
@@ -110,6 +110,9 @@ struct InternalClassTransition
 {
     Identifier *id;
     int flags;
+
+    bool operator==(const InternalClassTransition &other) const
+    { return id == other.id && flags == other.flags; }
 };
 uint qHash(const QV4::InternalClassTransition &t, uint = 0);