diff --git a/src/driver_playback.c b/src/driver_playback.c index afe64206..0a17b08d 100644 --- a/src/driver_playback.c +++ b/src/driver_playback.c @@ -222,7 +222,7 @@ static int parse_and_run_imu(const char *line, SurvivePlaybackData *driver, bool return 0; char dev[10]; - int timecode = 0; + survive_timecode timecode = 0; FLT accelgyro[9] = { 0 }; int mask; int id; @@ -231,7 +231,7 @@ static int parse_and_run_imu(const char *line, SurvivePlaybackData *driver, bool char i_char = 0; int rr = sscanf(line, - "%s %c %d %d " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat + "%s %c %d %u " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat " " FLT_sformat "%d", dev, &i_char, &mask, &timecode, &accelgyro[0], &accelgyro[1], &accelgyro[2], &accelgyro[3], &accelgyro[4], &accelgyro[5], &accelgyro[6], &accelgyro[7], &accelgyro[8], &id); diff --git a/src/driver_usbmon.c b/src/driver_usbmon.c index a476afe7..0858e5c8 100644 --- a/src/driver_usbmon.c +++ b/src/driver_usbmon.c @@ -790,7 +790,14 @@ static int gzip_cookie_close(void *cookie) { return gzclose((gzFile)cookie); } static ssize_t gzip_cookie_read(void *cookie, char *buf, size_t nbytes) { return gzread((gzFile)cookie, buf, nbytes); } -int gzip_cookie_seek(void *cookie, z_off_t *pos, int __w) { return gzseek((gzFile)cookie, *pos, __w); } +static int gzip_cookie_seek(void *cookie, off64_t *pos, int whence) { + z_off64_t r = gzseek64((gzFile)cookie, (z_off64_t)*pos, whence); + if (r < 0) + return -1; + + *pos = (off64_t)r; + return 0; +} cookie_io_functions_t gzip_cookie = { .close = gzip_cookie_close, .write = gzip_cookie_write, .read = gzip_cookie_read, .seek = gzip_cookie_seek}; diff --git a/src/survive_sensor_activations.c b/src/survive_sensor_activations.c index e5d18e16..bdc3ee2f 100644 --- a/src/survive_sensor_activations.c +++ b/src/survive_sensor_activations.c @@ -454,7 +454,7 @@ SURVIVE_EXPORT survive_long_timecode SurviveSensorActivations_long_timecode_ligh use that as a basis. It's worth noting that I've never seen a system develop this while running; it would likely cause some chaos if it did since it'd kick the kalman out of sorts. ***/ - if (self->last_imu != 0 && labs(time_sync_error) > 48000000) { + if (self->last_imu != 0 && llabs(time_sync_error) > 48000000) { int64_t offset = 0x10000000; int scale = DIV_ROUND_CLOSEST(time_sync_error, offset); initial_time -= offset * scale;