From: Ralf Habacker Date: Tue, 3 Dec 2019 01:23:29 +0000 (+0100) Subject: Fix return type and usage of WSAWaitForMultipleEvents() X-Git-Tag: dbus-1.13.16~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2658b2571c9792a4c3924b42a4f2b038b56bbcd3;p=thirdparty%2Fdbus.git Fix return type and usage of WSAWaitForMultipleEvents() The former int type leads to warnings. --- diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index e75b87cfc..5d9cae731 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1287,7 +1287,7 @@ _dbus_poll_events (DBusPollFD *fds, { int ret = 0; int i; - int ready; + DWORD ready; #define DBUS_STACK_WSAEVENTS 256 WSAEVENT eventsOnStack[DBUS_STACK_WSAEVENTS]; @@ -1338,7 +1338,7 @@ _dbus_poll_events (DBusPollFD *fds, ready = WSAWaitForMultipleEvents (n_fds, pEvents, FALSE, timeout_milliseconds, FALSE); - if (DBUS_SOCKET_API_RETURNS_ERROR (ready)) + if (ready == WSA_WAIT_FAILED) { DBUS_SOCKET_SET_ERRNO (); if (errno != WSAEWOULDBLOCK) @@ -1350,7 +1350,7 @@ _dbus_poll_events (DBusPollFD *fds, _dbus_verbose ("WSAWaitForMultipleEvents: WSA_WAIT_TIMEOUT\n"); ret = 0; } - else if (ready >= WSA_WAIT_EVENT_0 && ready < (int)(WSA_WAIT_EVENT_0 + n_fds)) + else if (ready < (WSA_WAIT_EVENT_0 + n_fds)) { for (i = 0; i < n_fds; i++) {