From 11a0c0cc701806ccec975c67d27dec97fbb13b1f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 20 Jul 2017 14:39:02 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- core/gaspressures.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/gaspressures.c') diff --git a/core/gaspressures.c b/core/gaspressures.c index 2c9f87668..77a19429f 100644 --- a/core/gaspressures.c +++ b/core/gaspressures.c @@ -249,12 +249,12 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, if (cyl < 0) return; // Can we do this?!? pressure = O2CYLINDER_PRESSURE(entry); - save_pressure = &(entry->o2cylinderpressure[SENSOR_PR]); - save_interpolated = &(entry->o2cylinderpressure[INTERPOLATED_PR]); + save_pressure = &(entry->pressure[1][SENSOR_PR]); + save_interpolated = &(entry->pressure[1][INTERPOLATED_PR]); } else { pressure = SENSOR_PRESSURE(entry); - save_pressure = &(entry->pressure[SENSOR_PR]); - save_interpolated = &(entry->pressure[INTERPOLATED_PR]); + save_pressure = &(entry->pressure[0][SENSOR_PR]); + save_interpolated = &(entry->pressure[0][INTERPOLATED_PR]); cyl = entry->cylinderindex; } -- cgit v1.2.3-70-g09d2