diff --git a/profile.c b/profile.c index 05e84cd73..8246a961b 100644 --- a/profile.c +++ b/profile.c @@ -442,8 +442,9 @@ static void check_setpoint_events(struct dive *dive, struct divecomputer *dc, st } -struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer *dc) +struct plot_info calculate_max_limits_new(struct dive *dive) { + struct divecomputer *dc = &dive->dc; static struct plot_info pi; int maxdepth = dive->maxdepth.mm; int maxtime = 0; diff --git a/profile.h b/profile.h index 0ae9a8f84..726d10573 100644 --- a/profile.h +++ b/profile.h @@ -68,7 +68,7 @@ struct ev_select { bool plot_ev; }; -struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer *dc); +struct plot_info calculate_max_limits_new(struct dive *dive); void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int bufsize, int sum); struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi); struct plot_info *analyze_plot_info(struct plot_info *pi); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 850f357cf..05553216d 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -518,7 +518,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) * so I'll *not* calculate everything if something is not being * shown. */ - plotInfo = calculate_max_limits_new(&displayed_dive, currentdc); + plotInfo = calculate_max_limits_new(&displayed_dive); create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth); if (shouldCalculateMaxTime) maxtime = get_maxtime(&plotInfo);