Building with MSVC gave:
warning C4244: '=': conversion from 'LONGLONG' to 'long', possible loss of data
when assigning the results of these calculation to the long fields
of struct timeval. The result should be OK, but put an explicit
cast in to make the change clear and suppress the warning.
#ifdef _WIN32
LARGE_INTEGER frequency;
QueryPerformanceFrequency(&frequency);
- tv->tv_sec = time->ticks / frequency.QuadPart;
- tv->tv_usec = (time->ticks % frequency.QuadPart) /
- (frequency.QuadPart / 1000000);
+ tv->tv_sec = (long) (time->ticks / frequency.QuadPart);
+ tv->tv_usec = (long) ((time->ticks % frequency.QuadPart) /
+ (frequency.QuadPart / 1000000));
#else
*tv = time->tv;
#endif