summaryrefslogtreecommitdiffstats
path: root/core/load-git.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-07-20 14:39:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-20 17:32:54 -0700
commit11a0c0cc701806ccec975c67d27dec97fbb13b1f (patch)
tree15a3ace16588b80a88fea76cec30386414bfc3f7 /core/load-git.c
parent94d8abd1a292ac0b02064c906da3a66ccf9e6737 (diff)
downloadsubsurface-11a0c0cc701806ccec975c67d27dec97fbb13b1f.tar.gz
Unify sample pressure and o2pressure as pressure[2] array
We currently carry two pressures around for all the samples and plot info, but the second pressure is reserved for CCR dives as the O2 cylinder pressure. That's kind of annoying when we *could* use it for regular sidemount dives as the secondary pressure. So start prepping for that instead: don't make it "pressure" and "o2pressure", make it just be an array of two pressure values. NOTE! This is purely mindless prepwork. It literally just does a search-and-replace, keeping the exact same semantics, so "pressure[1]" is still just O2 pressure. But at some future date, we can now start using it for a second sensor value for sidemount instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/load-git.c')
-rw-r--r--core/load-git.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/load-git.c b/core/load-git.c
index 8c39c494e..4357e8f31 100644
--- a/core/load-git.c
+++ b/core/load-git.c
@@ -540,7 +540,7 @@ static void parse_sample_keyvalue(void *_sample, const char *key, const char *va
}
if (!strcmp(key, "o2pressure")) {
pressure_t p = get_pressure(value);
- sample->o2cylinderpressure.mbar = p.mbar;
+ sample->pressure[1].mbar = p.mbar;
return;
}
if (!strcmp(key, "heartbeat")) {
@@ -574,7 +574,7 @@ static char *parse_sample_unit(struct sample *sample, double val, char *unit)
sample->depth.mm = lrint(1000*val);
break;
case 'b':
- sample->cylinderpressure.mbar = lrint(1000*val);
+ sample->pressure[0].mbar = lrint(1000*val);
break;
default:
sample->temperature.mkelvin = C_to_mkelvin(val);
@@ -600,7 +600,7 @@ static struct sample *new_sample(struct divecomputer *dc)
struct sample *sample = prepare_sample(dc);
if (sample != dc->sample) {
memcpy(sample, sample-1, sizeof(struct sample));
- sample->cylinderpressure.mbar = 0;
+ sample->pressure[0].mbar = 0;
}
return sample;
}