]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix return type and usage of WSAWaitForMultipleEvents()
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 3 Dec 2019 01:23:29 +0000 (02:23 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 29 Apr 2020 10:52:23 +0000 (10:52 +0000)
The former int type leads to warnings.

dbus/dbus-sysdeps-win.c

index e75b87cfcb4cfcafa0032b90e4dc3c41c86ae6c7..5d9cae73122cf671770cfeb06433660e9fef0b35 100644 (file)
@@ -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++)
         {