mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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:
parent
4e6a0c8503
commit
ffc61e1357
1 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue