mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add preprocessor directives around debug functions
These adds some ifdef's around some debug functions to disable them when not using them. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a84826090a
commit
c49f7133c3
2 changed files with 14 additions and 6 deletions
2
deco.c
2
deco.c
|
@ -187,6 +187,7 @@ double add_segment(double pressure, const struct gasmix *gasmix, int period_in_s
|
||||||
return tissue_tolerance_calc(dive);
|
return tissue_tolerance_calc(dive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DECO_CALC_DEBUG
|
||||||
void dump_tissues()
|
void dump_tissues()
|
||||||
{
|
{
|
||||||
int ci;
|
int ci;
|
||||||
|
@ -198,6 +199,7 @@ void dump_tissues()
|
||||||
printf(" %6.3e", tissue_he_sat[ci]);
|
printf(" %6.3e", tissue_he_sat[ci]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void clear_deco(double surface_pressure)
|
void clear_deco(double surface_pressure)
|
||||||
{
|
{
|
||||||
|
|
18
profile.c
18
profile.c
|
@ -21,6 +21,7 @@ char dc_number = 0;
|
||||||
|
|
||||||
static struct plot_data *last_pi_entry = NULL;
|
static struct plot_data *last_pi_entry = NULL;
|
||||||
|
|
||||||
|
#ifdef DEBUG_PI
|
||||||
/* debugging tool - not normally used */
|
/* debugging tool - not normally used */
|
||||||
static void dump_pi (struct plot_info *pi)
|
static void dump_pi (struct plot_info *pi)
|
||||||
{
|
{
|
||||||
|
@ -43,6 +44,7 @@ static void dump_pi (struct plot_info *pi)
|
||||||
}
|
}
|
||||||
printf(" }\n");
|
printf(" }\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ROUND_UP(x,y) ((((x)+(y)-1)/(y))*(y))
|
#define ROUND_UP(x,y) ((((x)+(y)-1)/(y))*(y))
|
||||||
#define DIV_UP(x,y) (((x)+(y)-1)/(y))
|
#define DIV_UP(x,y) (((x)+(y)-1)/(y))
|
||||||
|
@ -398,6 +400,7 @@ static void list_free(pr_track_t *list)
|
||||||
free(list);
|
free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_PR_TRACK
|
||||||
static void dump_pr_track(pr_track_t **track_pr)
|
static void dump_pr_track(pr_track_t **track_pr)
|
||||||
{
|
{
|
||||||
int cyl;
|
int cyl;
|
||||||
|
@ -412,6 +415,7 @@ static void dump_pr_track(pr_track_t **track_pr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This looks at the pressures for one cylinder, and
|
* This looks at the pressures for one cylinder, and
|
||||||
|
@ -508,10 +512,10 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
|
||||||
struct plot_data *entry;
|
struct plot_data *entry;
|
||||||
int cur_pr[MAX_CYLINDERS];
|
int cur_pr[MAX_CYLINDERS];
|
||||||
|
|
||||||
if (0) {
|
#ifdef DEBUG_PR_TRACK
|
||||||
/* another great debugging tool */
|
/* another great debugging tool */
|
||||||
dump_pr_track(track_pr);
|
dump_pr_track(track_pr);
|
||||||
}
|
#endif
|
||||||
for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
|
for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
|
||||||
if (!track_pr[cyl])
|
if (!track_pr[cyl])
|
||||||
continue;
|
continue;
|
||||||
|
@ -1155,8 +1159,10 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s
|
||||||
|
|
||||||
pi->meandepth = dive->dc.meandepth.mm;
|
pi->meandepth = dive->dc.meandepth.mm;
|
||||||
|
|
||||||
if (0) /* awesome for debugging - not useful otherwise */
|
#ifdef DEBUG_PI
|
||||||
dump_pi(pi);
|
/* awesome for debugging - not useful otherwise */
|
||||||
|
dump_pi(pi);
|
||||||
|
#endif
|
||||||
return analyze_plot_info(pi);
|
return analyze_plot_info(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue