Andrew Nguyen : ws2_32/tests: Fix some test thread procedure prototypes.
Alexandre Julliard
julliard at winehq.org
Fri Jun 3 14:04:42 CDT 2011
Module: wine
Branch: master
Commit: a282c150fa14242b04482808e0a3344c00d6b082
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a282c150fa14242b04482808e0a3344c00d6b082
Author: Andrew Nguyen <anguyen at codeweavers.com>
Date: Fri Jun 3 07:37:03 2011 -0500
ws2_32/tests: Fix some test thread procedure prototypes.
---
dlls/ws2_32/tests/sock.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 7853a8c..28d5db3 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1550,7 +1550,7 @@ static void test_UDP(void)
}
}
-static void WINAPI do_getservbyname( HANDLE *starttest )
+static DWORD WINAPI do_getservbyname( void *param )
{
struct {
const char *name;
@@ -1558,6 +1558,7 @@ static void WINAPI do_getservbyname( HANDLE *starttest )
int port;
} serv[2] = { {"domain", "udp", 53}, {"telnet", "tcp", 23} };
+ HANDLE *starttest = param;
int i, j;
struct servent *pserv[2];
@@ -1579,6 +1580,8 @@ static void WINAPI do_getservbyname( HANDLE *starttest )
ok ( pserv[0] == pserv[1], "getservbyname: winsock resized servent buffer when not necessary\n" );
}
+
+ return 0;
}
static void test_getservbyname(void)
@@ -1591,7 +1594,7 @@ static void test_getservbyname(void)
/* create threads */
for ( i = 0; i < NUM_THREADS; i++ ) {
- thread[i] = CreateThread ( NULL, 0, (LPTHREAD_START_ROUTINE) &do_getservbyname, &starttest, 0, &thread_id[i] );
+ thread[i] = CreateThread ( NULL, 0, do_getservbyname, &starttest, 0, &thread_id[i] );
}
/* signal threads to start */
@@ -2235,8 +2238,9 @@ static void test_WSAStringToAddressW(void)
}
-static VOID WINAPI SelectReadThread(select_thread_params *par)
+static DWORD WINAPI SelectReadThread(void *param)
{
+ select_thread_params *par = param;
fd_set readfds;
int ret;
struct sockaddr_in addr;
@@ -2256,6 +2260,8 @@ static VOID WINAPI SelectReadThread(select_thread_params *par)
SetEvent(server_ready);
ret = select(par->s+1, &readfds, NULL, NULL, &select_timeout);
par->ReadKilled = (ret == 1);
+
+ return 0;
}
static void test_errors(void)
@@ -2344,7 +2350,7 @@ static void test_select(void)
thread_params.s = fdRead;
thread_params.ReadKilled = FALSE;
server_ready = CreateEventA(NULL, TRUE, FALSE, NULL);
- thread_handle = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) &SelectReadThread, &thread_params, 0, &id );
+ thread_handle = CreateThread (NULL, 0, SelectReadThread, &thread_params, 0, &id );
ok ( (thread_handle != NULL), "CreateThread failed unexpectedly: %d\n", GetLastError());
WaitForSingleObject (server_ready, INFINITE);
@@ -2396,8 +2402,9 @@ static void test_select(void)
ok ( !FD_ISSET(fdRead, &exceptfds), "FD should not be set\n");
}
-static DWORD WINAPI AcceptKillThread(select_thread_params *par)
+static DWORD WINAPI AcceptKillThread(void *param)
{
+ select_thread_params *par = param;
struct sockaddr_in address;
int len = sizeof(address);
SOCKET client_socket;
@@ -2482,8 +2489,7 @@ static void test_accept(void)
thread_params.s = server_socket;
thread_params.ReadKilled = FALSE;
- thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) AcceptKillThread,
- &thread_params, 0, &id);
+ thread_handle = CreateThread(NULL, 0, AcceptKillThread, &thread_params, 0, &id);
if (thread_handle == NULL)
{
trace("error creating thread: %d\n", GetLastError());
More information about the wine-cvs
mailing list