X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=libdivecomputer.c;h=4ff41486db453fda6d76f0e3c9a27a2dd7f15588;hb=1d6903c65a4980ac51a3508db6a388ab07111341;hp=b1c86c5ee8d378ad1852a88e7d396d88885b78a1;hpb=4c6f142e85969708983e2ffd7d413e01ac84b176;p=ext%2Fsubsurface.git diff --git a/libdivecomputer.c b/libdivecomputer.c index b1c86c5..4ff4148 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -1,5 +1,7 @@ #include #include +#include +#include #include "dive.h" #include "divelist.h" @@ -107,7 +109,7 @@ static int parse_gasmixes(struct dive *dive, parser_t *parser, int ngases) he = gasmix.helium * 1000 + 0.5; /* Ignore bogus data - libdivecomputer does some crazy stuff */ - if (o2 < 210 || o2 >= 1000) + if (o2 <= AIR_PERMILLE || o2 >= 1000) o2 = 0; if (he < 0 || he >= 800 || o2+he >= 1000) he = 0; @@ -173,7 +175,7 @@ sample_cb(parser_sample_type_t type, parser_sample_value_t value, void *userdata case SAMPLE_TYPE_TIME: sample = prepare_sample(divep); sample->time.seconds = value.time; - finish_sample(*divep, sample); + finish_sample(*divep); break; case SAMPLE_TYPE_DEPTH: sample->depth.mm = value.depth * 1000 + 0.5; @@ -433,8 +435,8 @@ static void event_cb(device_t *device, device_event_t event, const void *data, v break; case DEVICE_EVENT_CLOCK: devdata->clock = *clock; - printf("Event: systime=%lld, devtime=%u\n", - clock->systime, clock->devtime); + printf("Event: systime=%"PRId64", devtime=%u\n", + (uint64_t)clock->systime, clock->devtime); break; default: break;