forked from qt-creator/qt-creator
ScxmlEditor.TransitionItem: fix signed overflow warning
transitionitem.cpp:247: warning: assuming signed overflow does not occur
when assuming that (X - c) <= X is always true [-Wstrict-overflow]
if (idSnap >= 0 && idSnap < m_cornerPoints.count()) {
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Icc0b21c21326663f801ffef2b82fdd4b2679bf07
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -244,7 +244,7 @@ void TransitionItem::snapToAnyPoint(int id, const QPointF &newPoint, int diff)
|
||||
|
||||
void TransitionItem::snapPointToPoint(int idSnap, const QPointF &p, int diff)
|
||||
{
|
||||
if (idSnap >= 0 && idSnap < m_cornerPoints.count()) {
|
||||
if (idSnap >= 0 && static_cast<uint>(idSnap) < static_cast<uint>(m_cornerPoints.count())) {
|
||||
if (qAbs(p.x() - m_cornerPoints[idSnap].x()) < diff)
|
||||
m_cornerPoints[idSnap].setX(p.x());
|
||||
if (qAbs(p.y() - m_cornerPoints[idSnap].y()) < diff)
|
||||
|
||||
Reference in New Issue
Block a user