Commit 8ccdbe19 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Satisfy Coverity using Q_UNRECHABLE

If I remove the switch cases gcc produces a warning. Coverity recognizes
the cases as dead code and produces a finding. Maybe Q_UNRECHABLE is
modeled in Coviery to suppress dead code issues.

Change-Id: Idae2c088ba95b3e00cb4ef788d075fe7e0d4b6a5
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 706b0874
...@@ -191,7 +191,7 @@ void RectangularSelectionItem::update() ...@@ -191,7 +191,7 @@ void RectangularSelectionItem::update()
visible = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio; visible = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio;
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
m_points[i]->setSecondarySelected(m_isSecondarySelected); m_points[i]->setSecondarySelected(m_isSecondarySelected);
...@@ -269,7 +269,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -269,7 +269,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
moveable = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio; moveable = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio;
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
if (!moveable) if (!moveable)
...@@ -328,7 +328,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -328,7 +328,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
bottomRightDelta = -(v * deltaLength); bottomRightDelta = -(v * deltaLength);
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
} else { } else {
...@@ -360,7 +360,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -360,7 +360,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
bottomRightDelta = deltaMove; bottomRightDelta = deltaMove;
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
} }
...@@ -386,7 +386,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -386,7 +386,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
bottomRightDelta.setX(bottomRightDelta.x() + sizeDelta.width()); bottomRightDelta.setX(bottomRightDelta.x() + sizeDelta.width());
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
...@@ -408,7 +408,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -408,7 +408,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
bottomRightDelta.setY(bottomRightDelta.y() + sizeDelta.height()); bottomRightDelta.setY(bottomRightDelta.y() + sizeDelta.height());
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
...@@ -433,7 +433,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -433,7 +433,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
// nothing // nothing
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
switch (handle) { switch (handle) {
...@@ -452,7 +452,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov ...@@ -452,7 +452,7 @@ void RectangularSelectionItem::moveHandle(Handle handle, const QPointF &deltaMov
// nothing // nothing
break; break;
case HandleNone: case HandleNone:
QMT_CHECK(false); Q_UNREACHABLE();
break; break;
} }
m_itemResizer->alignItemSizeToRaster(horiz, vert, 2 * RASTER_WIDTH, 2 * RASTER_HEIGHT); m_itemResizer->alignItemSizeToRaster(horiz, vert, 2 * RASTER_WIDTH, 2 * RASTER_HEIGHT);
......
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