core: make get_dive_nr_at_idx() 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 21:07:58 +02:00 committed by bstoeger
parent cce5f5950c
commit 271df8962b
3 changed files with 7 additions and 14 deletions

View file

@ -21,6 +21,7 @@ struct dive_table : public sorted_owning_table<dive, &comp_dives> {
void record_dive(std::unique_ptr<dive> d); // call fixup_dive() before adding dive to table.
std::unique_ptr<dive> unregister_dive(int idx);
int get_dive_nr_at_idx(int idx) const;
timestamp_t get_surface_interval(timestamp_t when) const;
struct dive *find_next_visible_dive(timestamp_t when);
};
@ -51,7 +52,6 @@ struct process_imported_dives_result {
extern process_imported_dives_result process_imported_dives(struct divelog &import_log, int flags);
extern void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2low_p);
extern int get_dive_nr_at_idx(int idx);
int get_min_datafile_version();
void report_datafile_version(int version);