tests/examples/: More gcc4 fixes and a mem leak fix.
authorTim-Philipp Müller <tim@centricular.net>
Mon, 12 Dec 2005 17:07:05 +0000 (17:07 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 12 Dec 2005 17:07:05 +0000 (17:07 +0000)
Original commit message from CVS:
* tests/examples/typefind/typefind.c: (type_found):
* tests/examples/xml/runxml.c: (xml_loaded):
More gcc4 fixes and a mem leak fix.

ChangeLog
tests/examples/typefind/typefind.c
tests/examples/xml/runxml.c

index ec92600..fa9a5d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-12  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * tests/examples/typefind/typefind.c: (type_found):
+       * tests/examples/xml/runxml.c: (xml_loaded):
+         More gcc4 fixes and a mem leak fix.
+
 2005-12-12  Stefan Kost  <ensonic@users.sf.net>
 
        * tests/examples/xml/createxml.c: (object_saved):
index a145fb0..e7ed9aa 100644 (file)
@@ -6,10 +6,11 @@ type_found (GstElement * typefind, const GstCaps * caps)
   xmlDocPtr doc;
   xmlNodePtr parent;
 
-  doc = xmlNewDoc ("1.0");
-  doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
+  doc = xmlNewDoc ((xmlChar *) "1.0");
+  doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *) "Capabilities",
+      NULL);
 
-  parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
+  parent = xmlNewChild (doc->xmlRootNode, NULL, (xmlChar *) "Caps1", NULL);
   /* FIXME */
   //gst_caps_save_thyself (caps, parent);
 
index cbc0d85..c8d6189 100644 (file)
@@ -10,15 +10,18 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
   xmlNodePtr children = self->xmlChildrenNode;
 
   while (children) {
-    if (!strcmp (children->name, (xmlChar *) "comment")) {
+    if (!strcmp ((const char *) children->name, "comment")) {
       xmlNodePtr nodes = children->xmlChildrenNode;
 
       while (nodes) {
-        if (!strcmp (nodes->name, (xmlChar *) "text")) {
+        if (!strcmp ((const char *) nodes->name, "text")) {
           gchar *name = g_strdup ((gchar *) xmlNodeGetContent (nodes));
+          gchar *obj_name = gst_object_get_name (object);
 
-          g_print ("object %s loaded with comment '%s'\n",
-              gst_object_get_name (object), name);
+          g_print ("object %s loaded with comment '%s'\n", obj_name, name);
+
+          g_free (obj_name);
+          g_free (name);
         }
         nodes = nodes->next;
       }