From d91b2a4479dc92d7b1232e42329977e909331909 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 14 Oct 2021 10:19:11 -0700 Subject: [PATCH] QtWidgets: remove set-but-unused variables Found by clang 13: qlayoutengine.cpp:80:9: warning: variable 'cMax' set but not used [-Wunused-but-set-variable] Change-Id: Iea05060bc2c046928536fffd16adf54d1527e657 Reviewed-by: Volker Hilsheimer --- src/widgets/kernel/qlayoutengine.cpp | 2 -- src/widgets/util/qscroller.cpp | 6 ------ 2 files changed, 8 deletions(-) diff --git a/src/widgets/kernel/qlayoutengine.cpp b/src/widgets/kernel/qlayoutengine.cpp index 98fc85c3c4..e318300f98 100644 --- a/src/widgets/kernel/qlayoutengine.cpp +++ b/src/widgets/kernel/qlayoutengine.cpp @@ -77,7 +77,6 @@ void qGeomCalc(QList &chain, int start, int count, int pos, int s { int cHint = 0; int cMin = 0; - int cMax = 0; int sumStretch = 0; int sumSpacing = 0; int expandingCount = 0; @@ -93,7 +92,6 @@ void qGeomCalc(QList &chain, int start, int count, int pos, int s data->done = false; cHint += data->smartSizeHint(); cMin += data->minimumSize; - cMax += data->maximumSize; sumStretch += data->stretch; if (!data->empty) { /* diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index e6164178a8..96e0701ecf 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1760,7 +1760,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos) qScrollerDebug() << "QScroller::setContentPositionHelperDragging(" << deltaPos << " [pix])"; qScrollerDebug() << " --> overshoot:" << overshootPosition << "- old pos:" << oldPos << "- new pos:" << newPos; - QPointF oldClampedPos = clampToRect(oldPos, contentPosRange); QPointF newClampedPos = clampToRect(newPos, contentPosRange); // --- handle overshooting and stop if the coordinate is going back inside the normal area @@ -1775,9 +1774,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos) bool canOvershootX = !noOvershootX && (alwaysOvershootX || contentPosRange.width()); bool canOvershootY = !noOvershootY && (alwaysOvershootY || contentPosRange.height()); - qreal oldOvershootX = (canOvershootX) ? oldPos.x() - oldClampedPos.x() : 0; - qreal oldOvershootY = (canOvershootY) ? oldPos.y() - oldClampedPos.y() : 0; - qreal newOvershootX = (canOvershootX) ? newPos.x() - newClampedPos.x() : 0; qreal newOvershootY = (canOvershootY) ? newPos.y() - newClampedPos.y() : 0; @@ -1788,8 +1784,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos) qScrollerDebug() << " --> canOS:" << canOvershootX << "newOS:" << newOvershootX << "maxOS:" << maxOvershootX; if (sp->overshootDragResistanceFactor) { - oldOvershootX *= sp->overshootDragResistanceFactor; - oldOvershootY *= sp->overshootDragResistanceFactor; newOvershootX *= sp->overshootDragResistanceFactor; newOvershootY *= sp->overshootDragResistanceFactor; }