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:
Руслан Ижбулатов 2017-07-29 08:04:10 +00:00
parent cb2316aaa1
commit 1f3da929f5

View File

@ -263,33 +263,33 @@ g_poll (GPollFD *fds,
g_print ("g_poll: waiting for"); g_print ("g_poll: waiting for");
for (f = fds; f < &fds[nfds]; ++f) for (f = fds; f < &fds[nfds]; ++f)
if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN)) {
{ if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN))
if (_g_main_poll_debug && !poll_msgs) {
g_print (" MSG"); if (_g_main_poll_debug && !poll_msgs)
poll_msgs = TRUE; g_print (" MSG");
} poll_msgs = TRUE;
else if (f->fd > 0) }
{ else if (f->fd > 0)
if (nhandles == MAXIMUM_WAIT_OBJECTS) {
{ if (nhandles == MAXIMUM_WAIT_OBJECTS)
g_warning ("Too many handles to wait for!\n"); {
break; g_warning ("Too many handles to wait for!\n");
} break;
else }
{ else
if (_g_main_poll_debug) {
g_print (" %p", (HANDLE) f->fd); if (_g_main_poll_debug)
handles[nhandles++] = (HANDLE) f->fd; g_print (" %p", (HANDLE) f->fd);
} handles[nhandles++] = (HANDLE) f->fd;
} }
}
f->revents = 0;
}
if (_g_main_poll_debug) if (_g_main_poll_debug)
g_print ("\n"); g_print ("\n");
for (f = fds; f < &fds[nfds]; ++f)
f->revents = 0;
if (timeout == -1) if (timeout == -1)
timeout = INFINITE; timeout = INFINITE;