mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
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.
This commit is contained in:
2
timing.c
2
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
|
||||
|
Reference in New Issue
Block a user