From 59de9f34add7d7a50ddd96ec3d135314b29d3a7c Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 20 Apr 2018 09:22:38 -0700 Subject: [PATCH] [posix] fix compile warning on darwin (#2674) --- examples/platforms/posix/alarm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/platforms/posix/alarm.c b/examples/platforms/posix/alarm.c index 9288cfdec..8f400bc08 100644 --- a/examples/platforms/posix/alarm.c +++ b/examples/platforms/posix/alarm.c @@ -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)