diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 13:13:11 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-29 13:18:13 -0700 |
commit | 56395b38946d4b7de9e485098e928e8e432ef920 (patch) | |
tree | 3757c7fce14ffd1ad6c68cdbd899e9c49979d2c5 /profile.c | |
parent | 45725d1c3036e0df16e437b1c3ac14703f0a780c (diff) | |
download | subsurface-56395b38946d4b7de9e485098e928e8e432ef920.tar.gz |
Don't assume that pressures are always positive
When planning a dive, the dive could use more gas than is in the cylinder.
So getting a negative end pressure is a useful indication to the user that
there plan might not be a good one.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -683,7 +683,7 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer /* Get the per-cylinder maximum pressure if they are manual */ for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) { - unsigned int mbar = dive->cylinder[cyl].start.mbar; + int mbar = dive->cylinder[cyl].start.mbar; if (mbar > maxpressure) maxpressure = mbar; if (mbar < minpressure) @@ -964,7 +964,7 @@ static void populate_pressure_information(struct dive *dive, struct divecomputer current = NULL; for (i = 0; i < pi->nr; i++) { struct plot_data *entry = pi->entry + i; - unsigned pressure = SENSOR_PRESSURE(entry); + int pressure = SENSOR_PRESSURE(entry); /* discrete integration of pressure over time to get the SAC rate equivalent */ if (current) { |