mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_dive_dc() to struct dive
Feels natural in a C++ code base. This removes a nullptr-check so some care has to be taken. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
731052c776
commit
f1f082d86a
15 changed files with 59 additions and 55 deletions
|
@ -82,6 +82,9 @@ struct dive {
|
|||
void invalidate_cache();
|
||||
bool cache_is_valid() const;
|
||||
|
||||
struct divecomputer *get_dc(int nr);
|
||||
const struct divecomputer *get_dc(int nr) const;
|
||||
|
||||
void clear();
|
||||
int number_of_computers() const;
|
||||
void fixup_no_cylinder(); /* to fix cylinders, we need the divelist (to calculate cns) */
|
||||
|
@ -162,8 +165,6 @@ extern fraction_t best_he(depth_t depth, const struct dive *dive, bool o2narcoti
|
|||
|
||||
extern std::string get_dive_country(const struct dive *dive);
|
||||
extern std::string get_dive_location(const struct dive *dive);
|
||||
extern struct divecomputer *get_dive_dc(struct dive *dive, int nr);
|
||||
extern const struct divecomputer *get_dive_dc(const struct dive *dive, int nr);
|
||||
|
||||
extern std::unique_ptr<dive> clone_make_first_dc(const struct dive &d, int dc_number);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue