tests/examples/: More gcc4 fixes and a mem leak fix.

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.
This commit is contained in:
Tim-Philipp Müller 2005-12-12 17:07:05 +00:00
parent c67dbe5deb
commit ed1d0dfd9d
3 changed files with 17 additions and 7 deletions
ChangeLog
tests/examples

View file

@ -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):

View 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);

View 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;
}