aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-12 20:37:32 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-12 20:37:32 -0700
commitf4559ba9fa4610b56f27ffb20eb872908e987baf (patch)
treecab71b5fcf650d405f60c7dc72569497a90f9d95 /dive.c
parent73013911af7e6b26535bbff20ef9834d3cbbc71d (diff)
downloadsubsurface-f4559ba9fa4610b56f27ffb20eb872908e987baf.tar.gz
Plot a sick kind of temperature curve
.. without the actual text, because I'm a "random plots that cannot actually be interpreted" kind of guy. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/dive.c b/dive.c
index 32ea2ffe1..b7f612936 100644
--- a/dive.c
+++ b/dive.c
@@ -117,7 +117,6 @@ struct dive *fixup_dive(struct dive *dive)
int maxdepth = 0, mintemp = 0;
int lastdepth = 0;
int lasttemp = 0;
- temperature_t *redundant_temp = NULL;
for (i = 0; i < dive->samples; i++) {
struct sample *sample = dive->sample + i;
@@ -141,17 +140,12 @@ struct dive *fixup_dive(struct dive *dive)
/*
* If we have consecutive identical
* temperature readings, throw away
- * the redundant ones. We care about
- * the "edges" only.
+ * the redundant ones.
*/
- if (lasttemp == temp) {
- if (redundant_temp)
- redundant_temp->mkelvin = 0;
- redundant_temp = &sample->temperature;
- } else {
- redundant_temp = NULL;
+ if (lasttemp == temp)
+ sample->temperature.mkelvin = 0;
+ else
lasttemp = temp;
- }
if (!mintemp || temp < mintemp)
mintemp = temp;