From fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 11:13:25 -0400 Subject: Prefer GLib basic types over C types. --- plugins/save-calendar/rdf-format.c | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'plugins/save-calendar/rdf-format.c') diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index 9c9f864a2a..685fbdd6e5 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -45,7 +45,7 @@ #include "format-handler.h" static void -add_string_to_rdf (xmlNodePtr node, const gchar *tag, const char *value); +add_string_to_rdf (xmlNodePtr node, const gchar *tag, const gchar *value); /* Use { */ @@ -100,7 +100,7 @@ add_list_to_rdf (xmlNodePtr node, const gchar *tag, GSList *list_in, gint type) GSList *list = list_in; while (list) { - const char *str = NULL; + const gchar *str = NULL; switch (type) { case ECALCOMPONENTATTENDEE: @@ -127,8 +127,8 @@ add_nummeric_to_rdf (xmlNodePtr node, const gchar *tag, gint *nummeric) { if (nummeric) { gchar *value = g_strdup_printf ("%d", *nummeric); - xmlNodePtr cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)value); - xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (const unsigned char *)"http://www.w3.org/2001/XMLSchema#integer"); + xmlNodePtr cur_node = xmlNewChild (node, NULL, (guchar *)tag, (guchar *)value); + xmlSetProp (cur_node, (const guchar *)"rdf:datatype", (const guchar *)"http://www.w3.org/2001/XMLSchema#integer"); g_free (value); } } @@ -139,7 +139,7 @@ add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time) if (time) { xmlNodePtr cur_node = NULL; struct tm mytm = icaltimetype_to_tm (time); - gchar *str = (gchar*) g_malloc (sizeof (gchar) * 200); + gchar *str = (gchar *) g_malloc (sizeof (gchar) * 200); gchar *tmp = NULL; gchar *timezone; /* @@ -149,12 +149,12 @@ add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time) * */ e_utf8_strftime (str, 200, _("%FT%T"), &mytm); - cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)str); + cur_node = xmlNewChild (node, NULL, (guchar *)tag, (guchar *)str); /* Not sure about this property */ timezone = calendar_config_get_timezone (); tmp = g_strdup_printf ("http://www.w3.org/2002/12/cal/tzd/%s#tz", timezone); - xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (unsigned char *)tmp); + xmlSetProp (cur_node, (const guchar *)"rdf:datatype", (guchar *)tmp); g_free (tmp); g_free (timezone); g_free (str); @@ -163,12 +163,12 @@ add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time) static void -add_string_to_rdf (xmlNodePtr node, const gchar *tag, const char *value) +add_string_to_rdf (xmlNodePtr node, const gchar *tag, const gchar *value) { if (value) { xmlNodePtr cur_node = NULL; - cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)value); - xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (const unsigned char *)"http://www.w3.org/2001/XMLSchema#string"); + cur_node = xmlNewChild (node, NULL, (guchar *)tag, (guchar *)value); + xmlSetProp (cur_node, (const guchar *)"rdf:datatype", (const guchar *)"http://www.w3.org/2001/XMLSchema#string"); } } @@ -176,7 +176,7 @@ add_string_to_rdf (xmlNodePtr node, const gchar *tag, const char *value) static void -do_save_calendar_rdf (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource *target, ECalSourceType type, char *dest_uri) +do_save_calendar_rdf (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource *target, ECalSourceType type, gchar *dest_uri) { /* @@ -216,51 +216,51 @@ do_save_calendar_rdf (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource xmlDocPtr doc = xmlNewDoc((xmlChar *) "1.0"); xmlNodePtr fnode = doc->children; - doc->children = xmlNewDocNode (doc, NULL, (const unsigned char *)"rdf:RDF", NULL); - xmlSetProp (doc->children, (const unsigned char *)"xmlns:rdf", (const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - xmlSetProp (doc->children, (const unsigned char *)"xmlns", (const unsigned char *)"http://www.w3.org/2002/12/cal/ical#"); + doc->children = xmlNewDocNode (doc, NULL, (const guchar *)"rdf:RDF", NULL); + xmlSetProp (doc->children, (const guchar *)"xmlns:rdf", (const guchar *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + xmlSetProp (doc->children, (const guchar *)"xmlns", (const guchar *)"http://www.w3.org/2002/12/cal/ical#"); - fnode = xmlNewChild (doc->children, NULL, (const unsigned char *)"Vcalendar", NULL); + fnode = xmlNewChild (doc->children, NULL, (const guchar *)"Vcalendar", NULL); /* Should Evolution publicise these? */ - xmlSetProp (fnode, (const unsigned char *)"xmlns:x-wr", (const unsigned char *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#"); - xmlSetProp (fnode, (const unsigned char *)"xmlns:x-lic", (const unsigned char *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#"); + xmlSetProp (fnode, (const guchar *)"xmlns:x-wr", (const guchar *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#"); + xmlSetProp (fnode, (const guchar *)"xmlns:x-lic", (const guchar *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#"); /* Not sure if it's correct like this */ - xmlNewChild (fnode, NULL, (const unsigned char *)"prodid", (const unsigned char *)"-//" PACKAGE_STRING "//iCal 1.0//EN"); + xmlNewChild (fnode, NULL, (const guchar *)"prodid", (const guchar *)"-//" PACKAGE_STRING "//iCal 1.0//EN"); /* Assuming GREGORIAN is the only supported calendar scale */ - xmlNewChild (fnode, NULL, (const unsigned char *)"calscale", (const unsigned char *)"GREGORIAN"); + xmlNewChild (fnode, NULL, (const guchar *)"calscale", (const guchar *)"GREGORIAN"); temp = calendar_config_get_timezone (); - xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:timezone", (unsigned char *)temp); + xmlNewChild (fnode, NULL, (const guchar *)"x-wr:timezone", (guchar *)temp); g_free (temp); - xmlNewChild (fnode, NULL, (const unsigned char *)"method", (const unsigned char *)"PUBLISH"); + xmlNewChild (fnode, NULL, (const guchar *)"method", (const guchar *)"PUBLISH"); - xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:relcalid", (unsigned char *)e_source_peek_uid (primary_source)); + xmlNewChild (fnode, NULL, (const guchar *)"x-wr:relcalid", (guchar *)e_source_peek_uid (primary_source)); - xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:calname", (unsigned char *)e_source_peek_name (primary_source)); + xmlNewChild (fnode, NULL, (const guchar *)"x-wr:calname", (guchar *)e_source_peek_name (primary_source)); /* Version of this RDF-format */ - xmlNewChild (fnode, NULL, (const unsigned char *)"version", (const unsigned char *)"2.0"); + xmlNewChild (fnode, NULL, (const guchar *)"version", (const guchar *)"2.0"); while (objects != NULL) { ECalComponent *comp = objects->data; - const char *temp_constchar; + const gchar *temp_constchar; gchar *tmp_str = NULL; GSList *temp_list; ECalComponentDateTime temp_dt; struct icaltimetype *temp_time; - int *temp_int; + gint *temp_int; ECalComponentText temp_comptext; - xmlNodePtr c_node = xmlNewChild (fnode, NULL, (const unsigned char *)"component", NULL); - xmlNodePtr node = xmlNewChild (c_node, NULL, (const unsigned char *)"Vevent", NULL); + xmlNodePtr c_node = xmlNewChild (fnode, NULL, (const guchar *)"component", NULL); + xmlNodePtr node = xmlNewChild (c_node, NULL, (const guchar *)"Vevent", NULL); /* Getting the stuff */ e_cal_component_get_uid (comp, &temp_constchar); tmp_str = g_strdup_printf ("#%s", temp_constchar); - xmlSetProp (node, (const unsigned char *)"about", (unsigned char *)tmp_str); + xmlSetProp (node, (const guchar *)"about", (guchar *)tmp_str); g_free (tmp_str); add_string_to_rdf (node, "uid",temp_constchar); -- cgit v1.2.3