From 7e7cddde8acc603159879ae34501debacbb9b222 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Fri, 13 Mar 2015 02:32:51 +0200 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index e314c337f..8e3641b66 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -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;