Fix potential double/float to int rounding errors

Not using lrint(f) when converting double/float to int
creates rounding errors.
This error was detected by TestParse::testParseDM4 failure
on Windows. It was creating rounding inconsistencies
on Linux too, see change in TestDiveDM4.xml.

Enable -Wfloat-conversion for gcc version greater than 4.9.0

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
This commit is contained in:
Jeremie Guichard 2017-03-09 23:07:30 +07:00
parent 406e4287eb
commit 2b06a0b223
20 changed files with 109 additions and 100 deletions

View file

@ -141,7 +141,7 @@
<sample time='42:00 min' depth='16.07 m' pressure='91.15 bar' />
<sample time='42:20 min' depth='15.95 m' pressure='90.42 bar' />
<sample time='42:40 min' depth='16.24 m' pressure='89.9 bar' />
<sample time='43:00 min' depth='16.379 m' pressure='88.92 bar' />
<sample time='43:00 min' depth='16.38 m' pressure='88.92 bar' />
<sample time='43:20 min' depth='16.67 m' pressure='88.2 bar' />
<sample time='43:40 min' depth='16.61 m' pressure='87.41 bar' />
<sample time='44:00 min' depth='17.17 m' pressure='86.42 bar' />