OSDN Git Service

compiler warning fixes
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 12 Dec 2019 15:59:31 +0000 (15:59 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 12 Dec 2019 15:59:31 +0000 (15:59 +0000)
upstream commits:
https://github.com/qt/qtbase/commit/65ec933f91dd9ac95679c24c830533953e384991
https://github.com/qt/qtbase/commit/2d8d738657b64c853316b605176e002b9e616fcf

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/3rdparty/javascriptcore/runtime/PropertySlot.cpp
src/3rdparty/javascriptcore/runtime/PropertySlot.h
src/gui/kernel/qapplication_x11.cpp
src/gui/util/qcompleter_p.h
src/test/qbenchmark_p.h

index 4bc4bc4..9b70c15 100644 (file)
@@ -33,12 +33,12 @@ JSValue PropertySlot::functionGetter(ExecState* exec, const Identifier&, const P
         return exec->exception();
 
     CallData callData;
-    CallType callType = slot.m_data.getterFunc->getCallData(callData);
+    CallType callType = slot.m_getterFunc->getCallData(callData);
     if (callType == CallTypeHost)
-        return callData.native.function(exec, slot.m_data.getterFunc, slot.slotBase(), exec->emptyList());
+        return callData.native.function(exec, slot.m_getterFunc, slot.slotBase(), exec->emptyList());
     Q_ASSERT(callType == CallTypeJS);
     // FIXME: Can this be done more efficiently using the callData?
-    return asFunction(slot.m_data.getterFunc)->call(exec, slot.slotBase(), exec->emptyList());
+    return asFunction(slot.m_getterFunc)->call(exec, slot.slotBase(), exec->emptyList());
 }
 
 } // namespace JSC
