subsurface/desktop-widgets
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
..
css Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
plugins Use icons relative path. 2017-11-30 23:14:46 -08:00
preferences Unify float calulations: use double 2017-12-17 09:02:44 -08:00
statistics Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
tab-widgets Reenable picture tab when dive trip is selected 2017-12-13 05:48:20 -08:00
about.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
about.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
about.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
btdeviceselectiondialog.cpp Introduce mode field in Bluetooth device selection dialog 2017-11-16 14:26:51 +01:00
btdeviceselectiondialog.h Make Bluetooth naming consistent 2017-11-13 20:48:17 -08:00
btdeviceselectiondialog.ui Introduce mode field in Bluetooth device selection dialog 2017-11-16 14:26:51 +01:00
CMakeLists.txt map-widget: move the widget and its resources to 'map-widget' 2017-11-05 14:48:56 -08:00
configuredivecomputerdialog.cpp Fix build without BT support 2017-11-24 16:58:55 -08:00
configuredivecomputerdialog.h Remove old duplicated code 2017-06-21 18:43:15 -07:00
configuredivecomputerdialog.ui Use better aliases for icons. 2017-11-30 23:14:46 -08:00
divecomponentselection.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
divecomputermanagementdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divecomputermanagementdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divecomputermanagementdialog.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
divelistview.cpp Use QDir::exists() instead of QDir::setCurrent() to check for existence 2017-12-04 18:35:44 +01:00
divelistview.h divelist: prevent a crash for missing column width 2017-10-03 15:43:03 -07:00
divelogexportdialog.cpp Unify float calulations: use double 2017-12-17 09:02:44 -08:00
divelogexportdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divelogexportdialog.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
divelogimportdialog.cpp Fix crash on manually added ZXU/DL7 file 2017-09-11 07:21:43 -07:00
divelogimportdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divelogimportdialog.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
divepicturewidget.cpp Dive picture drag&drop decrease size of pixmaps 2017-12-01 09:44:34 +01:00
divepicturewidget.h Dive picture handling: Re enable multi select, improve mouse events 2017-12-01 09:44:34 +01:00
diveplanner.cpp Disable plan variation in recreational mode 2017-12-01 15:47:51 -08:00
diveplanner.h Actually compute variations in background 2017-12-01 15:47:51 -08:00
diveplanner.ui Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
diveshareexportdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
diveshareexportdialog.h Random whitespace cleanup 2017-05-27 11:07:20 -07:00
diveshareexportdialog.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
downloadfromdivecomputer.cpp Make Bluetooth naming consistent 2017-11-13 20:48:17 -08:00
downloadfromdivecomputer.h Fix memory leak in download-from-dive-computer widget 2017-11-11 21:01:42 +01:00
downloadfromdivecomputer.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
filterwidget.ui Use better aliases for icons. 2017-11-30 23:14:46 -08:00
groupedlineedit.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
groupedlineedit.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
kmessagewidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
kmessagewidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
listfilter.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
locationinformation.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
locationinformation.h locationinformation: don't update map location on typing 2017-11-27 22:59:22 +01:00
locationInformation.ui Use better aliases for icons. 2017-11-30 23:14:46 -08:00
mainwindow.cpp Simplify mainwindow title logic: remove MainWindowTitleFormat enum 2017-12-11 23:10:09 -06:00
mainwindow.h Simplify mainwindow title logic: remove MainWindowTitleFormat enum 2017-12-11 23:10:09 -06:00
mainwindow.ui Use better aliases for icons. 2017-11-30 23:14:46 -08:00
mapwidget.cpp map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
mapwidget.h map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
modeldelegates.cpp remove Marble from the source tree 2017-09-04 07:46:35 -07:00
modeldelegates.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
notificationwidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
notificationwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
plannerDetails.ui Bring back style sheet HTML for planner output 2017-02-24 01:06:09 -08:00
plannerSettings.ui Planner and profile limit minimum GFlow to 10 and minimum GFhigh to 40 2017-11-13 11:53:55 +01:00
printdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printer.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printer.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printoptions.cpp Fix typo connot > cannot. 2017-11-28 11:36:19 +02:00
printoptions.h printing: store the last import / export template 2017-11-24 21:50:16 +02:00
printoptions.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
qtwaitingspinner.cpp Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
qtwaitingspinner.h Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
renumber.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
searchbar.ui Use better aliases for icons. 2017-11-30 23:14:46 -08:00
setpoint.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
shiftimagetimes.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
shifttimes.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
simplewidgets.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
simplewidgets.h Picture feature: Improve UI and translation of shift image times... 2017-05-01 21:23:42 -07:00
starwidget.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
starwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
subsurfacewebservices.cpp applying gps fixes: group repetitive code under a macro 2017-12-10 11:38:19 -08:00
subsurfacewebservices.h Remove redundant declaration of set_userid() 2017-11-26 23:17:23 +01:00
tableview.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
tableview.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
tableview.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
tagwidget.cpp Show all autocompletes after entry of comma in tag list 2017-11-17 09:19:03 +01:00
tagwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.ui templateedit.ui: give the layout for "Border width" unique name 2017-03-12 09:19:03 -07:00
templatelayout.cpp printing: update the coping of bundled templates 2017-11-24 23:06:52 +02:00
templatelayout.h printing: update the coping of bundled templates 2017-11-24 23:06:52 +02:00
undocommands.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
undocommands.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
updatemanager.cpp desktop-widgets isn't built for mobile 2017-12-01 13:29:13 -08:00
updatemanager.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
urldialog.ui Make the URL dialog contain QLineEdit 2017-01-12 14:06:54 -08:00
usermanual.cpp Use better aliases for icons. 2017-11-30 23:14:46 -08:00
usermanual.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usersurvey.cpp Use icons relative path. 2017-11-30 23:14:46 -08:00
usersurvey.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usersurvey.ui fix: User survey UI. 2017-03-06 06:40:00 -08:00
webservices.ui Use icons relative path. 2017-11-30 23:14:46 -08:00