[vlc-commits] notify: fix invalid function pointer cast
    Alexandre Janniaux 
    git at videolan.org
       
    Mon Sep  2 09:50:29 CEST 2019
    
    
  
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sat Aug 31 10:16:35 2019 +0200| [5e99bb64025f5d2c8b1a28b00a2bc954c122647a] | committer: Thomas Guillem
notify: fix invalid function pointer cast
`g_list_foreach` takes a void `(*GFunc)(void*, void*)` and `g_free`
is a `void (void *)` function.
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e99bb64025f5d2c8b1a28b00a2bc954c122647a
---
 modules/notify/notify.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/notify/notify.c b/modules/notify/notify.c
index 9d3e809ab3..1bab4350af 100644
--- a/modules/notify/notify.c
+++ b/modules/notify/notify.c
@@ -85,6 +85,12 @@ struct intf_sys_t
     struct vlc_player_listener_id *player_listener;
 };
 
+static void foreach_g_free(void *data, void *userdata)
+{
+    g_free(data);
+    VLC_UNUSED(userdata);
+}
+
 /*****************************************************************************
  * Open: initialize and create stuff
  *****************************************************************************/
@@ -137,7 +143,7 @@ static int Open( vlc_object_t *p_this )
                 break;
             }
         }
-        g_list_foreach( p_caps, (GFunc)g_free, NULL );
+        g_list_foreach( p_caps, foreach_g_free, NULL );
         g_list_free( p_caps );
     }
 
@@ -357,4 +363,3 @@ static int Notify( vlc_object_t *p_this, const char *psz_temp, GdkPixbuf *pix,
     p_sys->notification = notification;
     return VLC_SUCCESS;
 }
-
    
    
More information about the vlc-commits
mailing list