From e3a8ed5183ed5a24e391395c9faeae03dc9e4a6a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 30 Jan 2013 08:10:46 +1100 Subject: Massive cleanup Mostly coding style and whitespace changes plus making lots of functions static that have no need to be extern. This also helped find a bit of code that is actually no longer used. This should have absolutely no functional impact - all changes should be purely cosmetic. But it removes a bunch of lines of code and makes the rest easier to read. Signed-off-by: Dirk Hohndel --- profile.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'profile.c') diff --git a/profile.c b/profile.c index b57bacd15..ce3dd81e3 100644 --- a/profile.c +++ b/profile.c @@ -3,11 +3,6 @@ * uses cairo to draw it */ #include -#include -#include -#include -#include -#include #include "dive.h" #include "display.h" @@ -173,7 +168,7 @@ void init_profile_background(struct graphics_context *gc) set_source_rgba(gc, BACKGROUND); } -void pattern_add_color_stop_rgba(struct graphics_context *gc, cairo_pattern_t *pat, double o, color_indice_t c) +static void pattern_add_color_stop_rgba(struct graphics_context *gc, cairo_pattern_t *pat, double o, color_indice_t c) { const color_t *col = &profile_color[c]; struct rgba rgb = col->media[gc->printer]; @@ -223,7 +218,7 @@ static int get_maxtime(struct plot_info *pi) * calculate the space dynamically. * This is seamless since 600/4 = 150. */ - if ( seconds < 600 ) + if (seconds < 600) return ROUND_UP(seconds+seconds/4, 60); else return ROUND_UP(seconds+150, 60); @@ -1234,8 +1229,9 @@ static struct plot_info *analyze_plot_info(struct plot_info *pi) entry->velocity = velocity((entry[0].depth - entry[past].depth) / (entry[0].sec - entry[past].sec)); } - } else + } else { entry->velocity = STABLE; + } } /* One-, two- and three-minute minmax data */ @@ -1699,7 +1695,7 @@ static void populate_cylinder_pressure_data(int idx, int start, int end, struct } /* .. and the last entry with the ending cylinder pressure */ - for (i = pi->nr; --i >= 0; ) { + for (i = pi->nr; --i >= 0; /* nothing */) { struct plot_data *entry = pi->entry+i; if (entry->cylinderindex != idx) continue; @@ -1849,14 +1845,14 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d (entry->po2 / amb_pressure * O2_DENSITY + entry->pn2 / amb_pressure * N2_DENSITY + entry->phe / amb_pressure * HE_DENSITY) / (O2_IN_AIR * O2_DENSITY + N2_IN_AIR * N2_DENSITY) * 1000 -10000; - if(entry->mod <0) - entry->mod=0; - if(entry->ead <0) - entry->ead=0; - if(entry->end <0) - entry->end=0; - if(entry->eadd <0) - entry->eadd=0; + if (entry->mod < 0) + entry->mod = 0; + if (entry->ead < 0) + entry->ead = 0; + if (entry->end < 0) + entry->end = 0; + if (entry->eadd < 0) + entry->eadd = 0; if (entry->po2 > pi->maxpp && prefs.pp_graphs.po2) pi->maxpp = entry->po2; -- cgit v1.2.3-70-g09d2