diff options
author | Simon McVittie <smcv@collabora.com> | 2018-07-23 17:33:24 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-08-02 15:26:27 +0100 |
commit | 46cdc12830c413a80ca13b1fae0a7dc1f8ced263 (patch) | |
tree | 8afa4c3641894b9c6aeaaf49ed60684b0c4f2fc2 /dbus/dbus-timeout.c | |
parent | 7efc06293ab8a6bf4aba50dac0da55e4a583360a (diff) | |
download | dbus-46cdc12830c413a80ca13b1fae0a7dc1f8ced263.tar.gz |
Add and use _dbus_list_clear_full
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(), add a function to do what we actually
wanted 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>
Diffstat (limited to 'dbus/dbus-timeout.c')
-rw-r--r-- | dbus/dbus-timeout.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/dbus/dbus-timeout.c b/dbus/dbus-timeout.c index 23ca6e44..4c658464 100644 --- a/dbus/dbus-timeout.c +++ b/dbus/dbus-timeout.c @@ -218,10 +218,8 @@ _dbus_timeout_list_free (DBusTimeoutList *timeout_list) _dbus_timeout_list_set_functions (timeout_list, NULL, NULL, NULL, NULL, NULL); - _dbus_list_foreach (&timeout_list->timeouts, - (DBusForeachFunction) _dbus_timeout_unref, - NULL); - _dbus_list_clear (&timeout_list->timeouts); + _dbus_list_clear_full (&timeout_list->timeouts, + (DBusFreeFunction) _dbus_timeout_unref); dbus_free (timeout_list); } |