From aa3295d7f00bdab3788ea8281ed4a305b1614c13 Mon Sep 17 00:00:00 2001 From: Ernest Chen Date: Tue, 26 Mar 2019 17:53:57 +0800 Subject: [PATCH] [src/clock.c] avoid warning --- src/clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clock.c b/src/clock.c index 5fcd1d4ae4..a652282b6e 100644 --- a/src/clock.c +++ b/src/clock.c @@ -112,13 +112,13 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms) rt_tick_t tick; if (ms < 0) - { - tick = RT_WAITING_FOREVER; + { + tick = (rt_tick_t)RT_WAITING_FOREVER; } else { tick = RT_TICK_PER_SECOND * (ms / 1000); - tick += (RT_TICK_PER_SECOND * (ms%1000) + 999) / 1000; + tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000; } /* return the calculated tick */