Profile: fix a couple of warnings

profilewidget2.cpp:1398:25: warning: the omitted middle operand in
?: will always be 'true', suggest explicit middle operand [-Wparentheses]

profilewidget2.cpp:1403:39: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-03-13 02:32:51 +02:00 committed by Dirk Hohndel
parent 57374fb9f0
commit 7e7cddde8a

View file

@ -1391,10 +1391,10 @@ void ProfileWidget2::changeGas()
// backup the things on the dataModel, since we will clear that out.
struct gasmix gasmix;
int seconds = timeAxis->valueAt(scenePos);
qreal sec_val = timeAxis->valueAt(scenePos);
// no gas changes before the dive starts
seconds = seconds > 0 ?: 0;
unsigned int seconds = (sec_val < 0.0) ? 0 : (unsigned int)sec_val;
// if there is a gas change at this time stamp, remove it before adding the new one
struct event *gasChangeEvent = current_dc->events;