From f4ef1c4bc8805600e018777f18f3f29682e40c2d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 4 Jun 2019 20:41:31 +0200 Subject: [PATCH] Cleanup: localize enum and table in divelist.c The cns_table was only used in divelist.c. Make it of static linkage accordingly. The cns_table_headers enum is likewise only used in divelist.c. Therefore move it from the header to the .c file. Signed-off-by: Berthold Stoeger --- core/divelist.c | 4 +++- core/divelist.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/divelist.c b/core/divelist.c index 3da17c79a..71391d505 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -159,6 +159,7 @@ static int calculate_otu(const struct dive *dive) } return lrint(otu); } + /* Table of maximum oxygen exposure durations, used in CNS calulations. This table shows the official NOAA maximum O2 exposure limits (in seconds) for different PO2 values. It also gives slope values for linear interpolation for intermediate PO2 values between the tabulated PO2 values in the 1st column. @@ -169,7 +170,8 @@ static int calculate_otu(const struct dive *dive) preserve the integer structure of the table, all slopes are given as slope*10: divide by 10 to get the valid slope. The columns below are: po2 (mbar), Maximum Single Exposure (seconds), single_slope, Maximum 24 hour Exposure (seconds), 24h_slope */ -int const cns_table[][5] = { +enum cns_table_headers {PO2VAL, SINGLE_EXP, SINGLE_SLOPE, DAILY_EXP, DAILY_SLOPE, NO_COLUMNS}; +static int const cns_table[][5] = { { 1600, 45 * 60, 456, 150 * 60, 180 }, { 1550, 83 * 60, 456, 165 * 60, 180 }, { 1500, 120 * 60, 444, 180 * 60, 180 }, diff --git a/core/divelist.h b/core/divelist.h index f2e243b00..7b57b41ac 100644 --- a/core/divelist.h +++ b/core/divelist.h @@ -60,8 +60,6 @@ int get_dive_id_closest_to(timestamp_t when); void clear_dive_file_data(); void clear_table(struct dive_table *table); -typedef enum {PO2VAL, SINGLE_EXP, SINGLE_SLOPE, DAILY_EXP, DAILY_SLOPE, NO_COLUMNS} cns_table_headers; - #ifdef DEBUG_TRIP extern void dump_selection(void); #endif