* Copyright 1998 Owen Taylor
* Copyright 2008 Red Hat, Inc.
*
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
HANDLE *handles,
GPollFD *handle_to_fd[],
gint nhandles,
- gint timeout_ms)
+ DWORD timeout_ms)
{
DWORD ready;
GPollFD *f;
* -> Use MsgWaitForMultipleObjectsEx
*/
if (_g_main_poll_debug)
- g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
+ g_print (" MsgWaitForMultipleObjectsEx(%d, %lu)\n", nhandles, timeout_ms);
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout_ms,
QS_ALLINPUT, MWMO_ALERTABLE);
* -> Use WaitForMultipleObjectsEx
*/
if (_g_main_poll_debug)
- g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout_ms);
+ g_print (" WaitForMultipleObjectsEx(%d, %lu)\n", nhandles, timeout_ms);
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout_ms, TRUE);
if (ready == WAIT_FAILED)
recursed_result = poll_rest (NULL, stop_fd, handles, handle_to_fd, nhandles, 0);
return (recursed_result == -1) ? -1 : 1 + recursed_result;
}
- else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles)
+ else if (ready < WAIT_OBJECT_0 + nhandles)
{
int retval;
GPollFD *msg_fd;
GPollFD *stop_fd;
gint nhandles;
- gint timeout_ms;
+ DWORD timeout_ms;
} GWin32PollThreadData;
static gint
static void
fill_poll_thread_data (GPollFD *fds,
guint nfds,
- gint timeout_ms,
+ DWORD timeout_ms,
GPollFD *stop_fd,
GWin32PollThreadData *data)
{
for (i = 0; i < nthreads; i++)
{
if (GetExitCodeThread (thread_handles[i], &thread_retval))
- retval = retval == -1 ? -1 : thread_retval == -1 ? -1 : retval + thread_retval;
+ retval = (retval == -1) ? -1 : ((thread_retval == (DWORD) -1) ? -1 : (int) (retval + thread_retval));
CloseHandle (thread_handles[i]);
}