From 984eebca1e9a8b4dfb8f4cc82bf093ee4b78b00e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 12 Dec 2019 15:59:31 +0000 Subject: [PATCH] compiler warning fixes upstream commits: https://github.com/qt/qtbase/commit/65ec933f91dd9ac95679c24c830533953e384991 https://github.com/qt/qtbase/commit/2d8d738657b64c853316b605176e002b9e616fcf Signed-off-by: Ivailo Monev --- .../javascriptcore/runtime/PropertySlot.cpp | 6 +-- src/3rdparty/javascriptcore/runtime/PropertySlot.h | 44 ++++++++++++---------- src/gui/kernel/qapplication_x11.cpp | 4 +- src/gui/util/qcompleter_p.h | 2 +- src/test/qbenchmark_p.h | 1 + 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/3rdparty/javascriptcore/runtime/PropertySlot.cpp b/src/3rdparty/javascriptcore/runtime/PropertySlot.cpp index 4bc4bc4c5..9b70c15ec 100644 --- a/src/3rdparty/javascriptcore/runtime/PropertySlot.cpp +++ b/src/3rdparty/javascriptcore/runtime/PropertySlot.cpp @@ -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 diff --git a/src/3rdparty/javascriptcore/runtime/PropertySlot.h b/src/3rdparty/javascriptcore/runtime/PropertySlot.h index c74f0c60e..c118ccf86 100644 --- a/src/3rdparty/javascriptcore/runtime/PropertySlot.h +++ b/src/3rdparty/javascriptcore/runtime/PropertySlot.h @@ -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; }; diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 929593e2c..bf7c25d79 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -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()) { diff --git a/src/gui/util/qcompleter_p.h b/src/gui/util/qcompleter_p.h index 27ea1164c..58667858f 100644 --- a/src/gui/util/qcompleter_p.h +++ b/src/gui/util/qcompleter_p.h @@ -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; diff --git a/src/test/qbenchmark_p.h b/src/test/qbenchmark_p.h index 4a976c6d7..5b4cfc145 100644 --- a/src/test/qbenchmark_p.h +++ b/src/test/qbenchmark_p.h @@ -96,6 +96,7 @@ public: QBenchmarkResult() : value(-1) , iterations(-1) + , metric(QTest::WalltimeMilliseconds) , setByMacro(true) , valid(false) { } -- 2.11.0