dive_table.dives = dives;
dive_table.allocated = allocated;
}
- dives[nr] = dive;
+ dives[nr] = fixup_dive(dive);
dive_table.nr = nr+1;
}
nonmatch("dive", name, buf);
}
-static unsigned int dive_size(int samples)
-{
- return sizeof(struct dive) + samples*sizeof(struct sample);
-}
-
/*
* File boundaries are dive boundaries. But sometimes there are
* multiple dives per file, so there can be other events too that
if (!dive)
return;
- if (sample->time.seconds > dive->duration.seconds) {
- if (sample->depth.mm)
- dive->duration = sample->time;
- }
-
- if (sample->depth.mm > dive->maxdepth.mm)
- dive->maxdepth.mm = sample->depth.mm;
-
- if (sample->temperature.mkelvin) {
- if (!dive->watertemp.mkelvin || dive->watertemp.mkelvin > sample->temperature.mkelvin)
- dive->watertemp = sample->temperature;
- }
-
sample = NULL;
dive->samples++;
}