From af5aa8a23dc66f7883989319949fc2b0255a0374 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 4 Jun 2019 13:59:44 +0200 Subject: Cleanup: Make gaspressures.h a regular include file gaspressure.h had definitions of non-exported structs, but did not declare the only function exported by gaspressure.c. Therefore, move the struct definitions into gaspressure.c and the declarations of the populate_pressure_information() function from profile.c to gaspressures.h. Signed-off-by: Berthold Stoeger --- core/gaspressures.c | 24 ++++++++++++++++++++++++ core/gaspressures.h | 24 +----------------------- core/profile.c | 1 - 3 files changed, 25 insertions(+), 24 deletions(-) (limited to 'core') diff --git a/core/gaspressures.c b/core/gaspressures.c index 1b191369b..72c6d4a57 100644 --- a/core/gaspressures.c +++ b/core/gaspressures.c @@ -25,6 +25,30 @@ #include "gaspressures.h" #include "pref.h" +/* + * simple structure to track the beginning and end tank pressure as + * well as the integral of depth over time spent while we have no + * pressure reading from the tank */ +typedef struct pr_track_struct pr_track_t; +struct pr_track_struct { + int start; + int end; + int t_start; + int t_end; + int pressure_time; + pr_track_t *next; +}; + +typedef struct pr_interpolate_struct pr_interpolate_t; +struct pr_interpolate_struct { + int start; + int end; + int pressure_time; + int acc_pressure_time; +}; + +enum interpolation_strategy {SAC, TIME, CONSTANT}; + static pr_track_t *pr_track_alloc(int start, int t_start) { pr_track_t *pt = malloc(sizeof(pr_track_t)); diff --git a/core/gaspressures.h b/core/gaspressures.h index 7e4330e69..6444ec93b 100644 --- a/core/gaspressures.h +++ b/core/gaspressures.h @@ -6,29 +6,7 @@ extern "C" { #endif -/* - * simple structure to track the beginning and end tank pressure as - * well as the integral of depth over time spent while we have no - * pressure reading from the tank */ -typedef struct pr_track_struct pr_track_t; -struct pr_track_struct { - int start; - int end; - int t_start; - int t_end; - int pressure_time; - pr_track_t *next; -}; - -typedef struct pr_interpolate_struct pr_interpolate_t; -struct pr_interpolate_struct { - int start; - int end; - int pressure_time; - int acc_pressure_time; -}; - -enum interpolation_strategy {SAC, TIME, CONSTANT}; +void populate_pressure_information(struct dive *, struct divecomputer *, struct plot_info *, int); #ifdef __cplusplus } diff --git a/core/profile.c b/core/profile.c index 092bfdd7c..d5973fcd1 100644 --- a/core/profile.c +++ b/core/profile.c @@ -32,7 +32,6 @@ struct dive *current_dive = NULL; unsigned int dc_number = 0; static struct plot_data *last_pi_entry_new = NULL; -void populate_pressure_information(struct dive *, struct divecomputer *, struct plot_info *, int); #ifdef DEBUG_PI /* debugging tool - not normally used */ -- cgit v1.2.3-70-g09d2