diff options
-rw-r--r-- | gaspressures.c | 25 | ||||
-rw-r--r-- | gaspressures.h | 1 | ||||
-rw-r--r-- | profile.h | 2 |
3 files changed, 11 insertions, 17 deletions
diff --git a/gaspressures.c b/gaspressures.c index b14264a3b..8474f6e31 100644 --- a/gaspressures.c +++ b/gaspressures.c @@ -9,23 +9,18 @@ * populate_pressure_information() -> calc_pressure_time() * -> fill_missing_tank_pressures() -> fill_missing_segment_pressures() * -> get_pr_interpolate_data() + * + * The pr_track_t related functions below implement a linked list that is used by + * the majority of the functions below. The linked list covers a part of the dive profile + * for which there are no cylinder pressure data. Each element in the linked list + * represents a segment between two consecutive points on the dive profile. + * pr_track_t is defined in gaspressures.h */ -#include "gettext.h" -#include <limits.h> -#include <string.h> - #include "dive.h" #include "display.h" -#include "divelist.h" - #include "profile.h" #include "gaspressures.h" -#include "deco.h" -#include "libdivecomputer/parser.h" -#include "libdivecomputer/version.h" -#include "membuffer.h" - static pr_track_t *pr_track_alloc(int start, int t_start) { @@ -102,7 +97,7 @@ static void dump_pr_track(pr_track_t **track_pr) * segments according to how big of a time_pressure area * they have. */ -void fill_missing_segment_pressures(pr_track_t *list) +static void fill_missing_segment_pressures(pr_track_t *list) { while (list) { int start = list->start, end; @@ -160,7 +155,7 @@ void dump_pr_interpolate(int i, pr_interpolate_t interpolate_pr) #endif -struct pr_interpolate_struct get_pr_interpolate_data(pr_track_t *segment, struct plot_info *pi, int cur) +static struct pr_interpolate_struct get_pr_interpolate_data(pr_track_t *segment, struct plot_info *pi, int cur) { struct pr_interpolate_struct interpolate; int i; @@ -211,7 +206,7 @@ struct pr_interpolate_struct get_pr_interpolate_data(pr_track_t *segment, struct return interpolate; } -void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, pr_track_t **track_pr) +static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, pr_track_t **track_pr) { int cyl, i; struct plot_data *entry; @@ -284,7 +279,7 @@ void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, pr_tra * scale pressures, so it ends up being a unitless scaling * factor. */ -inline int calc_pressure_time(struct dive *dive, struct divecomputer *dc, struct plot_data *a, struct plot_data *b) +static inline int calc_pressure_time(struct dive *dive, struct divecomputer *dc, struct plot_data *a, struct plot_data *b) { int time = b->sec - a->sec; int depth = (a->depth + b->depth) / 2; diff --git a/gaspressures.h b/gaspressures.h index e48a32418..71fee341e 100644 --- a/gaspressures.h +++ b/gaspressures.h @@ -27,6 +27,7 @@ struct pr_interpolate_struct { int acc_pressure_time; }; + #ifdef __cplusplus } #endif @@ -81,13 +81,11 @@ int get_maxtime(struct plot_info *pi); * partial pressure graphs */ int get_maxdepth(struct plot_info *pi); - #define SENSOR_PR 0 #define INTERPOLATED_PR 1 #define SENSOR_PRESSURE(_entry) (_entry)->pressure[SENSOR_PR] #define INTERPOLATED_PRESSURE(_entry) (_entry)->pressure[INTERPOLATED_PR] #define GET_PRESSURE(_entry) (SENSOR_PRESSURE(_entry) ? SENSOR_PRESSURE(_entry) : INTERPOLATED_PRESSURE(_entry)) - #define SAC_WINDOW 45 /* sliding window in seconds for current SAC calculation */ #ifdef __cplusplus |