[totem/wip/hadess/gproxyresolver-fixup] backend: Fix GProxyResolver warnings



commit 82b5f830d9d991b2cda5bace4fa4f0f8e9caf811
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 15 10:08:30 2019 +0100

    backend: Fix GProxyResolver warnings
    
    src/backend/bacon-video-widget.c: In function ‘bvw_set_http_proxy_on_element’:
    src/backend/bacon-video-widget.c:2654:8: warning: assignment discards ‘const’ qualifier from pointer 
target type [-Wdiscarded-qualifiers]
       host = gst_uri_get_host (uri);
            ^
    src/backend/bacon-video-widget.c:2657:13: warning: assignment to ‘char’ from ‘gchar *’ {aka ‘char *’} 
makes integer from pointer without a cast [-Wint-conversion]
       proxy_url = g_strdup_printf ("%s://%s:%d", protocol, host, port);
                 ^
    src/backend/bacon-video-widget.c:2659:11: warning: passing argument 1 of ‘g_free’ makes pointer from 
integer without a cast [-Wint-conversion]
       g_free (proxy_url);
               ^~~~~~~~~
    In file included from src/backend/bacon-video-widget.c:49:
    /home/hadess/Projects/gnome-install/include/glib-2.0/glib/gmem.h:71:35: note: expected ‘gpointer’ {aka 
‘void *’} but argument is of type ‘char’
     void  g_free           (gpointer  mem);
                             ~~~~~~~~~~^~~
    src/backend/bacon-video-widget.c:2665:12: warning: assignment discards ‘const’ qualifier from pointer 
target type [-Wdiscarded-qualifiers]
       userinfo = gst_uri_get_userinfo (uri);
                ^
    
    Fixes: 12aa8c7b5475d2b0372cca47d6bb7472bb7d52bf

 src/backend/bacon-video-widget.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 5f4ee6800..d4735f64e 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -2639,9 +2639,9 @@ bvw_set_http_proxy_on_element (BaconVideoWidget *bvw,
                               const char       *uri_str)
 {
   GstUri *uri;
-  char *protocol, *host, proxy_url;
+  char *protocol, *proxy_url;
+  const char *host, *userinfo;
   guint port;
-  char *userinfo;
   char **user_strv;
 
   uri = gst_uri_from_string (uri_str);
@@ -2667,8 +2667,6 @@ bvw_set_http_proxy_on_element (BaconVideoWidget *bvw,
     goto finish;
 
   user_strv = g_strsplit (userinfo, ":", 2);
-  g_free (userinfo);
-
   g_object_set (element,
                "proxy-id", user_strv[0],
                "proxy-pw", user_strv[1],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]