diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-10-26 07:54:57 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-26 11:35:16 -0700 |
commit | 70737b9eec9e0ff799a5a95e1b714ed1822010cd (patch) | |
tree | d1b8fd431a95b6b116076ec3d858c05aacf748f4 /profile-widget/profilewidget2.cpp | |
parent | 56e8ac0bd77bea17cf4f751985731607b23e4250 (diff) | |
download | subsurface-70737b9eec9e0ff799a5a95e1b714ed1822010cd.tar.gz |
Cleanup: use correct loop bounds
I'm a bit confused why this enum has two extra values, NUM_DIVEMODE and
UNDEF_COMP_TYPE. I can see how this could create confusion. This may
benefit from addition review.
Found by Coverity. Fixes CID 350092.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 9389eaaeb..186638a41 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1652,7 +1652,7 @@ void ProfileWidget2::addDivemodeSwitch() int i; QAction *action = qobject_cast<QAction *>(sender()); QPointF scenePos = mapToScene(mapFromGlobal(action->data().toPoint())); - for (i = 0; i < UNDEF_COMP_TYPE; i++) + for (i = 0; i < NUM_DIVEMODE; i++) if (gettextFromC::tr(divemode_text_ui[i]) == action->text()) add_event(current_dc, lrint(timeAxis->valueAt(scenePos)), 8, 0, i, QT_TRANSLATE_NOOP("gettextFromC", "modechange")); |