Add -Wwrite-strings
authorBenjamin Otte <otte@redhat.com>
Mon, 22 Mar 2010 12:16:33 +0000 (13:16 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 31 Dec 2010 00:54:04 +0000 (00:54 +0000)
and fix its warnings

tests/check/elements/selector.c

index e9449c0..56d2840 100644 (file)
@@ -38,7 +38,7 @@ static gboolean
 probe_cb (GstPad * pad, GstMiniObject * obj, gpointer user_data)
 {
   gint count = 0;
-  gchar *count_type = NULL;
+  const gchar *count_type = NULL;
 
   GST_LOG_OBJECT (pad, "got data");
 
@@ -184,17 +184,15 @@ count_output_buffers (GList * output_pads, gint expected_buffers)
 static void
 selector_set_active_pad (GstElement * elem, GstPad * selpad)
 {
-  gchar *padname = "";
+  gchar *padname = NULL;
 
   if (selpad) {
     padname = gst_pad_get_name (selpad);
   }
 
   g_object_set (G_OBJECT (elem), "active-pad", selpad, NULL);
-  GST_DEBUG_OBJECT (elem, "activated selector pad: %s", padname);
-  if (selpad) {
-    g_free (padname);
-  }
+  GST_DEBUG_OBJECT (elem, "activated selector pad: %s", GST_STR_NULL (padname));
+  g_free (padname);
 }
 
 /* Push buffers and switch for each selector pad */