From 1f3da929f5718c24eed67a8e7007f6c39adb441a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Sat, 29 Jul 2017 08:04:10 +0000 Subject: [PATCH] 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 --- glib/gpoll.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/glib/gpoll.c b/glib/gpoll.c index 694f1f9a1..4bc42a173 100644 --- a/glib/gpoll.c +++ b/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;