diff options
author | Simon McVittie <smcv@collabora.com> | 2018-07-23 18:02:42 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-08-02 15:26:47 +0100 |
commit | 963ce92f687f15efb25226fc022ce3a9bc9d386b (patch) | |
tree | e6f1a40fd386a1a88e4c6a0bcaddec5b35fbad84 /test/monitor.c | |
parent | 9b21aab77f46bd983e0b76abbafddee2633ca35d (diff) | |
download | dbus-963ce92f687f15efb25226fc022ce3a9bc9d386b.tar.gz |
test: Avoid g_queue_foreach
In gcc 8, -Wall -Wextra includes -Wcast-function-type, which warns
about passing an extra (unwanted) parameter to callbacks. Instead
of using g_list_foreach(), open-code the equivalent.
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 'test/monitor.c')
-rw-r--r-- | test/monitor.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/monitor.c b/test/monitor.c index 57f13af8..95b394bf 100644 --- a/test/monitor.c +++ b/test/monitor.c @@ -1882,6 +1882,8 @@ static void teardown (Fixture *f, gconstpointer context G_GNUC_UNUSED) { + GList *link; + dbus_error_free (&f->e); g_clear_error (&f->ge); @@ -1936,10 +1938,14 @@ teardown (Fixture *f, test_main_context_unref (f->ctx); - g_queue_foreach (&f->monitored, (GFunc) dbus_message_unref, NULL); + for (link = f->monitored.head; link != NULL; link = link->next) + dbus_message_unref (link->data); + g_queue_clear (&f->monitored); - g_queue_foreach (&f->received, (GFunc) dbus_message_unref, NULL); + for (link = f->received.head; link != NULL; link = link->next) + dbus_message_unref (link->data); + g_queue_clear (&f->received); g_free (f->address); |