From ef884a2c5cfd832bf48699846bd49bd4d4d767d7 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 10 Dec 2020 19:06:00 +0200 Subject: [PATCH] libvisual: workaround clang warning libvisual api expects a priv data pointer to be passed, though we know its going to be `GstDebugLevel`. ``` ../subprojects/gst-plugins-base/ext/libvisual/plugin.c:33:39: error: cast to smaller integer type 'GstDebugLevel' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] GST_CAT_LEVEL_LOG (libvisual_debug, (GstDebugLevel) (priv), NULL, "%s - %s", ``` Part-of: --- ext/libvisual/plugin.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/libvisual/plugin.c b/ext/libvisual/plugin.c index 3ce18e466f..38e8d59d18 100644 --- a/ext/libvisual/plugin.c +++ b/ext/libvisual/plugin.c @@ -30,8 +30,8 @@ GST_DEBUG_CATEGORY (libvisual_debug); static void libvisual_log_handler (const char *message, const char *funcname, void *priv) { - GST_CAT_LEVEL_LOG (libvisual_debug, (GstDebugLevel) (priv), NULL, "%s - %s", - funcname, message); + GST_CAT_LEVEL_LOG (libvisual_debug, (GstDebugLevel) GPOINTER_TO_INT (priv), + NULL, "%s - %s", funcname, message); } /* @@ -86,13 +86,14 @@ plugin_init (GstPlugin * plugin) #endif visual_log_set_verboseness (VISUAL_LOG_VERBOSENESS_LOW); - visual_log_set_info_handler (libvisual_log_handler, (void *) GST_LEVEL_INFO); + visual_log_set_info_handler (libvisual_log_handler, + GINT_TO_POINTER (GST_LEVEL_INFO)); visual_log_set_warning_handler (libvisual_log_handler, - (void *) GST_LEVEL_WARNING); + GINT_TO_POINTER (GST_LEVEL_WARNING)); visual_log_set_critical_handler (libvisual_log_handler, - (void *) GST_LEVEL_ERROR); + GINT_TO_POINTER (GST_LEVEL_ERROR)); visual_log_set_error_handler (libvisual_log_handler, - (void *) GST_LEVEL_ERROR); + GINT_TO_POINTER (GST_LEVEL_ERROR)); if (!visual_is_initialized ()) if (visual_init (NULL, NULL) != 0)