Commit c3a5c415 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Make sure we use large enough datatypes for the time.

(Especially on 32bit systems like ARM)
parent 88663f99
......@@ -49,7 +49,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static controller_trigger_time ts2timestamp(struct timespec *ts)
{
return ts->tv_nsec + ts->tv_sec * 1000000000;
return (uint64_t)ts->tv_nsec + (uint64_t)ts->tv_sec * 1000000000;
}
......@@ -64,7 +64,7 @@ static controller_trigger_time timestamp(void)
static int wait_init_default(struct controller_trigger *trigger, struct timespec *ts_interval)
{
interval = ts_interval->tv_sec * 1000000000 + ts_interval->tv_nsec;
interval = (uint64_t)ts_interval->tv_sec * 1000000000 + (uint64_t)ts_interval->tv_nsec;
#ifndef __FreeBSD__
sample_clock = CLOCK_REALTIME;
......
......@@ -54,7 +54,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static controller_trigger_time ts2timestamp(struct timespec *ts)
{
return ts->tv_nsec + ts->tv_sec * 1000000000;
return (uint64_t)ts->tv_nsec + (uint64_t)ts->tv_sec * 1000000000;
}
......@@ -69,7 +69,7 @@ static controller_trigger_time timestamp(void)
static int wait_init_default(struct controller_trigger *trigger, struct timespec *ts_interval)
{
interval = ts_interval->tv_sec * 1000000000 + ts_interval->tv_nsec;
interval = (uint64_t)ts_interval->tv_sec * 1000000000 + (uint64_t)ts_interval->tv_nsec;
#ifndef __FreeBSD__
sample_clock = CLOCK_REALTIME;
......
......@@ -54,7 +54,7 @@ static int sample_timing_sane(controller_trigger_time t_exp, controller_trigger_
static controller_trigger_time ts2timestamp(struct timespec *ts)
{
return ts->tv_nsec + ts->tv_sec * 1000000000;
return (uint64_t)ts->tv_nsec + (uint64_t)ts->tv_sec * 1000000000;
}
......@@ -69,7 +69,7 @@ static controller_trigger_time timestamp(void)
static int wait_init_default(struct controller_trigger *trigger, struct timespec *ts_interval)
{
interval = ts_interval->tv_sec * 1000000000 + ts_interval->tv_nsec;
interval = (uint64_t)ts_interval->tv_sec * 1000000000 + (uint64_t)ts_interval->tv_nsec;
#ifndef __FreeBSD__
sample_clock = CLOCK_REALTIME;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment