More GCC4 warning fixes. Basically all libxml-guchar* to sane-gchar* casts (and reverse).

Original commit message from CVS:
Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
This commit is contained in:
Ronald S. Bultje 2005-04-22 12:30:01 +00:00
parent 976b3b565d
commit d6386e096a
24 changed files with 212 additions and 143 deletions

View file

@ -1,3 +1,33 @@
2005-04-22 Kjartan Maraas <kmaraas@gnome.org>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/typefind/typefind.c: (type_found):
* examples/xml/createxml.c: (object_saved):
* examples/xml/runxml.c: (xml_loaded), (main):
* gst/elements/gstaggregator.c: (gst_aggregator_loop),
(gst_aggregator_chain):
* gst/elements/gstmd5sink.c: (gst_md5sink_get_property):
* gst/elements/gsttypefindelement.c: (find_element_get_length),
(gst_type_find_element_handle_event):
* gst/gsttrace.c: (gst_trace_flush), (gst_trace_text_flush):
* gst/gstxml.c: (gst_xml_write), (gst_xml_parse_doc),
(gst_xml_parse_file), (gst_xml_parse_memory),
(gst_xml_get_element), (gst_xml_make_element):
* gst/indexers/gstfileindex.c: (gst_file_index_load),
(_file_index_id_save_xml), (gst_file_index_commit):
* gst/schedulers/gstoptimalscheduler.c:
(group_inc_links_for_element):
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_caps),
(gst_dp_packet_from_event), (gst_dp_caps_from_packet):
* tools/gst-complete.c: (main):
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_element_properties_info):
* tools/gst-launch.c: (xmllaunch_parse_cmdline):
* tools/gst-xmlinspect.c: (print_element_properties):
More GCC4 warning fixes. Basically all libxml-guchar* to
sane-gchar* casts (and reverse).
2005-04-22 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstpad.c: (gst_pad_event_default):

View file

@ -6,10 +6,10 @@ type_found (GstElement * typefind, const GstCaps * caps)
xmlDocPtr doc;
xmlNodePtr parent;
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "Capabilities", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "Caps1", NULL);
/* FIXME */
//gst_caps_save_thyself (caps, parent);

View file

@ -11,16 +11,17 @@ object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
/* first see if the namespace is already known */
ns = xmlSearchNsByHref (parent->doc, parent,
"http://gstreamer.net/gst-test/1.0/");
(guchar *) "http://gstreamer.net/gst-test/1.0/");
if (ns == NULL) {
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
/* add namespace to root node */
ns = xmlNewNs (root, "http://gstreamer.net/gst-test/1.0/", "test");
ns = xmlNewNs (root, (guchar *) "http://gstreamer.net/gst-test/1.0/",
(guchar *) "test");
}
child = xmlNewChild (parent, ns, "comment", NULL);
child = xmlNewChild (parent, ns, (guchar *) "comment", NULL);
xmlNewChild (child, NULL, "text", (gchar *) data);
xmlNewChild (child, NULL, (guchar *) "text", (guchar *) data);
}
int

View file

@ -10,12 +10,12 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
xmlNodePtr children = self->xmlChildrenNode;
while (children) {
if (!strcmp (children->name, "comment")) {
if (!strcmp ((char *) children->name, "comment")) {
xmlNodePtr nodes = children->xmlChildrenNode;
while (nodes) {
if (!strcmp (nodes->name, "text")) {
gchar *name = g_strdup (xmlNodeGetContent (nodes));
if (!strcmp ((char *) nodes->name, "text")) {
gchar *name = g_strdup ((char *) xmlNodeGetContent (nodes));
g_print ("object %s loaded with comment '%s'\n",
gst_object_get_name (object), name);
@ -42,13 +42,13 @@ main (int argc, char *argv[])
/* G_CALLBACK (xml_loaded), xml); */
if (argc == 2)
ret = gst_xml_parse_file (xml, argv[1], NULL);
ret = gst_xml_parse_file (xml, (guchar *) argv[1], NULL);
else
ret = gst_xml_parse_file (xml, "xmlTest.gst", NULL);
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
g_assert (ret == TRUE);
pipeline = gst_xml_get_element (xml, "pipeline");
pipeline = gst_xml_get_element (xml, (guchar *) "pipeline");
g_assert (pipeline != NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);

View file

@ -333,7 +333,7 @@ gst_aggregator_loop (GstElement * element)
*/
if (GST_PAD_IS_USABLE (pad)) {
buf = GST_BUFFER (gst_pad_pull (pad));
debug = "loop";
debug = (guchar *) "loop";
/* then push it forward */
gst_aggregator_push (aggregator, pad, buf, debug);
@ -343,7 +343,7 @@ gst_aggregator_loop (GstElement * element)
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
GstPad *pad;
debug = "loop_select";
debug = (guchar *) "loop_select";
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
@ -374,5 +374,5 @@ gst_aggregator_chain (GstPad * pad, GstData * _data)
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
gst_aggregator_push (aggregator, pad, buf, "chain");
gst_aggregator_push (aggregator, pad, buf, (guchar *) "chain");
}

View file

@ -464,7 +464,7 @@ gst_md5sink_get_property (GObject * object, guint prop_id, GValue * value,
* md5_read_ctx (sink, sink->md5); */
/* md5 is a guchar[16] */
int i;
guchar *md5string = g_malloc0 (33);
gchar *md5string = g_malloc0 (33);
for (i = 0; i < 16; ++i)
sprintf (md5string + i * 2, "%02x", sink->md5[i]);

View file

@ -455,7 +455,7 @@ find_element_get_length (gpointer data)
if (entry->self->stream_length == 0) {
typefind->stream_length_available =
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
&format, &entry->self->stream_length);
&format, (gint64 *) & entry->self->stream_length);
if (format != GST_FORMAT_BYTES)
typefind->stream_length_available = FALSE;
if (!typefind->stream_length_available) {
@ -517,7 +517,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
start_typefinding (typefind);
gst_event_unref (event);
} else {
guint64 off;
gint64 off;
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
off == typefind->waiting_for_discont_offset) {

View file

@ -105,13 +105,25 @@ gst_trace_destroy (GstTrace * trace)
void
gst_trace_flush (GstTrace * trace)
{
gint to_write, written;
guint8 *ptr;
if (!trace) {
trace = _gst_trace_default;
if (!trace)
return;
}
write (trace->fd, trace->buf, trace->bufoffset * sizeof (GstTraceEntry));
to_write = trace->bufoffset * sizeof (GstTraceEntry);
ptr = (guint8 *) trace->buf;
while (to_write > 0) {
written = write (trace->fd, ptr, to_write);
if (written <= 0) {
GST_ERROR ("Trace flush failed");
break;
}
to_write -= written;
}
trace->bufoffset = 0;
}
@ -121,7 +133,7 @@ gst_trace_text_flush (GstTrace * trace)
int i;
#define STRSIZE (20 + 1 + 10 + 1 + 10 + 1 + 112 + 1 + 1)
char str[STRSIZE];
char str[STRSIZE], *ptr;
if (!trace) {
trace = _gst_trace_default;
@ -130,10 +142,21 @@ gst_trace_text_flush (GstTrace * trace)
}
for (i = 0; i < trace->bufoffset; i++) {
gint written, to_write;
g_snprintf (str, STRSIZE, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
trace->buf[i].timestamp,
trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
write (trace->fd, str, strlen (str));
to_write = strlen (str);
ptr = str;
while (to_write > 0) {
written = write (trace->fd, ptr, to_write);
if (written <= 0) {
GST_ERROR ("Text flush failed");
break;
}
to_write -= written;
}
}
trace->bufoffset = 0;
#undef STRSIZE

View file

@ -118,14 +118,16 @@ gst_xml_write (GstElement * element)
xmlNodePtr elementnode;
xmlNsPtr gst_ns;
doc = xmlNewDoc ("1.0");
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstreamer", NULL);
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstreamer", NULL);
gst_ns =
xmlNewNs (doc->xmlRootNode, "http://gstreamer.net/gst-core/1.0/", "gst");
xmlNewNs (doc->xmlRootNode,
(guchar *) "http://gstreamer.net/gst-core/1.0/", (guchar *) "gst");
elementnode = xmlNewChild (doc->xmlRootNode, gst_ns, "element", NULL);
elementnode =
xmlNewChild (doc->xmlRootNode, gst_ns, (guchar *) "element", NULL);
gst_object_save_thyself (GST_OBJECT (element), elementnode);
@ -218,12 +220,13 @@ gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
g_warning ("gstxml: empty document\n");
return FALSE;
}
ns = xmlSearchNsByHref (doc, cur, "http://gstreamer.net/gst-core/1.0/");
ns = xmlSearchNsByHref (doc, cur,
(guchar *) "http://gstreamer.net/gst-core/1.0/");
if (ns == NULL) {
g_warning ("gstxml: document of wrong type, core namespace not found\n");
return FALSE;
}
if (strcmp (cur->name, "gstreamer")) {
if (strcmp ((char *) cur->name, "gstreamer")) {
g_warning ("gstxml: XML file is in wrong format\n");
return FALSE;
}
@ -236,7 +239,7 @@ gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root)
field = cur->xmlChildrenNode;
while (field) {
if (!strcmp (field->name, "element") && (field->ns == xml->ns)) {
if (!strcmp ((char *) field->name, "element") && (field->ns == xml->ns)) {
GstElement *element;
element = gst_xml_make_element (field, NULL);
@ -275,7 +278,7 @@ gst_xml_parse_file (GstXML * xml, const guchar * fname, const guchar * root)
g_return_val_if_fail (fname != NULL, FALSE);
doc = xmlParseFile (fname);
doc = xmlParseFile ((char *) fname);
if (!doc) {
g_warning ("gstxml: XML file \"%s\" could not be read\n", fname);
@ -305,9 +308,9 @@ gst_xml_parse_memory (GstXML * xml, guchar * buffer, guint size,
g_return_val_if_fail (buffer != NULL, FALSE);
doc = xmlParseMemory (buffer, size);
doc = xmlParseMemory ((char *) buffer, size);
return gst_xml_parse_doc (xml, doc, root);
return gst_xml_parse_doc (xml, doc, (const guchar *) root);
}
static void
@ -365,11 +368,11 @@ gst_xml_get_element (GstXML * xml, const guchar * name)
GstElement *top = GST_ELEMENT (topelements->data);
GST_DEBUG ("gstxml: getting element \"%s\"", name);
if (!strcmp (GST_ELEMENT_NAME (top), name)) {
if (!strcmp ((char *) GST_ELEMENT_NAME (top), (char *) name)) {
return top;
} else {
if (GST_IS_BIN (top)) {
element = gst_bin_get_by_name (GST_BIN (top), name);
element = gst_bin_get_by_name (GST_BIN (top), (char *) name);
if (element)
return element;
@ -399,9 +402,9 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
/* first get the needed tags to construct the element */
while (children) {
if (!strcmp (children->name, "name")) {
if (!strcmp ((char *) children->name, "name")) {
name = xmlNodeGetContent (children);
} else if (!strcmp (children->name, "type")) {
} else if (!strcmp ((char *) children->name, "type")) {
type = xmlNodeGetContent (children);
}
children = children->next;
@ -411,7 +414,7 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
GST_CAT_INFO (GST_CAT_XML, "loading \"%s\" of type \"%s\"", name, type);
element = gst_element_factory_make (type, name);
element = gst_element_factory_make ((char *) type, (char *) name);
g_return_val_if_fail (element != NULL, NULL);

View file

@ -364,24 +364,24 @@ gst_file_index_load (GstFileIndex * index)
//xmlDocFormatDump (stderr, doc, TRUE);
root = doc->xmlRootNode;
if (strcmp (root->name, "gstfileindex") != 0) {
if (strcmp ((char *) root->name, "gstfileindex") != 0) {
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
return;
}
val = xmlGetProp (root, "version");
if (!val || atoi (val) != 1) {
val = xmlGetProp (root, (guchar *) "version");
if (!val || atoi ((char *) val) != 1) {
GST_ERROR_OBJECT (index, "version != 1");
return;
}
free (val);
for (part = root->children; part; part = part->next) {
if (strcmp (part->name, "writers") == 0) {
if (strcmp ((char *) part->name, "writers") == 0) {
xmlNodePtr writer;
for (writer = part->children; writer; writer = writer->next) {
xmlChar *datafile = xmlGetProp (writer, "datafile");
xmlChar *datafile = xmlGetProp (writer, (guchar *) "datafile");
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
int fd;
GstFileIndexId *id_index;
@ -400,22 +400,22 @@ gst_file_index_load (GstFileIndex * index)
}
id_index = g_new0 (GstFileIndexId, 1);
id_index->id_desc = xmlGetProp (writer, "id");
id_index->id_desc = (char *) xmlGetProp (writer, (guchar *) "id");
for (wpart = writer->children; wpart; wpart = wpart->next) {
if (strcmp (wpart->name, "formats") == 0) {
xmlChar *count_str = xmlGetProp (wpart, "count");
if (strcmp ((char *) wpart->name, "formats") == 0) {
xmlChar *count_str = xmlGetProp (wpart, (guchar *) "count");
gint fx = 0;
xmlNodePtr format;
id_index->nformats = atoi (count_str);
id_index->nformats = atoi ((char *) count_str);
free (count_str);
id_index->format = g_new (GstFormat, id_index->nformats);
for (format = wpart->children; format; format = format->next) {
xmlChar *nick = xmlGetProp (format, "nick");
GstFormat fmt = gst_format_get_by_nick (nick);
xmlChar *nick = xmlGetProp (format, (guchar *) "nick");
GstFormat fmt = gst_format_get_by_nick ((char *) nick);
if (fmt == GST_FORMAT_UNDEFINED)
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
@ -431,8 +431,8 @@ gst_file_index_load (GstFileIndex * index)
_fc_alloc_array (id_index);
g_assert (id_index->array->data == NULL); /* little bit risky */
entries_str = xmlGetProp (writer, "entries");
id_index->array->len = atoi (entries_str);
entries_str = xmlGetProp (writer, (guchar *) "entries");
id_index->array->len = atoi ((char *) entries_str);
free (entries_str);
array_data =
@ -505,22 +505,22 @@ _file_index_id_save_xml (gpointer _key, GstFileIndexId * ii, xmlNodePtr writers)
return;
}
writer = xmlNewChild (writers, NULL, "writer", NULL);
xmlSetProp (writer, "id", ii->id_desc);
writer = xmlNewChild (writers, NULL, (guchar *) "writer", NULL);
xmlSetProp (writer, (guchar *) "id", (guchar *) ii->id_desc);
g_snprintf (buf, bufsize, "%d", ii->array->len);
xmlSetProp (writer, "entries", buf);
xmlSetProp (writer, (guchar *) "entries", (guchar *) buf);
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
xmlSetProp (writer, "datafile", buf);
xmlSetProp (writer, (guchar *) "datafile", (guchar *) buf);
formats = xmlNewChild (writer, NULL, "formats", NULL);
formats = xmlNewChild (writer, NULL, (guchar *) "formats", NULL);
g_snprintf (buf, bufsize, "%d", ii->nformats);
xmlSetProp (formats, "count", buf);
xmlSetProp (formats, (guchar *) "count", (guchar *) buf);
for (xx = 0; xx < ii->nformats; xx++) {
xmlNodePtr format = xmlNewChild (formats, NULL, "format", NULL);
xmlNodePtr format = xmlNewChild (formats, NULL, (guchar *) "format", NULL);
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
xmlSetProp (format, "nick", def->nick);
xmlSetProp (format, (guchar *) "nick", (guchar *) def->nick);
}
}
@ -591,11 +591,11 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
xmlSetProp (doc->xmlRootNode, "version", "1");
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstfileindex", NULL);
xmlSetProp (doc->xmlRootNode, (guchar *) "version", (guchar *) "1");
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
writers = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "writers", NULL);
g_hash_table_foreach (index->id_index,
(GHFunc) _file_index_id_save_xml, writers);
@ -623,7 +623,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
int xmlsize;
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
g_io_channel_write_chars (tocfile, xmlmem, xmlsize, NULL, &err);
g_io_channel_write_chars (tocfile, (char *) xmlmem, xmlsize, NULL, &err);
if (err) {
GST_ERROR_OBJECT (index, "%s", err->message);
return;

View file

@ -2468,11 +2468,12 @@ group_inc_links_for_element (GstOptSchedulerGroup * group, GstElement * element)
pad = (GstPad *) l->data;
if (GST_IS_REAL_PAD (pad) && GST_PAD_PEER (pad)) {
get_group (GST_PAD_PARENT (GST_PAD_PEER (pad)), &peer_group);
if (peer_group && peer_group != group)
if (peer_group && peer_group != group) {
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
group_inc_link (group, peer_group);
else
group_inc_link (peer_group, group);
}
}
}
}

View file

@ -276,14 +276,14 @@ gst_dp_packet_from_caps (const GstCaps * caps, GstDPHeaderFlag flags,
crc = 0;
if (flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
crc = gst_dp_crc (string, strlen (string) + 1);
crc = gst_dp_crc ((guchar *) string, strlen (string) + 1);
}
GST_WRITE_UINT16_BE (h + 58, crc);
GST_LOG ("created header from caps:");
gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
*header = h;
*payload = string;
*payload = (guchar *) string;
return TRUE;
}
@ -393,7 +393,7 @@ gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags,
crc = 0;
/* events can have a NULL payload */
if (*payload && flags & GST_DP_HEADER_FLAG_CRC_PAYLOAD) {
crc = gst_dp_crc (*payload, strlen (*payload) + 1);
crc = gst_dp_crc (*payload, strlen ((char *) *payload) + 1);
}
GST_WRITE_UINT16_BE (h + 58, crc);
@ -457,7 +457,7 @@ gst_dp_caps_from_packet (guint header_length, const guint8 * header,
g_return_val_if_fail (GST_DP_HEADER_PAYLOAD_TYPE (header) ==
GST_DP_PAYLOAD_CAPS, NULL);
string = payload;
string = (char *) payload;
caps = gst_caps_from_string (string);
return caps;
}

View file

@ -333,7 +333,7 @@ gst_aggregator_loop (GstElement * element)
*/
if (GST_PAD_IS_USABLE (pad)) {
buf = GST_BUFFER (gst_pad_pull (pad));
debug = "loop";
debug = (guchar *) "loop";
/* then push it forward */
gst_aggregator_push (aggregator, pad, buf, debug);
@ -343,7 +343,7 @@ gst_aggregator_loop (GstElement * element)
if (aggregator->sched == AGGREGATOR_LOOP_SELECT) {
GstPad *pad;
debug = "loop_select";
debug = (guchar *) "loop_select";
buf = GST_BUFFER (gst_pad_collectv (&pad, aggregator->sinkpads));
@ -374,5 +374,5 @@ gst_aggregator_chain (GstPad * pad, GstData * _data)
aggregator = GST_AGGREGATOR (gst_pad_get_parent (pad));
/* gst_trace_add_entry (NULL, 0, buf, "aggregator buffer");*/
gst_aggregator_push (aggregator, pad, buf, "chain");
gst_aggregator_push (aggregator, pad, buf, (guchar *) "chain");
}

View file

@ -464,7 +464,7 @@ gst_md5sink_get_property (GObject * object, guint prop_id, GValue * value,
* md5_read_ctx (sink, sink->md5); */
/* md5 is a guchar[16] */
int i;
guchar *md5string = g_malloc0 (33);
gchar *md5string = g_malloc0 (33);
for (i = 0; i < 16; ++i)
sprintf (md5string + i * 2, "%02x", sink->md5[i]);

View file

@ -455,7 +455,7 @@ find_element_get_length (gpointer data)
if (entry->self->stream_length == 0) {
typefind->stream_length_available =
gst_pad_query (GST_PAD_PEER (entry->self->sink), GST_QUERY_TOTAL,
&format, &entry->self->stream_length);
&format, (gint64 *) & entry->self->stream_length);
if (format != GST_FORMAT_BYTES)
typefind->stream_length_available = FALSE;
if (!typefind->stream_length_available) {
@ -517,7 +517,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
start_typefinding (typefind);
gst_event_unref (event);
} else {
guint64 off;
gint64 off;
if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &off) &&
off == typefind->waiting_for_discont_offset) {

View file

@ -364,24 +364,24 @@ gst_file_index_load (GstFileIndex * index)
//xmlDocFormatDump (stderr, doc, TRUE);
root = doc->xmlRootNode;
if (strcmp (root->name, "gstfileindex") != 0) {
if (strcmp ((char *) root->name, "gstfileindex") != 0) {
GST_ERROR_OBJECT (index, "root node isn't a gstfileindex");
return;
}
val = xmlGetProp (root, "version");
if (!val || atoi (val) != 1) {
val = xmlGetProp (root, (guchar *) "version");
if (!val || atoi ((char *) val) != 1) {
GST_ERROR_OBJECT (index, "version != 1");
return;
}
free (val);
for (part = root->children; part; part = part->next) {
if (strcmp (part->name, "writers") == 0) {
if (strcmp ((char *) part->name, "writers") == 0) {
xmlNodePtr writer;
for (writer = part->children; writer; writer = writer->next) {
xmlChar *datafile = xmlGetProp (writer, "datafile");
xmlChar *datafile = xmlGetProp (writer, (guchar *) "datafile");
gchar *path = g_strdup_printf ("%s/%s", index->location, datafile);
int fd;
GstFileIndexId *id_index;
@ -400,22 +400,22 @@ gst_file_index_load (GstFileIndex * index)
}
id_index = g_new0 (GstFileIndexId, 1);
id_index->id_desc = xmlGetProp (writer, "id");
id_index->id_desc = (char *) xmlGetProp (writer, (guchar *) "id");
for (wpart = writer->children; wpart; wpart = wpart->next) {
if (strcmp (wpart->name, "formats") == 0) {
xmlChar *count_str = xmlGetProp (wpart, "count");
if (strcmp ((char *) wpart->name, "formats") == 0) {
xmlChar *count_str = xmlGetProp (wpart, (guchar *) "count");
gint fx = 0;
xmlNodePtr format;
id_index->nformats = atoi (count_str);
id_index->nformats = atoi ((char *) count_str);
free (count_str);
id_index->format = g_new (GstFormat, id_index->nformats);
for (format = wpart->children; format; format = format->next) {
xmlChar *nick = xmlGetProp (format, "nick");
GstFormat fmt = gst_format_get_by_nick (nick);
xmlChar *nick = xmlGetProp (format, (guchar *) "nick");
GstFormat fmt = gst_format_get_by_nick ((char *) nick);
if (fmt == GST_FORMAT_UNDEFINED)
GST_ERROR_OBJECT (index, "format '%s' undefined", nick);
@ -431,8 +431,8 @@ gst_file_index_load (GstFileIndex * index)
_fc_alloc_array (id_index);
g_assert (id_index->array->data == NULL); /* little bit risky */
entries_str = xmlGetProp (writer, "entries");
id_index->array->len = atoi (entries_str);
entries_str = xmlGetProp (writer, (guchar *) "entries");
id_index->array->len = atoi ((char *) entries_str);
free (entries_str);
array_data =
@ -505,22 +505,22 @@ _file_index_id_save_xml (gpointer _key, GstFileIndexId * ii, xmlNodePtr writers)
return;
}
writer = xmlNewChild (writers, NULL, "writer", NULL);
xmlSetProp (writer, "id", ii->id_desc);
writer = xmlNewChild (writers, NULL, (guchar *) "writer", NULL);
xmlSetProp (writer, (guchar *) "id", (guchar *) ii->id_desc);
g_snprintf (buf, bufsize, "%d", ii->array->len);
xmlSetProp (writer, "entries", buf);
xmlSetProp (writer, (guchar *) "entries", (guchar *) buf);
g_snprintf (buf, bufsize, "%d", ii->id); /* any unique number is OK */
xmlSetProp (writer, "datafile", buf);
xmlSetProp (writer, (guchar *) "datafile", (guchar *) buf);
formats = xmlNewChild (writer, NULL, "formats", NULL);
formats = xmlNewChild (writer, NULL, (guchar *) "formats", NULL);
g_snprintf (buf, bufsize, "%d", ii->nformats);
xmlSetProp (formats, "count", buf);
xmlSetProp (formats, (guchar *) "count", (guchar *) buf);
for (xx = 0; xx < ii->nformats; xx++) {
xmlNodePtr format = xmlNewChild (formats, NULL, "format", NULL);
xmlNodePtr format = xmlNewChild (formats, NULL, (guchar *) "format", NULL);
const GstFormatDefinition *def = gst_format_get_details (ii->format[xx]);
xmlSetProp (format, "nick", def->nick);
xmlSetProp (format, (guchar *) "nick", (guchar *) def->nick);
}
}
@ -591,11 +591,11 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
GST_FLAG_UNSET (index, GST_INDEX_WRITABLE);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "gstfileindex", NULL);
xmlSetProp (doc->xmlRootNode, "version", "1");
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "gstfileindex", NULL);
xmlSetProp (doc->xmlRootNode, (guchar *) "version", (guchar *) "1");
writers = xmlNewChild (doc->xmlRootNode, NULL, "writers", NULL);
writers = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "writers", NULL);
g_hash_table_foreach (index->id_index,
(GHFunc) _file_index_id_save_xml, writers);
@ -623,7 +623,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
int xmlsize;
xmlDocDumpMemory (doc, &xmlmem, &xmlsize);
g_io_channel_write_chars (tocfile, xmlmem, xmlsize, NULL, &err);
g_io_channel_write_chars (tocfile, (char *) xmlmem, xmlsize, NULL, &err);
if (err) {
GST_ERROR_OBJECT (index, "%s", err->message);
return;

View file

@ -6,10 +6,10 @@ type_found (GstElement * typefind, const GstCaps * caps)
xmlDocPtr doc;
xmlNodePtr parent;
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, (guchar *) "Capabilities", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
parent = xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "Caps1", NULL);
/* FIXME */
//gst_caps_save_thyself (caps, parent);

View file

@ -11,16 +11,17 @@ object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
/* first see if the namespace is already known */
ns = xmlSearchNsByHref (parent->doc, parent,
"http://gstreamer.net/gst-test/1.0/");
(guchar *) "http://gstreamer.net/gst-test/1.0/");
if (ns == NULL) {
xmlNodePtr root = xmlDocGetRootElement (parent->doc);
/* add namespace to root node */
ns = xmlNewNs (root, "http://gstreamer.net/gst-test/1.0/", "test");
ns = xmlNewNs (root, (guchar *) "http://gstreamer.net/gst-test/1.0/",
(guchar *) "test");
}
child = xmlNewChild (parent, ns, "comment", NULL);
child = xmlNewChild (parent, ns, (guchar *) "comment", NULL);
xmlNewChild (child, NULL, "text", (gchar *) data);
xmlNewChild (child, NULL, (guchar *) "text", (guchar *) data);
}
int

View file

@ -10,12 +10,12 @@ xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
xmlNodePtr children = self->xmlChildrenNode;
while (children) {
if (!strcmp (children->name, "comment")) {
if (!strcmp ((char *) children->name, "comment")) {
xmlNodePtr nodes = children->xmlChildrenNode;
while (nodes) {
if (!strcmp (nodes->name, "text")) {
gchar *name = g_strdup (xmlNodeGetContent (nodes));
if (!strcmp ((char *) nodes->name, "text")) {
gchar *name = g_strdup ((char *) xmlNodeGetContent (nodes));
g_print ("object %s loaded with comment '%s'\n",
gst_object_get_name (object), name);
@ -42,13 +42,13 @@ main (int argc, char *argv[])
/* G_CALLBACK (xml_loaded), xml); */
if (argc == 2)
ret = gst_xml_parse_file (xml, argv[1], NULL);
ret = gst_xml_parse_file (xml, (guchar *) argv[1], NULL);
else
ret = gst_xml_parse_file (xml, "xmlTest.gst", NULL);
ret = gst_xml_parse_file (xml, (guchar *) "xmlTest.gst", NULL);
g_assert (ret == TRUE);
pipeline = gst_xml_get_element (xml, "pipeline");
pipeline = gst_xml_get_element (xml, (guchar *) "pipeline");
g_assert (pipeline != NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);

View file

@ -108,44 +108,45 @@ main (int argc, char *argv[])
elementnode = rootnode->xmlChildrenNode;
while (elementnode) {
if (!strcmp (elementnode->name, "element")) {
if (!strcmp ((char *) elementnode->name, "element")) {
element = g_new0 (comp_element, 1);
propnode = elementnode->xmlChildrenNode;
while (propnode) {
if (!strcmp (propnode->name, "name")) {
element->name = xmlNodeGetContent (propnode);
if (!strcmp ((char *) propnode->name, "name")) {
element->name = (char *) xmlNodeGetContent (propnode);
/* fprintf(stderr,element->name); */
} else if (!strcmp (propnode->name, "srcpad")) {
} else if (!strcmp ((char *) propnode->name, "srcpad")) {
element->srcpads =
g_slist_prepend (element->srcpads, xmlNodeGetContent (propnode));
/* fprintf(stderr,"."); */
} else if (!strcmp (propnode->name, "sinkpad")) {
} else if (!strcmp ((char *) propnode->name, "sinkpad")) {
element->sinkpads =
g_slist_prepend (element->sinkpads, xmlNodeGetContent (propnode));
} else if (!strcmp (propnode->name, "srcpadtemplate")) {
} else if (!strcmp ((char *) propnode->name, "srcpadtemplate")) {
element->srcpadtemplates =
g_slist_prepend (element->srcpadtemplates,
xmlNodeGetContent (propnode));
/* fprintf(stderr,"."); */
} else if (!strcmp (propnode->name, "sinkpad")) {
} else if (!strcmp ((char *) propnode->name, "sinkpad")) {
element->sinkpadtemplates =
g_slist_prepend (element->sinkpadtemplates,
xmlNodeGetContent (propnode));
} else if (!strcmp (propnode->name, "argument")) {
} else if (!strcmp ((char *) propnode->name, "argument")) {
argument = g_new0 (comp_argument, 1);
argument->name = xmlNodeGetContent (propnode);
argument->name = (char *) xmlNodeGetContent (propnode);
argument->type = ARG_INT;
/* walk through the values data */
argnode = propnode->xmlChildrenNode;
while (argnode) {
if (!strcmp (argnode->name, "filename")) {
if (!strcmp ((char *) argnode->name, "filename")) {
argument->type = ARG_FILENAME;
} else if (!strcmp (argnode->name, "option")) {
} else if (!strcmp ((char *) argnode->name, "option")) {
argument->type = ARG_ENUM;
option = g_new0 (enum_value, 1);
sscanf (xmlNodeGetContent (argnode), "%d", &option->value);
sscanf ((char *) xmlNodeGetContent (argnode), "%d",
&option->value);
argument->enums = g_slist_prepend (argument->enums, option);
}
argnode = argnode->next;

View file

@ -40,8 +40,9 @@ main (int argc, char *argv[])
GST_DEBUG_CATEGORY_INIT (debug_compprep, "compprep", GST_DEBUG_BOLD,
"gst-compprep application");
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "GST-CompletionRegistry", NULL);
doc = xmlNewDoc ((guchar *) "1.0");
doc->xmlRootNode =
xmlNewDocNode (doc, NULL, (guchar *) "GST-CompletionRegistry", NULL);
plugins = g_list_copy (gst_registry_pool_plugin_list ());
while (plugins) {
@ -63,9 +64,10 @@ main (int argc, char *argv[])
factory = GST_ELEMENT_FACTORY (feature);
factorynode = xmlNewChild (doc->xmlRootNode, NULL, "element", NULL);
xmlNewChild (factorynode, NULL, "name",
GST_PLUGIN_FEATURE_NAME (factory));
factorynode =
xmlNewChild (doc->xmlRootNode, NULL, (guchar *) "element", NULL);
xmlNewChild (factorynode, NULL, (guchar *) "name",
(guchar *) GST_PLUGIN_FEATURE_NAME (factory));
element = gst_element_factory_create (factory, NULL);
GST_DEBUG ("adding factory %s", GST_PLUGIN_FEATURE_NAME (factory));
@ -83,12 +85,12 @@ main (int argc, char *argv[])
if (padtemplate->direction == GST_PAD_SRC)
padnode =
xmlNewChild (factorynode, NULL, "srcpadtemplate",
padtemplate->name_template);
xmlNewChild (factorynode, NULL, (guchar *) "srcpadtemplate",
(guchar *) padtemplate->name_template);
else if (padtemplate->direction == GST_PAD_SINK)
padnode =
xmlNewChild (factorynode, NULL, "sinkpadtemplate",
padtemplate->name_template);
xmlNewChild (factorynode, NULL, (guchar *) "sinkpadtemplate",
(guchar *) padtemplate->name_template);
}
pads = gst_element_get_pad_list (element);
@ -98,10 +100,12 @@ main (int argc, char *argv[])
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
padnode =
xmlNewChild (factorynode, NULL, "srcpad", GST_PAD_NAME (pad));
xmlNewChild (factorynode, NULL, (guchar *) "srcpad",
(guchar *) GST_PAD_NAME (pad));
else if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK)
padnode =
xmlNewChild (factorynode, NULL, "sinkpad", GST_PAD_NAME (pad));
xmlNewChild (factorynode, NULL, (guchar *) "sinkpad",
(guchar *) GST_PAD_NAME (pad));
}
/* write out the args */
@ -111,9 +115,11 @@ main (int argc, char *argv[])
for (i = 0; i < num_properties; i++) {
GParamSpec *param = property_specs[i];
argnode = xmlNewChild (factorynode, NULL, "argument", param->name);
argnode =
xmlNewChild (factorynode, NULL, (guchar *) "argument",
(guchar *) param->name);
if (param->value_type == GST_TYPE_URI) {
xmlNewChild (argnode, NULL, "filename", NULL);
xmlNewChild (argnode, NULL, (guchar *) "filename", NULL);
} else if (G_IS_PARAM_SPEC_ENUM (param) == G_TYPE_ENUM) {
GEnumValue *values;
gint j;
@ -122,8 +128,11 @@ main (int argc, char *argv[])
for (j = 0; values[j].value_name; j++) {
gchar *value = g_strdup_printf ("%d", values[j].value);
optionnode = xmlNewChild (argnode, NULL, "option", value);
xmlNewChild (optionnode, NULL, "value_nick", values[j].value_nick);
optionnode =
xmlNewChild (argnode, NULL, (guchar *) "option",
(guchar *) value);
xmlNewChild (optionnode, NULL, (guchar *) "value_nick",
(guchar *) values[j].value_nick);
g_free (value);
}
}

View file

@ -259,7 +259,7 @@ static void
print_element_properties_info (GstElement * element)
{
GParamSpec **property_specs;
gint num_properties, i;
guint num_properties, i;
gboolean readable;
const char *string_val;

View file

@ -143,7 +143,7 @@ xmllaunch_parse_cmdline (const gchar ** argv)
}
xml = gst_xml_new ();
err = gst_xml_parse_file (xml, arg, NULL);
err = gst_xml_parse_file (xml, (guchar *) arg, NULL);
if (err != TRUE) {
fprintf (stderr, _("ERROR: parse of xml file '%s' failed.\n"), arg);

View file

@ -179,7 +179,7 @@ static void
print_element_properties (GstElement * element, gint pfx)
{
GParamSpec **property_specs;
gint num_properties, i;
guint num_properties, i;
gboolean readable;
property_specs = g_object_class_list_properties