aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 05:37:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 05:37:18 -0800
commitffc61e135743a1c7a2f81c1f96d0767fd3560e4f (patch)
tree4117465b59fabfae30803dbd6c375ff0c4c15941
parent4e6a0c8503a66c78b9d6d6d599ea9422531db3a7 (diff)
downloadsubsurface-ffc61e135743a1c7a2f81c1f96d0767fd3560e4f.tar.gz
Don't use current_dive instead of the argument to the function
I could have gone either way - the other alternative would have been to remove the argument to the function. But since current_dive is a macro and since the semantic of the function make sense with the argument being passed in, it seemed better to just not use current_dive in the function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index f551840ec..435f2bebc 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -417,14 +417,12 @@ void DivePlannerPointsModel::createSimpleDive()
void DivePlannerPointsModel::loadFromDive(dive* d)
{
- /* We need to make a copy, because
- * as soon as the model is modified, it will
- * remove all samples from the current dive.
- * */
- memcpy(&backupDive, current_dive, sizeof(struct dive));
- copy_samples(current_dive, &backupDive);
- copy_events(current_dive, &backupDive);
- copy_cylinders(current_dive, stagingDive); // this way the correct cylinder data is shown
+ // We need to make a copy, because as soon as the model is modified, it will
+ // remove all samples from the dive.
+ memcpy(&backupDive, d, sizeof(struct dive));
+ copy_samples(d, &backupDive);
+ copy_events(d, &backupDive);
+ copy_cylinders(d, stagingDive); // this way the correct cylinder data is shown
CylindersModel::instance()->setDive(stagingDive);
int lasttime = 0;
// we start with the first gas and see if it was changed