On Mon, Mar 13, 2017 at 12:35 AM, Rick Walsh <[email protected]> wrote:
>
>  void PlannerSettingsWidget::setAscRate75(int rate)
>  {
> -       
> SettingsObjectWrapper::instance()->planner_settings->setAscrate75(rate * 
> UNIT_FACTOR);
> +       
> SettingsObjectWrapper::instance()->planner_settings->setAscrate75(rate * 
> UNIT_FACTOR + 0.5);
>  }

These should all definitely use "lrint()" rather than " + 0.5"
together with the integer truncation.

In practice it's the same for positive values, of course, but it's the
right thing to do.

.. and this all shows that we should also enable the
-Wfloat-conversion warning for our C++ code too. Of course, it's
possible that that fails miserably for some random reason (eg "tons of
warnings from Qt header files" or whatever).

                 Linus
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to