]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus_connection_dispatch: Avoid using _dbus_list_foreach
authorSimon McVittie <smcv@collabora.com>
Mon, 23 Jul 2018 17:02:16 +0000 (18:02 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 2 Aug 2018 14:26:36 +0000 (15:26 +0100)
In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about passing an extra (unwanted) parameter to callbacks. Instead
of using _dbus_list_foreach(), open-code the equivalent here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Reviewed-by: Thiago Macieira <thiago@kde.org>
dbus/dbus-connection.c

index 8a5829a85d426663882040a97df100d91138a7a4..a2b35993e02a08d0b7918f320ea023430cca10b8 100644 (file)
@@ -4675,10 +4675,11 @@ dbus_connection_dispatch (DBusConnection *connection)
       
       return DBUS_DISPATCH_NEED_MEMORY;
     }
-  
-  _dbus_list_foreach (&filter_list_copy,
-                     (DBusForeachFunction)_dbus_message_filter_ref,
-                     NULL);
+
+  for (link = _dbus_list_get_first_link (&filter_list_copy);
+       link != NULL;
+       link = _dbus_list_get_next_link (&filter_list_copy, link))
+    _dbus_message_filter_ref (link->data);
 
   /* We're still protected from dispatch() reentrancy here
    * since we acquired the dispatcher