cleanup: constify populate_pressure_information()

This has only read access on the dive. Make the parameter const.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-11 17:28:10 +01:00 committed by Dirk Hohndel
parent ad1e57dd67
commit 8d423359a5
2 changed files with 4 additions and 4 deletions

View file

@ -228,7 +228,7 @@ static struct pr_interpolate_struct get_pr_interpolate_data(pr_track_t *segment,
return interpolate;
}
static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, pr_track_t *track_pr, int cyl)
static void fill_missing_tank_pressures(const struct dive *dive, struct plot_info *pi, pr_track_t *track_pr, int cyl)
{
int i;
struct plot_data *entry;
@ -335,7 +335,7 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
* scale pressures, so it ends up being a unitless scaling
* factor.
*/
static inline int calc_pressure_time(struct dive *dive, struct plot_data *a, struct plot_data *b)
static inline int calc_pressure_time(const struct dive *dive, struct plot_data *a, struct plot_data *b)
{
int time = b->sec - a->sec;
int depth = (a->depth + b->depth) / 2;
@ -365,7 +365,7 @@ static void debug_print_pressures(struct plot_info *pi)
* calculates the summed pressure-time value for the duration of the dive and stores these * in the pr_track_alloc
* structures. This function is called by create_plot_info_new() in profile.c
*/
void populate_pressure_information(struct dive *dive, struct divecomputer *dc, struct plot_info *pi, int sensor)
void populate_pressure_information(const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi, int sensor)
{
UNUSED(dc);
int first, last, cyl;

View file

@ -6,7 +6,7 @@
extern "C" {
#endif
void populate_pressure_information(struct dive *, struct divecomputer *, struct plot_info *, int);
void populate_pressure_information(const struct dive *, const struct divecomputer *, struct plot_info *, int);
#ifdef __cplusplus
}