core: make calculate_cns() member of dive_table

This function implicitely accessed the global divelog. To make
that explicit make it a member of dive_table, such that the
caller must access it via the global variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-18 22:23:57 +02:00 committed by bstoeger
parent f3b8e3c4aa
commit b34116e2e2
8 changed files with 68 additions and 67 deletions

View file

@ -10,6 +10,7 @@
#include "dive.h"
#include "divelist.h"
#include "divelog.h"
#include "errorhelper.h"
#include "event.h"
#include "interpolate.h"
@ -1252,7 +1253,7 @@ struct plot_info create_plot_info_new(const struct dive *dive, const struct dive
int o2, he, o2max;
struct deco_state plot_deco_state;
bool in_planner = planner_ds != NULL;
init_decompression(&plot_deco_state, dive, in_planner);
divelog.dives.init_decompression(&plot_deco_state, dive, in_planner);
plot_info pi;
calculate_max_limits_new(dive, dc, pi, in_planner);
get_dive_gas(dive, &o2, &he, &o2max);