fix compiler warning

This commit is contained in:
Yang Tse
2008-07-10 08:21:48 +00:00
parent 8ee63e432d
commit 2265b9281c
3 changed files with 8 additions and 9 deletions
+4 -6
View File
@@ -133,13 +133,11 @@ int ares__timeadd(struct timeval *now,
}
/* return time offset between now and (future) check, in milliseconds */
int ares__timeoffset(struct timeval *now,
struct timeval *check)
long ares__timeoffset(struct timeval *now,
struct timeval *check)
{
int secs = (check->tv_sec - now->tv_sec); /* this many seconds */
int us = (check->tv_usec - now->tv_usec); /* this many microseconds */
return secs*1000 + us/1000; /* return them combined as milliseconds */
return (check->tv_sec - now->tv_sec)*1000 +
(check->tv_usec - now->tv_usec)/1000;
}