mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
glib/gpoll W32: fold f->revents = 0 into for() loop
GCC most likely optimizes that already, but no harm in trying. https://bugzilla.gnome.org/show_bug.cgi?id=785468
This commit is contained in:
parent
cb2316aaa1
commit
1f3da929f5
46
glib/gpoll.c
46
glib/gpoll.c
@ -263,33 +263,33 @@ g_poll (GPollFD *fds,
|
||||
g_print ("g_poll: waiting for");
|
||||
|
||||
for (f = fds; f < &fds[nfds]; ++f)
|
||||
if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN))
|
||||
{
|
||||
if (_g_main_poll_debug && !poll_msgs)
|
||||
g_print (" MSG");
|
||||
poll_msgs = TRUE;
|
||||
}
|
||||
else if (f->fd > 0)
|
||||
{
|
||||
if (nhandles == MAXIMUM_WAIT_OBJECTS)
|
||||
{
|
||||
g_warning ("Too many handles to wait for!\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_g_main_poll_debug)
|
||||
g_print (" %p", (HANDLE) f->fd);
|
||||
handles[nhandles++] = (HANDLE) f->fd;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN))
|
||||
{
|
||||
if (_g_main_poll_debug && !poll_msgs)
|
||||
g_print (" MSG");
|
||||
poll_msgs = TRUE;
|
||||
}
|
||||
else if (f->fd > 0)
|
||||
{
|
||||
if (nhandles == MAXIMUM_WAIT_OBJECTS)
|
||||
{
|
||||
g_warning ("Too many handles to wait for!\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_g_main_poll_debug)
|
||||
g_print (" %p", (HANDLE) f->fd);
|
||||
handles[nhandles++] = (HANDLE) f->fd;
|
||||
}
|
||||
}
|
||||
f->revents = 0;
|
||||
}
|
||||
|
||||
if (_g_main_poll_debug)
|
||||
g_print ("\n");
|
||||
|
||||
for (f = fds; f < &fds[nfds]; ++f)
|
||||
f->revents = 0;
|
||||
|
||||
if (timeout == -1)
|
||||
timeout = INFINITE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user