subsurface/desktop-widgets/preferences
Berthold Stoeger a748e7f239 Unify float calulations: use double
Internal floating point (FP) calculations should be performed using double
unless there is a very good reason. This avoids headaches with conversions.
Indeed, the vast majority of FP calculations were already done using double.
This patch adapts most remaining calculations. Not converted where things
that were based on binary representations and variables which weren't used
anyway.

An analysis of all instances follows:

core/plannernotes.c, l.404:

This was a comparison between two floats. On the left side, first an integer
was cast to float then multiplied with and integer and divided by a constant
double. The right hand side was an integer cast to a float. Simply divide by
1000.0 first to convert to double and continue with calculations. On the right
hand side, remove the cast, because the integer will be implicitely cast to
double for comparison. This conversion actually emits less instructions,
because no conversion to double and back is performed.

core/planner.c, l.613:

Same analysis as previous case.

subsurface-desktop-main.cpp, l.155:

A local variable representing the version OpenGL version. Turn this into
integer logic. Not only does this avoid dreaded FP rounding issues, it also
works correctly for minor version > 10 (not that such a thing is to be
expected anytime soon).

abstractpreferenceswidget.[h/cpp]:

A widget where the position is described as a float. Turn into double.

desktop-widgets/divelogexportdialog.cpp, l.313:

total_weight is described as float. Use double arithmetics instead. This
instance fixes a truncation warning emitted by gcc.
2017-12-17 09:02:44 -08:00
..
abstractpreferenceswidget.cpp Unify float calulations: use double 2017-12-17 09:02:44 -08:00
abstractpreferenceswidget.h Unify float calulations: use double 2017-12-17 09:02:44 -08:00
CMakeLists.txt
preferences_defaults.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_defaults.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_defaults.ui
preferences_georeference.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_georeference.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_graph.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_graph.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_graph.ui Planner and profile limit minimum GFlow to 10 and minimum GFhigh to 40 2017-11-13 11:53:55 +01:00
preferences_language.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_language.h preferences: support a pre-defined list of date formats 2017-11-10 09:21:47 -08:00
preferences_network.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_network.h Fix typo: successfull -> successful and succesfully -> successfully 2017-11-20 10:01:15 +01:00
preferences_network.ui
preferences_units.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
preferences_units.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
preferences_units.ui Preferences units dialog: Tab order and silence warnings 2017-10-09 11:49:29 +03:00
preferencesdialog.cpp Fix ownership issues in preferences code 2017-11-25 07:41:09 -08:00
preferencesdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
prefs_georeference.ui Remove three obsolete preferences options for geocoding 2017-10-29 11:07:52 -07:00
prefs_language.ui preferences: support a pre-defined list of time formats 2017-11-10 09:21:47 -08:00