Add a unique id to every dive

This id is just held in memory. It's not supposed to be used for anything
but having a unique handle that represents a dive. Whenever you need to
remember a dive across an operation that might change the dive_table, this
is what you should hold on to, not a dive number, a dive pointer, or
anything like that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-01-07 09:30:01 +08:00
parent ca391035f3
commit 65e9fecd80
3 changed files with 43 additions and 1 deletions

1
dive.c
View file

@ -892,6 +892,7 @@ struct dive *fixup_dive(struct dive *dive)
weightsystem_t *ws = dive->weightsystem + i;
add_weightsystem_description(ws);
}
dive->id = getUniqID(dive);
return dive;
}