summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-11 08:41:41 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-03-11 08:41:41 -0800
commit08284275e733fcea8b909b86fda503d4b24e0b84 (patch)
treeb2092172f09044d58efdae479447bae9b6c824ad /core/dive.c
parentb8b858a9d299877969527ef5b3c4bde97bb86d05 (diff)
parent2b06a0b2234cf2779f80e87038011067be282bcb (diff)
downloadsubsurface-08284275e733fcea8b909b86fda503d4b24e0b84.tar.gz
Merge branch 'master' of https://github.com/dje29/subsurface
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/dive.c b/core/dive.c
index 79e89d559..3fc348520 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -243,16 +243,16 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
int units_to_sac(double volume)
{
if (get_units()->volume == CUFT)
- return rint(cuft_to_l(volume) * 1000.0);
+ return lrint(cuft_to_l(volume) * 1000.0);
else
- return rint(volume * 1000);
+ return lrint(volume * 1000);
}
depth_t units_to_depth(double depth)
{
depth_t internaldepth;
if (get_units()->length == METERS) {
- internaldepth.mm = rint(depth * 1000);
+ internaldepth.mm = lrint(depth * 1000);
} else {
internaldepth.mm = feet_to_mm(depth);
}
@@ -876,7 +876,7 @@ int gas_volume(cylinder_t *cyl, pressure_t p)
{
double bar = p.mbar / 1000.0;
double z_factor = gas_compressibility_factor(&cyl->gasmix, bar);
- return rint(cyl->type.size.mliter * bar_to_atm(bar) / z_factor);
+ return lrint(cyl->type.size.mliter * bar_to_atm(bar) / z_factor);
}
/*
@@ -1023,7 +1023,7 @@ static void match_standard_cylinder(cylinder_type_t *type)
default:
return;
}
- len = snprintf(buffer, sizeof(buffer), fmt, (int)rint(cuft));
+ len = snprintf(buffer, sizeof(buffer), fmt, (int)lrint(cuft));
p = malloc(len + 1);
if (!p)
return;
@@ -1060,7 +1060,7 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
volume_of_air = cuft_to_l(type->size.mliter);
/* milliliters at 1 atm: not corrected for compressibility! */
volume = volume_of_air / bar_to_atm(bar);
- type->size.mliter = rint(volume);
+ type->size.mliter = lrint(volume);
}
/* Ok, we have both size and pressure: try to match a description */