index c74f0c6..c118ccf 100644 (file)
@@ -38,6 +38,9 @@ namespace JSC {
     class PropertySlot {
     public:
         PropertySlot()
+            : m_getterFunc(Q_NULLPTR),
+            m_valueSlot(Q_NULLPTR),
+            m_registerSlot(Q_NULLPTR)
         {
             clearBase();
             clearOffset();
@@ -45,7 +48,10 @@ namespace JSC {
         }
 
         explicit PropertySlot(const JSValue base)
-            : m_slotBase(base)
+            : m_slotBase(base),
+            m_getterFunc(Q_NULLPTR),
+            m_valueSlot(Q_NULLPTR),
+            m_registerSlot(Q_NULLPTR)
         {
             clearOffset();
             clearValue();
@@ -56,18 +62,18 @@ namespace JSC {
         JSValue getValue(ExecState* exec, const Identifier& propertyName) const
         {
             if (m_getValue == JSC_VALUE_SLOT_MARKER)
-                return *m_data.valueSlot;
+                return *m_valueSlot;
             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
-                return (*m_data.registerSlot).jsValue();
+                return (*m_registerSlot).jsValue();
             return m_getValue(exec, propertyName, *this);
         }
 
         JSValue getValue(ExecState* exec, unsigned propertyName) const
         {
             if (m_getValue == JSC_VALUE_SLOT_MARKER)
-                return *m_data.valueSlot;
+                return *m_valueSlot;
             if (m_getValue == JSC_REGISTER_SLOT_MARKER)
-                return (*m_data.registerSlot).jsValue();
+                return (*m_registerSlot).jsValue();
             return m_getValue(exec, Identifier::from(exec, propertyName), *this);
         }
 
@@ -84,7 +90,7 @@ namespace JSC {
             clearBase();
             clearOffset();
             m_getValue = JSC_VALUE_SLOT_MARKER;
-            m_data.valueSlot = valueSlot;
+            m_valueSlot = valueSlot;
         }
         
         void setValueSlot(JSValue slotBase, JSValue* valueSlot)
@@ -92,7 +98,7 @@ namespace JSC {
             Q_ASSERT(valueSlot);
             m_getValue = JSC_VALUE_SLOT_MARKER;
             m_slotBase = slotBase;
-            m_data.valueSlot = valueSlot;
+            m_valueSlot = valueSlot;
         }
         
         void setValueSlot(JSValue slotBase, JSValue* valueSlot, size_t offset)
@@ -100,7 +106,7 @@ namespace JSC {
             Q_ASSERT(valueSlot);
             m_getValue = JSC_VALUE_SLOT_MARKER;
             m_slotBase = slotBase;
-            m_data.valueSlot = valueSlot;
+            m_valueSlot = valueSlot;
             m_offset = offset;
         }
         
@@ -111,7 +117,7 @@ namespace JSC {
             clearOffset();
             m_getValue = JSC_VALUE_SLOT_MARKER;
             m_value = value;
-            m_data.valueSlot = &m_value;
+            m_valueSlot = &m_value;
         }
 
         void setRegisterSlot(Register* registerSlot)
@@ -120,7 +126,7 @@ namespace JSC {
             clearBase();
             clearOffset();
             m_getValue = JSC_REGISTER_SLOT_MARKER;
-            m_data.registerSlot = registerSlot;
+            m_registerSlot = registerSlot;
         }
 
         void setCustom(JSValue slotBase, GetValueFunc getValue)
@@ -137,14 +143,14 @@ namespace JSC {
             Q_ASSERT(getValue);
             m_getValue = getValue;
             m_slotBase = slotBase;
-            m_data.index = index;
+            m_index = index;
         }
         
         void setGetterSlot(JSObject* getterFunc)
         {
             Q_ASSERT(getterFunc);
             m_getValue = functionGetter;
-            m_data.getterFunc = getterFunc;
+            m_getterFunc = getterFunc;
         }
         
         void setUndefined()
@@ -185,7 +191,7 @@ namespace JSC {
             m_offset = WTF::notFound;
         }
 
-        unsigned index() const { return m_data.index; }
+        unsigned index() const { return m_index; }
 
     private:
         static JSValue functionGetter(ExecState*, const Identifier&, const PropertySlot&);
@@ -193,15 +199,13 @@ namespace JSC {
         GetValueFunc m_getValue;
         
         JSValue m_slotBase;
-        union {
-            JSObject* getterFunc;
-            JSValue* valueSlot;
-            Register* registerSlot;
-            unsigned index;
-        } m_data;
-
         JSValue m_value;
 
+        JSObject* m_getterFunc;
+        JSValue* m_valueSlot;
+        Register* m_registerSlot;
+        unsigned m_index;
+
         size_t m_offset;
     };
 
index 929593e..bf7c25d 100644 (file)
@@ -629,7 +629,7 @@ static Bool qt_sync_request_scanner(Display*, XEvent *event, XPointer arg)
         (Atom)event->xclient.data.l[0] == ATOM(_NET_WM_SYNC_REQUEST)) {
         QWidget *w = QWidget::find(event->xany.window);
         if (QTLWExtra *tlw = ((QETWidget*)w)->d_func()->maybeTopData()) {
-            const ulong timestamp = (const ulong) event->xclient.data.l[1];
+            const Time timestamp = event->xclient.data.l[1];
             if (timestamp > qt_x11Data->time)
                 qt_x11Data->time = timestamp;
             if (timestamp == CurrentTime || timestamp > tlw->syncRequestTimestamp) {
@@ -2098,7 +2098,7 @@ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only)
                 }
 #ifndef QT_NO_XSYNC
             } else if (a == ATOM(_NET_WM_SYNC_REQUEST)) {
-                const ulong timestamp = (const ulong) event->xclient.data.l[1];
+                const Time timestamp = event->xclient.data.l[1];
                 if (timestamp > qt_x11Data->time)
                     qt_x11Data->time = timestamp;
                 if (QTLWExtra *tlw = w->d_func()->maybeTopData()) {
index 27ea116..5866785 100644 (file)
@@ -121,7 +121,7 @@ private:
 };
 
 struct QMatchData {
-    QMatchData() : exactMatchIndex(-1) { }
+    QMatchData() : exactMatchIndex(-1), partial(false) { }
     QMatchData(const QIndexMapper& indices, int em, bool p) :
         indices(indices), exactMatchIndex(em), partial(p) { }
     QIndexMapper indices;
index 4a976c6..5b4cfc1 100644 (file)
@@ -96,6 +96,7 @@ public:
     QBenchmarkResult()
     : value(-1)
     , iterations(-1)
+    , metric(QTest::WalltimeMilliseconds)
     , setByMacro(true)
     , valid(false)
     { }