[PATCH] info: fix typecast error for gst_debug_add/remove_log_function

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] info: fix typecast error for gst_debug_add/remove_log_function

Eric Nelson
Using GCC 7 or later with pedantic flag will cause warnings about
comparisons between "void *" and a function pointer.

We should change this to force type safety anyway.

Signed-off-by: Eric Nelson <[hidden email]>
---
 gst/gstinfo.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gst/gstinfo.h b/gst/gstinfo.h
index 82e4f9b..f0ed1f9 100644
--- a/gst/gstinfo.h
+++ b/gst/gstinfo.h
@@ -500,7 +500,7 @@ void    gst_printerrln                  (const gchar * format, ...) G_GNUC_PRINT
  * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
 #define gst_debug_add_log_function(func,data,notify) \
 G_STMT_START{                                        \
-  if ((func) == (void *) gst_debug_log_default) {    \
+  if ((func) == gst_debug_log_default) {             \
     gst_debug_add_log_function(NULL,data,notify);    \
   } else {                                           \
     gst_debug_add_log_function(func,data,notify);    \
@@ -508,7 +508,7 @@ G_STMT_START{                                        \
 }G_STMT_END
 
 #define gst_debug_remove_log_function(func)          \
-    ((func) == (void *) gst_debug_log_default) ?     \
+    ((func) == gst_debug_log_default) ?     \
         gst_debug_remove_log_function(NULL) :        \
         gst_debug_remove_log_function(func)
 
--
2.7.4

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] info: fix typecast error for gst_debug_add/remove_log_function

Eric Nelson
Adding Wim and Tim to the CC list.

On 4/2/19 3:15 PM, Eric Nelson wrote:

> Using GCC 7 or later with pedantic flag will cause warnings about
> comparisons between "void *" and a function pointer.
>
> We should change this to force type safety anyway.
>
> Signed-off-by: Eric Nelson <[hidden email]>
> ---
>   gst/gstinfo.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gst/gstinfo.h b/gst/gstinfo.h
> index 82e4f9b..f0ed1f9 100644
> --- a/gst/gstinfo.h
> +++ b/gst/gstinfo.h
> @@ -500,7 +500,7 @@ void    gst_printerrln                  (const gchar * format, ...) G_GNUC_PRINT
>    * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
>   #define gst_debug_add_log_function(func,data,notify) \
>   G_STMT_START{                                        \
> -  if ((func) == (void *) gst_debug_log_default) {    \
> +  if ((func) == gst_debug_log_default) {             \
>       gst_debug_add_log_function(NULL,data,notify);    \
>     } else {                                           \
>       gst_debug_add_log_function(func,data,notify);    \
> @@ -508,7 +508,7 @@ G_STMT_START{                                        \
>   }G_STMT_END
>  
>   #define gst_debug_remove_log_function(func)          \
> -    ((func) == (void *) gst_debug_log_default) ?     \
> +    ((func) == gst_debug_log_default) ?     \
>           gst_debug_remove_log_function(NULL) :        \
>           gst_debug_remove_log_function(func)
>  
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] info: fix typecast error for gst_debug_add/remove_log_function

Tim Müller
On Tue, 2019-04-02 at 15:22 -0700, Eric Nelson wrote:

Hi Eric,

Please submit patches through a Merge Request in gitlab, thanks!


Cheers
-Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] info: fix typecast error for gst_debug_add/remove_log_function

Eric Nelson
On 4/2/19 3:46 PM, Tim Müller wrote:

> On Tue, 2019-04-02 at 15:22 -0700, Eric Nelson wrote:
>
> Hi Eric,
>
> Please submit patches through a Merge Request in gitlab, thanks!
>
> https://gstreamer.freedesktop.org/documentation/contribute/index.html#how-to-submit-patches
>
> Cheers
> -Tim
>

Will do. Thanks Tim.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel