testprofile on i686

Robert.Helling robert at neu.atdotde.de
Sun Dec 5 11:19:34 PST 2021


Hi everyone,

> On 5. Dec 2021, at 00:16, Alan Brown via subsurface <subsurface at subsurface-divelog.org> wrote:
> 
> 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--

Yes, that is related. Rather than simply adding/subtracting 10000 to convert between depth in mm and ambient pressure, these functions properly take into account the surface pressure (not exactly 1 bar)  and the density of water (not exactly 1000 kg/m^3). But these functions use Subsurface internal unit types which are integer Millimeters and integer millibars. As Berthold pointed out, the letter have a quantisation that amounts to 1cm of depth and these seem to be the differences we are seeing. 

I pushed another version of the the pull request which does not internally quantise to integer bars which might behave better. 

> 
> 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.

Could you please try this again with the current version. That would be great.

Best
Robert


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20211205/1759ca98/attachment-0001.htm>


More information about the subsurface mailing list