"Robert.Helling" <[email protected]> writes:

> Hi,
>
>  On 4. Dec 2021, at 13:09, Berthold Stoeger via subsurface 
> <[email protected]> wrote:
>
>  Yes, in particular Robert's new code reads as
>
>  entry->ead = mbar_to_depth(depth_to_mbar(entry->depth, dive) ...);
>
>  depth_to_mbar() returns an int, and 1 bar is 10 m, thus 1 mbar is 10 mm which
>  is precisely the observed difference, no?
>
> I could add easily a double valued version of that function which should 
> solve this.
>
Robert, Berthold

Is this related to the warnings I am seeing in the build log, which I am
seeing following the patch?

--snip--
/home/alan/src/subsurface/core/profile.c: In function 
‘calculate_gas_information_new’:
/home/alan/src/subsurface/core/profile.c:1259:79: warning: conversion from 
‘double’ to ‘int’ may change value [-Wfloat-conversion]
 1259 |   entry->end = mbar_to_depth(depth_to_mbar(entry->depth, dive) * (1000 
- fhe) / 1000.0, dive);
      |                              
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/alan/src/subsurface/core/profile.c:1260:70: warning: conversion from 
‘double’ to ‘int’ may change value [-Wfloat-conversion]
 1260 |   entry->ead = mbar_to_depth(depth_to_mbar(entry->depth, dive) * fn2 / 
(double)N2_IN_AIR, dive);
/home/alan/src/subsurface/core/profile.c:1265:61: warning: conversion from 
‘double’ to ‘int’ may change value [-Wfloat-conversion]
 1261 |   entry->eadd = mbar_to_depth(depth_to_mbar(entry->depth, dive) *
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1262 |           (entry->pressures.o2 / amb_pressure * O2_DENSITY +
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1263 |            entry->pressures.n2 / amb_pressure * N2_DENSITY +
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1264 |            entry->pressures.he / amb_pressure * HE_DENSITY) /
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1265 |           (O2_IN_AIR * O2_DENSITY + N2_IN_AIR * N2_DENSITY) * 1000, 
dive);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
--snip--

For my own sanity I used qemu to build a debian 32 bit machine and did a
subsurface build from the master branch using the patch and TestProfile
failed with the same diffs.

Regards

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

Reply via email to