[posix] fix compile warning on darwin (#2674)

This commit is contained in:
Jonathan Hui
2018-04-20 09:22:38 -07:00
committed by GitHub
parent e0ee632d00
commit 59de9f34ad
+2 -1
View File
@@ -67,7 +67,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
gettimeofday(&tv, NULL);
timersub(&tv, &sStart, &tv);
return (uint32_t)((tv.tv_sec * sSpeedUpFactor * MS_PER_S) + (tv.tv_usec * sSpeedUpFactor / US_PER_MS));
return (uint32_t)(((uint64_t)tv.tv_sec * sSpeedUpFactor * MS_PER_S) +
((uint64_t)tv.tv_usec * sSpeedUpFactor / US_PER_MS));
}
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)