Skip to content

Commit

Permalink
libvisual: workaround clang warning
Browse files Browse the repository at this point in the history
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/975>
  • Loading branch information
alatiera committed Dec 14, 2020
1 parent 56e05f6 commit ef884a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ext/libvisual/plugin.c
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ef884a2

Please sign in to comment.