mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: return pressures structure from fill_pressures()
Instead of taking an out-parameter. That's more idiomatic C++. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ead58cd039
commit
411188728d
6 changed files with 22 additions and 24 deletions
|
@ -637,13 +637,12 @@ void update_setpoint_events(const struct dive *dive, struct divecomputer *dc)
|
|||
const struct event *next = get_next_event(ev, "gaschange");
|
||||
|
||||
for (int i = 0; i < dc->samples; i++) {
|
||||
struct gas_pressures pressures;
|
||||
if (next && dc->sample[i].time.seconds >= next->time.seconds) {
|
||||
ev = next;
|
||||
gasmix = get_gasmix_from_event(dive, ev);
|
||||
next = get_next_event(ev, "gaschange");
|
||||
}
|
||||
fill_pressures(&pressures, lrint(calculate_depth_to_mbarf(dc->sample[i].depth.mm, dc->surface_pressure, 0)), gasmix ,0, dc->divemode);
|
||||
gas_pressures pressures = fill_pressures(lrint(calculate_depth_to_mbarf(dc->sample[i].depth.mm, dc->surface_pressure, 0)), gasmix ,0, dc->divemode);
|
||||
if (abs(dc->sample[i].setpoint.mbar - (int)(1000 * pressures.o2)) <= 50)
|
||||
dc->sample[i].setpoint.mbar = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue