diff options
author | Nikita Baryshnikov <nib952051@gmail.com> | 2017-08-21 11:47:33 +0300 |
---|---|---|
committer | Nikita Baryshnikov <nib952051@gmail.com> | 2017-08-22 09:34:47 +0000 |
commit | 0a548fe2bc2857875b29cb9bb6ebf3fc84b0db39 (patch) | |
tree | 1c5a0abd8d5d6ff60bc5fe1e7397b2ef245f9945 /src/plugins/scxmleditor | |
parent | bd4428eb84b50d37c2ab6468a3014aa8c1c0d790 (diff) | |
download | qt-creator-0a548fe2bc2857875b29cb9bb6ebf3fc84b0db39.tar.gz |
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>
Diffstat (limited to 'src/plugins/scxmleditor')
-rw-r--r-- | src/plugins/scxmleditor/plugin_interface/transitionitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp index 154324fd98..acf0116ac6 100644 --- a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp @@ -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) |