mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
pressures: do floating point division when interpolating
Coverity correctly complains about an integer division followed by an assignment to double. Hard to say if intended - but let's do a floating point division instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ad2ccc8888
commit
c91884223f
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@ static void fill_missing_tank_pressures(const struct dive *dive, struct plot_inf
|
|||
cur_pr = lrint(interpolate.start + magic * interpolate.acc_pressure_time);
|
||||
}
|
||||
} else {
|
||||
double magic = (interpolate.end - interpolate.start) / (it->t_end - it->t_start);
|
||||
double magic = (interpolate.end - interpolate.start) / static_cast<double>(it->t_end - it->t_start);
|
||||
cur_pr = lrint(it->start + magic * (entry.sec - it->t_start));
|
||||
}
|
||||
set_plot_pressure_data(pi, i, INTERPOLATED_PR, cyl, cur_pr); // and store the interpolated data in plot_info
|
||||
|
|
Loading…
Reference in a new issue