aboutsummaryrefslogtreecommitdiffstats
path: root/gaspressures.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-17 07:23:20 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-17 07:23:20 +0000
commitfa181d1ded081651f000e10b05e0ea9ddce75ea1 (patch)
tree61218c0596d111614100b1ca9d65a9d57a7b3cf7 /gaspressures.c
parent675646dd2f654a09dbe158515035ccb4d42d67ba (diff)
downloadsubsurface-fa181d1ded081651f000e10b05e0ea9ddce75ea1.tar.gz
More CCR code cleanup
Random constants are bad. Let's use the indices that we already calculated (and true and false if we mean boolean values). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gaspressures.c')
-rw-r--r--gaspressures.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gaspressures.c b/gaspressures.c
index fbb52a130..d8ad203f9 100644
--- a/gaspressures.c
+++ b/gaspressures.c
@@ -264,8 +264,9 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
entry = pi->entry + i;
- if (diluent_flag) { // Find the cylinder index (cyl) ..
- cyl = DILUENT_CYLINDER; // .. as well as the cylinder pressure
+ if (diluent_flag) {
+ // Find the cylinder index (cyl) and pressure
+ cyl = dive->diluent_cylinder_index;
pressure = DILUENT_PRESSURE(entry);
save_pressure = &(entry->diluentpressure[SENSOR_PR]);
save_interpolated = &(entry->diluentpressure[INTERPOLATED_PR]);
@@ -362,7 +363,7 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s
unsigned pressure;
if (diluent_flag) { // if this is a diluent cylinder:
pressure = DILUENT_PRESSURE(entry);
- cylinderid = DILUENT_CYLINDER;
+ cylinderid = dive->diluent_cylinder_index;
} else {
pressure = SENSOR_PRESSURE(entry);
cylinderid = entry->cylinderindex;
@@ -379,7 +380,7 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s
/* track the segments per cylinder and their pressure/time integral */
if (cylinderid != cylinderindex) {
if (diluent_flag) // For CCR dives:
- cylinderindex = DILUENT_CYLINDER; // indicate diluent cylinder
+ cylinderindex = dive->diluent_cylinder_index; // indicate diluent cylinder
else
cylinderindex = entry->cylinderindex;
current = pr_track_alloc(pressure, entry->sec);