From 16f52cf23d1b47c1979fcdeef013384cd1b04ed7 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 17 Feb 2013 12:05:08 -0800 Subject: Fix ordering issue in fixup We have this oddity in "fixup_dive()" that we fix up the dive water temperates and durations by looking over all the dive computer data. But we actually call that *before* we've fixed-up the dive computer data. So the water temperature is there in the samples, but hasn't made it to the generic dive computer water temperature yet, so then it doesn't make it into the dive structure either. Until the *second* time, when we have load the (partially fixed-up) data. Acked-by: Henrik Brautaset Aronsen Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- dive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dive.c b/dive.c index caeab2312..1f3f5fd0b 100644 --- a/dive.c +++ b/dive.c @@ -706,6 +706,9 @@ struct dive *fixup_dive(struct dive *dive) sanitize_cylinder_info(dive); dive->maxcns = dive->cns; + for_each_dc(dive, dc) + fixup_dive_dc(dive, dc); + fixup_water_salinity(dive); fixup_surface_pressure(dive); fixup_meandepth(dive); @@ -713,9 +716,6 @@ struct dive *fixup_dive(struct dive *dive) fixup_watertemp(dive); fixup_airtemp(dive); - for_each_dc(dive, dc) - fixup_dive_dc(dive, dc); - for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; add_cylinder_description(&cyl->type); -- cgit v1.2.3-70-g09d2