plugins, tools: update for get_protocols() return value change
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 13 Nov 2011 23:25:23 +0000 (23:25 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 13 Nov 2011 23:25:23 +0000 (23:25 +0000)
plugins/elements/gstfdsink.c
plugins/elements/gstfdsrc.c
plugins/elements/gstfilesink.c
plugins/elements/gstfilesrc.c
tools/gst-inspect.c

index 4441d96..6e0036c 100644 (file)
@@ -591,10 +591,10 @@ gst_fd_sink_uri_get_type (GType type)
   return GST_URI_SINK;
 }
 
-static gchar **
+static const gchar *const *
 gst_fd_sink_uri_get_protocols (GType type)
 {
-  static gchar *protocols[] = { (char *) "fd", NULL };
+  static const gchar *protocols[] = { "fd", NULL };
 
   return protocols;
 }
index a54582a..f059ee0 100644 (file)
@@ -605,10 +605,10 @@ gst_fd_src_uri_get_type (GType type)
   return GST_URI_SRC;
 }
 
-static gchar **
+static const gchar *const *
 gst_fd_src_uri_get_protocols (GType type)
 {
-  static gchar *protocols[] = { (char *) "fd", NULL };
+  static const gchar *protocols[] = { "fd", NULL };
 
   return protocols;
 }
index 76a807d..c3c9fdd 100644 (file)
@@ -689,10 +689,10 @@ gst_file_sink_uri_get_type (GType type)
   return GST_URI_SINK;
 }
 
-static gchar **
+static const gchar *const *
 gst_file_sink_uri_get_protocols (GType type)
 {
-  static gchar *protocols[] = { (char *) "file", NULL };
+  static const gchar *protocols[] = { "file", NULL };
 
   return protocols;
 }
index 02bd3f4..165031a 100644 (file)
@@ -582,10 +582,10 @@ gst_file_src_uri_get_type (GType type)
   return GST_URI_SRC;
 }
 
-static gchar **
+static const gchar *const *
 gst_file_src_uri_get_protocols (GType type)
 {
-  static gchar *protocols[] = { (char *) "file", NULL };
+  static const gchar *protocols[] = { "file", NULL };
 
   return protocols;
 }
index bc4c618..fc173a8 100644 (file)
@@ -690,8 +690,8 @@ static void
 print_uri_handler_info (GstElement * element)
 {
   if (GST_IS_URI_HANDLER (element)) {
+    const gchar *const *uri_protocols;
     const gchar *uri_type;
-    gchar **uri_protocols;
 
     if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) == GST_URI_SRC)
       uri_type = "source";
@@ -1090,8 +1090,9 @@ print_all_uri_handlers (void)
         }
 
         if (GST_IS_URI_HANDLER (element)) {
+          const gchar *const *uri_protocols;
           const gchar *dir;
-          gchar **uri_protocols, *joined;
+          gchar *joined;
 
           switch (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element))) {
             case GST_URI_SRC:
@@ -1107,7 +1108,7 @@ print_all_uri_handlers (void)
 
           uri_protocols =
               gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
-          joined = g_strjoinv (", ", uri_protocols);
+          joined = g_strjoinv (", ", (gchar **) uri_protocols);
 
           g_print ("%s (%s, rank %u): %s\n",
               gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)), dir,
@@ -1392,23 +1393,26 @@ print_plugin_automatic_install_info_codecs (GstElementFactory * factory)
 static void
 print_plugin_automatic_install_info_protocols (GstElementFactory * factory)
 {
-  gchar **protocols, **p;
+  const gchar *const *protocols;
 
   protocols = gst_element_factory_get_uri_protocols (factory);
   if (protocols != NULL && *protocols != NULL) {
     switch (gst_element_factory_get_uri_type (factory)) {
       case GST_URI_SINK:
-        for (p = protocols; *p != NULL; ++p)
-          g_print ("urisink-%s\n", *p);
+        while (*protocols != NULL) {
+          g_print ("urisink-%s\n", *protocols);
+          ++protocols;
+        }
         break;
       case GST_URI_SRC:
-        for (p = protocols; *p != NULL; ++p)
-          g_print ("urisource-%s\n", *p);
+        while (*protocols != NULL) {
+          g_print ("urisource-%s\n", *protocols);
+          ++protocols;
+        }
         break;
       default:
         break;
     }
-    g_strfreev (protocols);
   }
 }