From 8a4afe112d4a61ffe9fa0fd629dd92fdc90e68b7 Mon Sep 17 00:00:00 2001 From: Siraj Razick Date: Thu, 26 Jan 2012 16:20:04 -0500 Subject: Fix warnings from wocky-connector-test.c under mingw32 In windows socket API setsockopt takes a const char * as the fourth parameter, while on Linux it takes a void * so we cast to const char * which will work under both the platforms. This patch also move flags veriable in client_connected to the unix part of the ifdef, to remove warnings which shows up with mingw32. --- tests/wocky-connector-test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/wocky-connector-test.c b/tests/wocky-connector-test.c index 624a551..7476540 100644 --- a/tests/wocky-connector-test.c +++ b/tests/wocky-connector-test.c @@ -3140,10 +3140,11 @@ client_connected (GIOChannel *channel, ConnectorProblem *cproblem = &test->server_parameters.problem.conn; #ifdef G_OS_WIN32 u_long mode = 0; +#else + long flags; #endif GSocketConnection *gconn; - long flags; if (csock < 0) { @@ -3199,7 +3200,7 @@ start_dummy_xmpp_server (test_t *test) server.sin_addr.s_addr = inet_addr ((const char * ) REACHABLE); server.sin_port = htons (port); ssock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); - setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof (reuse)); + setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, (const char *) &reuse, sizeof (reuse)); res = bind (ssock, (struct sockaddr *) &server, sizeof (server)); -- cgit v1.2.3