cpu/native/periph/timer: fix undefined behaviour

This commit is contained in:
Kaspar Schleiser 2019-01-16 15:16:54 +01:00
parent e65a017f19
commit f5345fbd38

View File

@ -66,7 +66,7 @@ static struct itimerval itv;
static unsigned long ts2ticks(struct timespec *tp) static unsigned long ts2ticks(struct timespec *tp)
{ {
/* TODO: check for overflow */ /* TODO: check for overflow */
return((tp->tv_sec * NATIVE_TIMER_SPEED) + (tp->tv_nsec / 1000)); return(((unsigned long)tp->tv_sec * NATIVE_TIMER_SPEED) + (tp->tv_nsec / 1000));
} }
/** /**