From 5f05173e793d49319c727240014b59a04bd4075c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 2 Sep 2011 16:40:28 -0700 Subject: Do a dive de-dup pass If given multiple dives at the same time, just de-dup the dives. This happens when you've dumped the whole dive-computer several times, and some dives show up in multiple dumps. When de-duping, try to avoid dropping data. So if one dive has notes attached to it, and the other one does not, pick the notes from the dive that does have them. Obvious stuff like that. The sample merge is also written so that it should be possible to merge two dives. Which we don't actually do yet. Signed-off-by: Linus Torvalds --- dive.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dive.h') diff --git a/dive.h b/dive.h index c1b95e3f6..eaafe8aeb 100644 --- a/dive.h +++ b/dive.h @@ -138,4 +138,9 @@ extern void parse_xml_file(const char *filename); extern void flush_dive_info_changes(void); extern void save_dives(const char *filename); +static inline unsigned int dive_size(int samples) +{ + return sizeof(struct dive) + samples*sizeof(struct sample); +} + #endif /* DIVE_H */ -- cgit v1.2.3-70-g09d2