From 0f134fe09d10f3e661581d5f9b9f368b533e18ac Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Mon, 29 Jul 2019 15:13:07 +0100 Subject: [PATCH] glib-compat: Cast second argument of g_clear_pointer In the real GLib version, constructs like g_clear_pointer (&hash, g_hash_table_unref) are allowed, and do not provoke warnings. Signed-off-by: Simon McVittie <smcv@collabora.com> --- steam-runtime-tools/glib-compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/steam-runtime-tools/glib-compat.h b/steam-runtime-tools/glib-compat.h index e41c71b4a..51e3b0882 100644 --- a/steam-runtime-tools/glib-compat.h +++ b/steam-runtime-tools/glib-compat.h @@ -42,7 +42,8 @@ _srt_steal_pointer (gpointer pointer_to_pointer) #endif #if !GLIB_CHECK_VERSION(2, 34, 0) -#define g_clear_pointer(x, destroy) _srt_clear_pointer (x, destroy) +#define g_clear_pointer(x, destroy) \ + _srt_clear_pointer (x, (GDestroyNotify) (void (*)(void)) destroy) /* A simplified version of g_clear_pointer without type-safety. */ static inline void _srt_clear_pointer (gpointer pointer_to_pointer, -- GitLab