Next round of code removal and header cleanup

None of this is used anywhere

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-07 16:13:13 -07:00
parent 054406b420
commit 2627ea927d
7 changed files with 2 additions and 101 deletions

8
dive.h
View file

@ -649,11 +649,6 @@ extern void remember_event(const char *eventname);
extern int evn_foreach(void (*callback)(const char *, int *, void *), void *data);
extern void clear_events(void);
extern int add_new_dive(struct dive *dive);
extern bool edit_trip(dive_trip_t *trip);
extern int edit_dive_info(struct dive *dive, bool newdive);
extern int edit_multi_dive_info(struct dive *single_dive);
extern void set_dc_nickname(struct dive *dive);
extern void set_autogroup(bool value);
extern int total_weight(struct dive *);
@ -717,9 +712,6 @@ struct diveplan {
};
struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, int depth, int o2, int he, int po2);
void add_depth_to_nth_dp(struct diveplan *diveplan, int idx, int depth);
void add_gas_to_nth_dp(struct diveplan *diveplan, int idx, int o2, int he);
void free_dps(struct divedatapoint *dp);
void get_gas_string(int o2, int he, char *buf, int len);
struct divedatapoint *create_dp(int time_incr, int depth, int o2, int he, int po2);
void dump_plan(struct diveplan *diveplan);

View file

@ -12,9 +12,6 @@
* int get_divenr(struct dive *dive)
* double init_decompression(struct dive *dive)
* void update_cylinder_related_info(struct dive *dive)
* void get_location(struct dive *dive, char **str)
* void get_cylinder(struct dive *dive, char **str)
* void get_suit(struct dive *dive, char **str)
* void dump_trip_list(void)
* dive_trip_t *find_matching_trip(timestamp_t when)
* void insert_trip(dive_trip_t **dive_trip_p)
@ -101,38 +98,6 @@ int trip_has_selected_dives(dive_trip_t *trip)
return 0;
}
/* Get the values as we want to show them. Whole feet. But meters with one decimal for
* values less than 20m, without decimals for larger values */
void get_depth_values(int depth, int *depth_int, int *depth_decimal, int *show_decimal)
{
int integer, frac;
*show_decimal = 1;
switch (prefs.units.length) {
case METERS:
/* To tenths of meters */
depth = (depth + 49) / 100;
integer = depth / 10;
frac = depth % 10;
if (integer < 20)
break;
if (frac >= 5)
integer++;
*show_decimal = 0;
break;
case FEET:
integer = mm_to_feet(depth) + 0.5;
*show_decimal = 0;
break;
default:
/* can't happen */
return;
}
*depth_int = integer;
if (*show_decimal)
*depth_decimal = frac;
}
/*
* Get "maximal" dive gas for a dive.
* Rules:

View file

@ -23,12 +23,8 @@ extern char *get_nitrox_string(struct dive *dive);
extern dive_trip_t *find_trip_by_idx(int idx);
extern int trip_has_selected_dives(dive_trip_t *trip);
extern void get_depth_values(int depth, int *depth_int, int *depth_decimal, int *show_decimal);
extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p);
extern int get_divenr(struct dive *dive);
extern void get_location(struct dive *dive, char **str);
extern void get_cylinder(struct dive *dive, char **str);
extern void get_suit(struct dive *dive, char **str);
extern dive_trip_t *find_matching_trip(timestamp_t when);
extern void remove_dive_from_trip(struct dive *dive);
extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive);

View file

@ -336,45 +336,6 @@ struct divedatapoint *get_nth_dp(struct diveplan *diveplan, int idx)
return dp;
}
/* return -1 to warn about potentially very long calculation */
int add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, bool is_rel)
{
struct divedatapoint *pdp, *dp = get_nth_dp(diveplan, idx);
if (idx > 0) {
pdp = get_nth_dp(diveplan, idx - 1);
if (duration && (is_rel || duration <= pdp->time))
duration += pdp->time;
}
dp->time = duration;
if (duration > 180 * 60)
return -1;
return 0;
}
/* this function is ONLY called from the dialog callback - so it
* marks this entry as 'entered'.
* Do NOT call from other parts of the planning code without changing
* that logic */
void add_depth_to_nth_dp(struct diveplan *diveplan, int idx, int depth)
{
struct divedatapoint *dp = get_nth_dp(diveplan, idx);
dp->depth = depth;
dp->entered = TRUE;
}
void add_gas_to_nth_dp(struct diveplan *diveplan, int idx, int o2, int he)
{
struct divedatapoint *dp = get_nth_dp(diveplan, idx);
dp->o2 = o2;
dp->he = he;
}
void add_po2_to_nth_dp(struct diveplan *diveplan, int idx, int po2)
{
struct divedatapoint *dp = get_nth_dp(diveplan, idx);
dp->po2 = po2;
}
void add_to_end_of_diveplan(struct diveplan *diveplan, struct divedatapoint *dp)
{
struct divedatapoint **lastdp = &diveplan->dp;

View file

@ -10,8 +10,6 @@ extern int validate_gas(const char *text, int *o2_p, int *he_p);
extern int validate_po2(const char *text, int *mbar_po2);
extern timestamp_t current_time_notz(void);
extern void show_planned_dive(char **error_string_p);
extern int add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, bool is_rel);
extern void add_po2_to_nth_dp(struct diveplan *diveplan, int idx, int po2);
extern void set_last_stop(bool last_stop_6m);
extern struct diveplan diveplan;

View file

@ -10,21 +10,17 @@
* Zurich) but did not actually use any of his copyrighted code, therefore the license under which
* he released his code does not apply to this new implementation in C
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
#include "gettext.h"
#include "gettext.h"
#include "libdivecomputer.h"
#include "uemis.h"
#include "dive.h"
#include "divelist.h"
#include "display.h"
#define ERR_FS_ALMOST_FULL QT_TR_NOOP("Uemis Zurich: File System is almost full\nDisconnect/reconnect the dive computer\nand click \'Retry\'")
#define ERR_FS_FULL QT_TR_NOOP("Uemis Zurich: File System is full\nDisconnect/reconnect the dive computer\nand try again")
#define ERR_FS_SHORT_WRITE QT_TR_NOOP("Short write to req.txt file\nIs the Uemis Zurich plugged in correctly?")

View file

@ -6,17 +6,10 @@
*
* Licensed under the MIT license.
*/
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "gettext.h"
#define __USE_XOPEN
#include <time.h>
#include <math.h>
#include "dive.h"
#include "uemis.h"