diff --git a/reactos/lib/adns/adns_win32/adns_unix_calls.c b/reactos/lib/adns/adns_win32/adns_unix_calls.c index e1d9bee24be..4cdbde18421 100644 --- a/reactos/lib/adns/adns_win32/adns_unix_calls.c +++ b/reactos/lib/adns/adns_win32/adns_unix_calls.c @@ -29,21 +29,20 @@ #include "adns.h" -int adns_writev(int FileDescriptor, const struct iovec * iov, int iovCount) +int adns_writev(SOCKET FileDescriptor, const struct iovec * iov, int iovCount) { - size_t total_len = 0; - int bytes_written = 0; + int total_len = 0; int i = 0, r = 0; char *buf = NULL, *p = NULL; for(; i < iovCount; i++) total_len += iov[i].iov_len; - p = buf = (char *)alloca(total_len); + p = buf = (char *)alloca( (size_t) total_len); for(; i < iovCount; i++) { - memcpy(p, iov[i].iov_base, iov[i].iov_len); + memcpy(p, iov[i].iov_base, (size_t) iov[i].iov_len); p += iov[i].iov_len; } @@ -68,11 +67,12 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) { static __int64 Adjustment; __int64 Now = 0; + if (!Adjustment) - { - SYSTEMTIME st = {1970,1,3,0,0,0,0}; - SystemTimeToFileTime(&st, (LPFILETIME)&Adjustment); + { + SYSTEMTIME st = {1970,1,3,0,0,0,0}; + SystemTimeToFileTime(&st, ((LPFILETIME)(VOID *)&Adjustment)); } if (tz) @@ -81,7 +81,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) return -1; } - GetSystemTimeAsFileTime((LPFILETIME)&Now); + GetSystemTimeAsFileTime(((LPFILETIME)(VOID *)&Now)); Now -= Adjustment; tv->tv_sec = (long)(Now / 100000000); diff --git a/reactos/lib/adns/adns_win32/adns_win32.h b/reactos/lib/adns/adns_win32/adns_win32.h index 9495fd335f1..4bc4e32670c 100644 --- a/reactos/lib/adns/adns_win32/adns_win32.h +++ b/reactos/lib/adns/adns_win32/adns_win32.h @@ -129,7 +129,7 @@ struct timezone; /* XXX arty */ * Undef ADNS_MAP_UNIXAPI in the calling code to use natve calls */ ADNS_API int adns_gettimeofday(struct timeval *tv, struct timezone *tz); -ADNS_API int adns_writev (int FileDescriptor, const struct iovec * iov, int iovCount); +ADNS_API int adns_writev (SOCKET FileDescriptor, const struct iovec * iov, int iovCount); ADNS_API int adns_inet_aton(const char *cp, struct in_addr *inp); ADNS_API int adns_getpid();