From c203723e4fa79cccadd5bad0c9bde7a4a85e3a7f Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Fri, 3 Sep 2004 16:49:18 +0000 Subject: [PATCH] compings warings. and some did have wrong protypes. 0. fix warning: passing arg 1 of `send' as unsigned due to prototype 1. fix warning: passing arg 3 of `memcpy' as unsigned due to prototype 2. fix warning: passing arg 3 of `send' as signed due to prototype 3. fix warning: unused variable `bytes_written' 4. fix warning: dereferencing type-punned pointer will break strict-aliasing rules 5. fix warning: dereferencing type-punned pointer will break strict-aliasing rules svn path=/trunk/; revision=10779 --- reactos/lib/adns/adns_win32/adns_unix_calls.c | 18 +++++++++--------- reactos/lib/adns/adns_win32/adns_win32.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) 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();