Commit 674430ce authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Silence maybe_uninitialized warning with gcc -Og



GCC produces false positives for maybe_uninitialized when compiling with
-Og in these three places. Simply initialize the variables to silence
it. This should be entirely cost-free for normal compilation.

Change-Id: Iab778a6ba25993f78f190e928c1fcc2dbd8b2fcd
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: default avatarThiago Macieira <thiago.macieira@intel.com>
parent 88a02c4d
...@@ -321,7 +321,7 @@ void QTriangulatingStroker::cubicTo(const qreal *pts) ...@@ -321,7 +321,7 @@ void QTriangulatingStroker::cubicTo(const qreal *pts)
if (threshold < 4) if (threshold < 4)
threshold = 4; threshold = 4;
qreal threshold_minus_1 = threshold - 1; qreal threshold_minus_1 = threshold - 1;
float vx, vy; float vx = 0, vy = 0;
float cx = m_cx, cy = m_cy; float cx = m_cx, cy = m_cy;
float x, y; float x, y;
......
...@@ -417,7 +417,7 @@ void QXcbConnection::initializeScreens() ...@@ -417,7 +417,7 @@ void QXcbConnection::initializeScreens()
qWarning("failed to get the current screen resources"); qWarning("failed to get the current screen resources");
free(error); free(error);
} else { } else {
xcb_timestamp_t timestamp; xcb_timestamp_t timestamp = 0;
xcb_randr_output_t *outputs = Q_NULLPTR; xcb_randr_output_t *outputs = Q_NULLPTR;
int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data());
if (outputCount) { if (outputCount) {
......
...@@ -3305,7 +3305,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) ...@@ -3305,7 +3305,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), phase, wheel->source(), wheel->inverted()); wheel->modifiers(), phase, wheel->source(), wheel->inverted());
bool eventAccepted; bool eventAccepted;
while (w) { do {
we.spont = spontaneous && w == receiver; we.spont = spontaneous && w == receiver;
we.ignore(); we.ignore();
res = d->notify_helper(w, &we); res = d->notify_helper(w, &we);
...@@ -3323,7 +3323,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) ...@@ -3323,7 +3323,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
we.p += w->pos(); we.p += w->pos();
w = w->parentWidget(); w = w->parentWidget();
} } while (w);
wheel->setAccepted(eventAccepted); wheel->setAccepted(eventAccepted);
} else if (!spontaneous) { } else if (!spontaneous) {
// wheel_widget may forward the wheel event to a delegate widget, // wheel_widget may forward the wheel event to a delegate widget,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment