summaryrefslogtreecommitdiffstats
path: root/core/gaspressures.c
diff options
context:
space:
mode:
authorGravatar Jeremie Guichard <djebrest@gmail.com>2017-03-08 13:41:41 +0700
committerGravatar Jeremie Guichard <djebrest@gmail.com>2017-03-08 14:04:17 +0700
commit406e4287eb96e10ddfd22163f0e863e353470c68 (patch)
tree1a859821cdd37485b7d9ce4c0404f73fdf68e78b /core/gaspressures.c
parent9c2619ea3bcf8a0ad40a758692c26a5aec350c7f (diff)
downloadsubsurface-406e4287eb96e10ddfd22163f0e863e353470c68.tar.gz
Change calls to rint into lrint avoiding conversion warnings
Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Diffstat (limited to 'core/gaspressures.c')
-rw-r--r--core/gaspressures.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/gaspressures.c b/core/gaspressures.c
index 5d3fc9791..e74f26d3b 100644
--- a/core/gaspressures.c
+++ b/core/gaspressures.c
@@ -148,7 +148,7 @@ static void fill_missing_segment_pressures(pr_track_t *list, enum interpolation_
case TIME:
if (list->t_end && (tmp->t_start - tmp->t_end)) {
magic = (list->t_start - tmp->t_end) / (tmp->t_start - tmp->t_end);
- list->end = rint(start - (start - end) * magic);
+ list->end = lrint(start - (start - end) * magic);
} else {
list->end = start;
}
@@ -290,11 +290,11 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
magic = (interpolate.end - interpolate.start) / (double)interpolate.pressure_time;
/* Use that overall pressure change to update the current pressure */
- cur_pr[cyl] = rint(interpolate.start + magic * interpolate.acc_pressure_time);
+ cur_pr[cyl] = lrint(interpolate.start + magic * interpolate.acc_pressure_time);
}
} else {
magic = (interpolate.end - interpolate.start) / (segment->t_end - segment->t_start);
- cur_pr[cyl] = rint(segment->start + magic * (entry->sec - segment->t_start));
+ cur_pr[cyl] = lrint(segment->start + magic * (entry->sec - segment->t_start));
}
*save_interpolated = cur_pr[cyl]; // and store the interpolated data in plot_info
}