summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Maximilian Güntner <maximilian.guentner@gmail.com>2012-06-09 22:40:12 +0200
committerGravatar Maximilian Güntner <maximilian.guentner@gmail.com>2012-06-09 22:40:12 +0200
commit0a7fa8ea50ad65b350ebcc435dd47eae02d8bcbe (patch)
tree0ddbc054cc6ac2b56a306a2656a59be87da56ac4 /profile.c
parentb7ae9ad5b16e680dfc4d976e877f77f6bb1a9e3a (diff)
downloadsubsurface-0a7fa8ea50ad65b350ebcc435dd47eae02d8bcbe.tar.gz
fixed indentation
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/profile.c b/profile.c
index 728409ec2..5e603f898 100644
--- a/profile.c
+++ b/profile.c
@@ -189,14 +189,13 @@ static void dump_pi (struct plot_info *pi)
static int get_maxtime(struct plot_info *pi)
{
int seconds = pi->maxtime;
- if (seconds < 600)
- {
- /* Possible apnea dive, we scale accordingly */
- return ROUND_UP(seconds+seconds/4, 60);
- } else {
- /* min 30 minutes, rounded up to 5 minutes, with at least 2.5 minutes to spare */
- return MAX(30*60, ROUND_UP(seconds+150, 60*5));
- }
+ if (seconds < 600) {
+ /* Possible apnea dive, we scale accordingly */
+ return ROUND_UP(seconds+seconds/4, 60);
+ } else {
+ /* min 30 minutes, rounded up to 5 minutes, with at least 2.5 minutes to spare */
+ return MAX(30*60, ROUND_UP(seconds+150, 60*5));
+ }
}
static int get_maxdepth(struct plot_info *pi)
@@ -456,15 +455,14 @@ static void plot_depth_profile(struct graphics_context *gc, struct plot_info *pi
/* Get plot scaling limits */
maxtime = get_maxtime(pi);
maxdepth = get_maxdepth(pi);
- /* We check whether this has been an apnea dive and overwrite
- * the increments in order to get reasonable time markers */
- if (maxtime < 600)
- {
- increments[0] = 10;
- increments[1] = 20;
- increments[2] = 30;
- increments[3] = 60;
- }
+ /* We check whether this has been an apnea dive and overwrite
+ * the increments in order to get reasonable time markers */
+ if (maxtime < 600) {
+ increments[0] = 10;
+ increments[1] = 20;
+ increments[2] = 30;
+ increments[3] = 60;
+ }
/* Time markers: at most every 5 min, but no more than 12 markers
* and for convenience we do 5, 10, 15 or 30 min intervals.
* This allows for 6h dives - enough (I hope) for even the craziest
@@ -491,16 +489,15 @@ static void plot_depth_profile(struct graphics_context *gc, struct plot_info *pi
/* now the text on the time markers */
text_render_options_t tro = {10, TIME_TEXT, CENTER, TOP};
- if (maxtime < 600)
- {
- /* Be a bit more verbose with shorter (apnea) dives */
- for (i = incr; i < maxtime; i += incr)
- plot_text(gc, &tro, i, 1, "%d:%d", i/60, i%60);
- } else {
- /* Only render the time on every second marker for normal dives */
- for (i = incr; i < maxtime; i += 2 * incr)
- plot_text(gc, &tro, i, 1, "%d", i/60);
- }
+ if (maxtime < 600) {
+ /* Be a bit more verbose with shorter (apnea) dives */
+ for (i = incr; i < maxtime; i += incr)
+ plot_text(gc, &tro, i, 1, "%d:%d", i/60, i%60);
+ } else {
+ /* Only render the time on every second marker for normal dives */
+ for (i = incr; i < maxtime; i += 2 * incr)
+ plot_text(gc, &tro, i, 1, "%d", i/60);
+ }
/* Depth markers: every 30 ft or 10 m*/
gc->leftx = 0; gc->rightx = 1.0;
gc->topy = 0; gc->bottomy = maxdepth;