From 41fc921ce47672ffc297c894c83e8469cfed6d3e Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Fri, 24 Jan 2020 05:03:49 +0000 Subject: [PATCH] windows: Fix a warning on conversion to unsigned int. The result should be safe because we only use this function on time differences as part of timeout calculations, not on absolute times. Add an explicit cast to suppress the warning. --- timing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timing.c b/timing.c index 3a5f5c7..25876d6 100644 --- a/timing.c +++ b/timing.c @@ -102,7 +102,7 @@ SP_PRIV unsigned int time_as_ms(const struct time *time) #ifdef _WIN32 LARGE_INTEGER frequency; QueryPerformanceFrequency(&frequency); - return time->ticks / (frequency.QuadPart / 1000); + return (unsigned int) (time->ticks / (frequency.QuadPart / 1000)); #else return time->tv.tv_sec * 1000 + time->tv.tv_usec / 1000; #endif