From 877f01428fbdcdb89b836518fc6372a9b2f23ed8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 19 Jul 2014 00:21:01 +0200 Subject: [PATCH] qv4l2: fix a coverity defect *** CID 1226677: Unused pointer value (UNUSED_VALUE) /utils/qv4l2/ctrl-tab.cpp: 64 in ApplicationWindow::addWidget(QGridLayout *, QWidget *, QFlags)() 58 } 59 } 60 61 void ApplicationWindow::addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align) 62 { 63 QToolButton *tb; >>> CID 1226677: Unused pointer value (UNUSED_VALUE) >>> Pointer "tb" returned by "qobject_cast(w)" is never used. 64 if (m_col % 2 && !(tb = qobject_cast(w))) 65 w->setMinimumWidth(m_minWidth); 66 if (w->sizeHint().width() > m_maxw[m_col]) 67 m_maxw[m_col] = w->sizeHint().width(); 68 if (w->sizeHint().height() > m_maxh) 69 m_maxh = w->sizeHint().height(); Signed-off-by: Hans Verkuil --- utils/qv4l2/ctrl-tab.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/qv4l2/ctrl-tab.cpp b/utils/qv4l2/ctrl-tab.cpp index 46a22b5..29f1e27 100644 --- a/utils/qv4l2/ctrl-tab.cpp +++ b/utils/qv4l2/ctrl-tab.cpp @@ -60,8 +60,7 @@ static bool is_valid_type(__u32 type) void ApplicationWindow::addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align) { - QToolButton *tb; - if (m_col % 2 && !(tb = qobject_cast(w))) + if (m_col % 2 && !qobject_cast(w)) w->setMinimumWidth(m_minWidth); if (w->sizeHint().width() > m_maxw[m_col]) m_maxw[m_col] = w->sizeHint().width(); -- 2.7.4