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>
This commit is contained in:
Dirk Hohndel 2014-02-12 05:37:18 -08:00
parent 4e6a0c8503
commit ffc61e1357

View file

@ -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