diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2007-06-03 09:57:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-06-03 09:57:58 +0800 |
commit | 187e0c0464e1db79762e2c80b0301eccb3312bad (patch) | |
tree | a789e769cd50cc69df585240499f81824a51b012 /e-util | |
parent | 37f9a97269207250d8a1f664aa6a1f4d1e810a59 (diff) | |
download | gsoc2013-evolution-187e0c0464e1db79762e2c80b0301eccb3312bad.tar.gz gsoc2013-evolution-187e0c0464e1db79762e2c80b0301eccb3312bad.tar.zst gsoc2013-evolution-187e0c0464e1db79762e2c80b0301eccb3312bad.zip |
Clean up compiler warnings in e-util directory (#438467).
svn path=/trunk/; revision=33623
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 44 | ||||
-rw-r--r-- | e-util/e-bconf-map.c | 40 | ||||
-rw-r--r-- | e-util/e-config.c | 6 | ||||
-rw-r--r-- | e-util/e-error.c | 44 | ||||
-rw-r--r-- | e-util/e-event.c | 4 | ||||
-rw-r--r-- | e-util/e-folder-map.c | 6 | ||||
-rw-r--r-- | e-util/e-html-utils.c | 40 | ||||
-rw-r--r-- | e-util/e-import.c | 4 | ||||
-rw-r--r-- | e-util/e-menu.c | 12 | ||||
-rw-r--r-- | e-util/e-pilot-map.c | 36 | ||||
-rw-r--r-- | e-util/e-plugin.c | 34 | ||||
-rw-r--r-- | e-util/e-popup.c | 6 | ||||
-rw-r--r-- | e-util/e-signature.c | 38 | ||||
-rw-r--r-- | e-util/e-xml-utils.c | 46 |
14 files changed, 202 insertions, 158 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index f3a78ee7b2..42a00c3c98 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,47 @@ +2007-06-02 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #438467 (Patch from Gilles Dartiguelongue) + + * e-bconf-map.c: (e_bconf_hex_decode), (e_bconf_get_path), + (e_bconf_get_entry), (e_bconf_get_value), (build_xml), + (e_bconf_import_xml_blob), (e_bconf_import): + * e-config.c: (emph_construct_menu), (emph_construct): + * e-error.c: (ee_load): + * e-event.c: (emph_construct_item), (emph_construct): + * e-folder-map.c: (is_type_folder): + * e-html-utils.c: (url_extract), (email_address_extract), + (is_citation), (e_text_to_html_full): + * e-import.c: (emph_construct_importer), (emph_construct): + * e-menu.c: (emph_construct_menu), (emph_construct): + * e-pilot-map.c: (map_set_node_timet), (map_sax_start_element), + (map_write_foreach), (e_pilot_map_write): + * e-plugin.c: (ep_construct), (ep_load_plugin), (ep_load), + (ep_load_pending), (e_plugin_register_type), (e_plugin_xml_prop), + (e_plugin_xml_prop_domain), (e_plugin_xml_int), + (e_plugin_xml_content), (e_plugin_xml_content_domain), + (epl_construct), (e_plugin_hook_mask), (e_plugin_hook_id), + (epth_construct): + * e-popup.c: (emph_construct_menu), (emph_construct): + * e-signature.c: (xml_set_bool), (xml_set_prop), (xml_set_content), + (e_signature_uid_from_xml), (e_signature_set_from_xml), + (e_signature_to_xml): + * e-xml-utils.c: (e_xml_get_child_by_name_by_lang), + (e_xml_get_child_by_name_by_lang_list_with_score), + (e_xml_get_child_by_name_by_lang_list), + (e_xml_get_child_by_name_no_lang), + (e_xml_get_integer_prop_by_name_with_default), + (e_xml_set_integer_prop_by_name), + (e_xml_get_uint_prop_by_name_with_default), + (e_xml_set_uint_prop_by_name), + (e_xml_get_bool_prop_by_name_with_default), + (e_xml_set_bool_prop_by_name), + (e_xml_get_double_prop_by_name_with_default), + (e_xml_set_double_prop_by_name), + (e_xml_get_string_prop_by_name_with_default), + (e_xml_set_string_prop_by_name), + (e_xml_get_translated_string_prop_by_name): cast fixes and + compilation warning cleanups. + 2007-05-04 Milan Crha <mcrha@redhat.com> ** Fixes bug #432867 diff --git a/e-util/e-bconf-map.c b/e-util/e-bconf-map.c index b679061a30..43a39a3fa3 100644 --- a/e-util/e-bconf-map.c +++ b/e-util/e-bconf-map.c @@ -60,7 +60,7 @@ e_bconf_hex_decode (const char *val) char *o, *res; o = res = g_malloc (strlen (val) / 2 + 1); - for (p = val; (p[0] && p[1]); p += 2) + for (p = (const unsigned char *)val; (p[0] && p[1]); p += 2) *o++ = (hexnib[p[0]] << 4) | hexnib[p[1]]; *o = 0; @@ -97,15 +97,15 @@ e_bconf_get_path (xmlDocPtr doc, const char *path) int found; root = doc->children; - if (strcmp (root->name, "bonobo-config") != 0) { + if (strcmp ((char *)root->name, "bonobo-config") != 0) { g_warning ("not bonobo-config xml file"); return NULL; } root = root->children; while (root) { - if (!strcmp (root->name, "section")) { - val = xmlGetProp (root, "path"); + if (!strcmp ((char *)root->name, "section")) { + val = (char *)xmlGetProp (root, (const unsigned char *)"path"); found = val && strcmp (val, path) == 0; xmlFree (val); if (found) @@ -125,8 +125,8 @@ e_bconf_get_entry (xmlNodePtr root, const char *name) char *val; while (node) { - if (!strcmp (node->name, "entry")) { - val = xmlGetProp (node, "name"); + if (!strcmp ((char *)node->name, "entry")) { + val = (char *)xmlGetProp (node, (const unsigned char *)"name"); found = val && strcmp (val, name) == 0; xmlFree (val); if (found) @@ -144,7 +144,7 @@ e_bconf_get_value (xmlNodePtr root, const char *name) xmlNodePtr node = e_bconf_get_entry (root, name); char *prop, *val = NULL; - if (node && (prop = xmlGetProp (node, "value"))) { + if (node && (prop = (char *)xmlGetProp (node, (const unsigned char *)"value"))) { val = g_strdup (prop); xmlFree (prop); } @@ -276,7 +276,7 @@ build_xml (xmlNodePtr root, e_bconf_map_t *map, int index, xmlNodePtr source) while (map->type != E_BCONF_MAP_END) { if ((map->type & E_BCONF_MAP_MASK) == E_BCONF_MAP_CHILD) { - node = xmlNewChild (root, NULL, map->to, NULL); + node = xmlNewChild (root, NULL, (unsigned char *)map->to, NULL); build_xml (node, map->child, index, source); } else { name = get_name (map->from, index); @@ -286,9 +286,9 @@ build_xml (xmlNodePtr root, e_bconf_map_t *map, int index, xmlNodePtr source) if (map->type & E_BCONF_MAP_CONTENT) { if (value && value[0]) - xmlNewTextChild (root, NULL, map->to, value); + xmlNewTextChild (root, NULL, (unsigned char *)map->to, (unsigned char *)value); } else { - xmlSetProp (root, map->to, value); + xmlSetProp (root, (unsigned char *)map->to, (unsigned char *)value); } g_free (value); @@ -325,8 +325,8 @@ e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map xmlChar *xmlbuf; int n; - doc = xmlNewDoc ("1.0"); - root = xmlNewDocNode (doc, NULL, name, NULL); + doc = xmlNewDoc ((const unsigned char *)"1.0"); + root = xmlNewDocNode (doc, NULL, (unsigned char *)name, NULL); xmlDocSetRootElement (doc, root); /* This could be set with a MAP_UID type ... */ @@ -334,7 +334,7 @@ e_bconf_import_xml_blob (GConfClient *gconf, xmlDocPtr config_xmldb, e_bconf_map char buf[16]; sprintf (buf, "%d", i); - xmlSetProp (root, idparam, buf); + xmlSetProp (root, (unsigned char *)idparam, (unsigned char *)buf); } build_xml (root, map, i, source); @@ -454,7 +454,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * break; case E_GCONF_MAP_STRLIST: { char *v = e_bconf_hex_decode (val); - char **t = g_strsplit (v, " !<-->! ", 8196); + char **t = g_strsplit (v, " !<-->!", 8196); list = NULL; for (k = 0; t[k]; k++) { @@ -473,11 +473,11 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * /* find the entry node */ while (node) { - if (!strcmp (node->name, "entry")) { + if (!strcmp ((char *)node->name, "entry")) { int found; - if ((tmp = xmlGetProp (node, "name"))) { - found = strcmp (tmp, map[j].from) == 0; + if ((tmp = (char *)xmlGetProp (node, (const unsigned char *)"name"))) { + found = strcmp ((char *)tmp, map[j].from) == 0; xmlFree (tmp); if (found) break; @@ -491,7 +491,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp (node->name, "any") == 0) + if (strcmp ((char *)node->name, "any") == 0) break; node = node->next; } @@ -501,7 +501,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp (node->name, "value") == 0) + if (strcmp ((char *)node->name, "value") == 0) break; node = node->next; } @@ -510,7 +510,7 @@ e_bconf_import (GConfClient *gconf, xmlDocPtr config_xmldb, e_gconf_map_list_t * if (node) { node = node->children; while (node) { - if (strcmp (node->name, "value") == 0) + if (strcmp ((char *)node->name, "value") == 0) list = g_slist_append (list, xmlNodeGetContent (node)); node = node->next; } diff --git a/e-util/e-config.c b/e-util/e-config.c index 11bd5492b3..2cfc9f4ce7 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -1396,7 +1396,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) d(printf(" loading menu\n")); menu = g_malloc0(sizeof(*menu)); - tmp = xmlGetProp(root, "target"); + tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -1417,7 +1417,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) menu->hook = (EConfigHook *)eph; node = root->children; while (node) { - if (0 == strcmp(node->name, "item")) { + if (0 == strcmp((char *)node->name, "item")) { struct _EConfigItem *item; item = emph_construct_item(eph, menu, node, map); @@ -1448,7 +1448,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "group") == 0) { + if (strcmp((char *)node->name, "group") == 0) { struct _EConfigHookGroup *group; group = emph_construct_menu(eph, node); diff --git a/e-util/e-error.c b/e-util/e-error.c index 7b7ef5dbf0..9b0fb41428 100644 --- a/e-util/e-error.c +++ b/e-util/e-error.c @@ -178,8 +178,8 @@ ee_load(const char *path) root = xmlDocGetRootElement(doc); if (root == NULL - || strcmp(root->name, "error-list") != 0 - || (tmp = xmlGetProp(root, "domain")) == NULL) { + || strcmp((char *)root->name, "error-list") != 0 + || (tmp = (char *)xmlGetProp(root, (const unsigned char *)"domain")) == NULL) { g_warning("Error file '%s' invalid format", path); xmlFreeDoc(doc); return; @@ -194,12 +194,12 @@ ee_load(const char *path) table->errors = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(error_table, table->domain, table); - tmp2 = xmlGetProp(root, "translation-domain"); + tmp2 = (char *)xmlGetProp(root, (const unsigned char *)"translation-domain"); if (tmp2) { table->translation_domain = g_strdup(tmp2); xmlFree(tmp2); - tmp2 = xmlGetProp(root, "translation-localedir"); + tmp2 = (char *)xmlGetProp(root, (const unsigned char *)"translation-localedir"); if (tmp2) { bindtextdomain(table->translation_domain, tmp2); xmlFree(tmp2); @@ -210,8 +210,8 @@ ee_load(const char *path) xmlFree(tmp); for (error = root->children;error;error = error->next) { - if (!strcmp(error->name, "error")) { - tmp = xmlGetProp(error, "id"); + if (!strcmp((char *)error->name, "error")) { + tmp = (char *)xmlGetProp(error, (const unsigned char *)"id"); if (tmp == NULL) continue; @@ -222,25 +222,25 @@ ee_load(const char *path) xmlFree(tmp); lastbutton = (struct _e_error_button *)&e->buttons; - tmp = xmlGetProp(error, "modal"); + tmp = (char *)xmlGetProp(error, (const unsigned char *)"modal"); if (tmp) { if (!strcmp(tmp, "true")) e->flags |= GTK_DIALOG_MODAL; xmlFree(tmp); } - tmp = xmlGetProp(error, "type"); + tmp = (char *)xmlGetProp(error, (const unsigned char *)"type"); e->type = map_type(tmp); if (tmp) xmlFree(tmp); - tmp = xmlGetProp(error, "default"); + tmp = (char *)xmlGetProp(error, (const unsigned char *)"default"); if (tmp) { e->default_response = map_response(tmp); xmlFree(tmp); } - tmp = xmlGetProp(error, "scroll"); + tmp = (char *)xmlGetProp(error, (const unsigned char *)"scroll"); if (tmp) { if (!strcmp(tmp, "yes")) e->scroll = TRUE; @@ -248,42 +248,42 @@ ee_load(const char *path) } for (scan = error->children;scan;scan=scan->next) { - if (!strcmp(scan->name, "primary")) { - if ((tmp = xmlNodeGetContent(scan))) { + if (!strcmp((char *)scan->name, "primary")) { + if ((tmp = (char *)xmlNodeGetContent(scan))) { e->primary = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp(scan->name, "secondary")) { - if ((tmp = xmlNodeGetContent(scan))) { + } else if (!strcmp((char *)scan->name, "secondary")) { + if ((tmp = (char *)xmlNodeGetContent(scan))) { e->secondary = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp(scan->name, "title")) { - if ((tmp = xmlNodeGetContent(scan))) { + } else if (!strcmp((char *)scan->name, "title")) { + if ((tmp = (char *)xmlNodeGetContent(scan))) { e->title = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - } else if (!strcmp(scan->name, "help")) { - tmp = xmlGetProp(scan, "uri"); + } else if (!strcmp((char *)scan->name, "help")) { + tmp = (char *)xmlGetProp(scan, (const unsigned char *)"uri"); if (tmp) { e->help_uri = g_strdup(tmp); xmlFree(tmp); } - } else if (!strcmp(scan->name, "button")) { + } else if (!strcmp((char *)scan->name, "button")) { struct _e_error_button *b; b = g_malloc0(sizeof(*b)); - tmp = xmlGetProp(scan, "stock"); + tmp = (char *)xmlGetProp(scan, (const unsigned char *)"stock"); if (tmp) { b->stock = g_strdup(tmp); xmlFree(tmp); } - tmp = xmlGetProp(scan, "label"); + tmp = (char *)xmlGetProp(scan, (const unsigned char *)"label"); if (tmp) { b->label = g_strdup(dgettext(table->translation_domain, tmp)); xmlFree(tmp); } - tmp = xmlGetProp(scan, "response"); + tmp = (char *)xmlGetProp(scan, (const unsigned char *)"response"); if (tmp) { b->response = map_response(tmp); xmlFree(tmp); diff --git a/e-util/e-event.c b/e-util/e-event.c index 235143c883..9510a6ce74 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -433,7 +433,7 @@ emph_construct_item(EPluginHook *eph, xmlNodePtr root, EEventHookClass *klass) item = g_malloc0(sizeof(*item)); - tmp = xmlGetProp(root, "target"); + tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -478,7 +478,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "event") == 0) { + if (strcmp((char *)node->name, "event") == 0) { struct _EEventItem *item; item = emph_construct_item(eph, node, klass); diff --git a/e-util/e-folder-map.c b/e-util/e-folder-map.c index 28d3f502e3..b6ca6f1984 100644 --- a/e-util/e-folder-map.c +++ b/e-util/e-folder-map.c @@ -58,7 +58,7 @@ is_type_folder (const char *metadata, const char *search_type) return FALSE; } - if (!node->name || strcmp (node->name, "efolder") != 0) { + if (!node->name || strcmp ((char *)node->name, "efolder") != 0) { g_warning ("`%s' corrupt: root node is not 'efolder'", metadata); xmlFreeDoc (doc); return FALSE; @@ -66,8 +66,8 @@ is_type_folder (const char *metadata, const char *search_type) node = node->children; while (node != NULL) { - if (node->name && !strcmp (node->name, "type")) { - type = xmlNodeGetContent (node); + if (node->name && !strcmp ((char *)node->name, "type")) { + type = (char *)xmlNodeGetContent (node); if (!strcmp (type, search_type)) { xmlFreeDoc (doc); xmlFree (type); diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 537f99a75e..58465285ef 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -94,7 +94,7 @@ url_extract (const unsigned char **text, gboolean full_url) return NULL; } - out = g_strndup (*text, end - *text); + out = g_strndup ((char *)*text, end - *text); *text = end; return out; } @@ -128,7 +128,7 @@ email_address_extract (const unsigned char **cur, char **out, const unsigned cha if (dot > end) return NULL; - addr = g_strndup (start, end - start); + addr = g_strndup ((char *)start, end - start); *out -= *cur - start; *cur = end; @@ -146,7 +146,7 @@ is_citation (const unsigned char *c, gboolean saw_citation) /* A line that starts with a ">" is a citation, unless it's * just mbox From-mangling... */ - if (strncmp (c, ">From ", 6) != 0) + if (strncmp ((const char *)c, ">From ", 6) != 0) return TRUE; /* If the previous line was a citation, then say this @@ -228,7 +228,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) col = 0; - for (cur = linestart = input; cur && *cur; cur = next) { + for (cur = linestart = (const unsigned char *)input; cur && *cur; cur = next) { gunichar u; if (flags & E_TEXT_TO_HTML_MARK_CITATION && col == 0) { @@ -259,28 +259,28 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) out += sprintf (out, "> "); } - u = g_utf8_get_char (cur); + u = g_utf8_get_char ((char *)cur); if (g_unichar_isalpha (u) && (flags & E_TEXT_TO_HTML_CONVERT_URLS)) { char *tmpurl = NULL, *refurl = NULL, *dispurl = NULL; - if (!g_ascii_strncasecmp (cur, "http://", 7) || - !g_ascii_strncasecmp (cur, "https://", 8) || - !g_ascii_strncasecmp (cur, "ftp://", 6) || - !g_ascii_strncasecmp (cur, "nntp://", 7) || - !g_ascii_strncasecmp (cur, "mailto:", 7) || - !g_ascii_strncasecmp (cur, "news:", 5) || - !g_ascii_strncasecmp (cur, "file:", 5) || - !g_ascii_strncasecmp (cur, "callto:", 7) || - !g_ascii_strncasecmp (cur, "h323:", 5) || - !g_ascii_strncasecmp (cur, "sip:", 4) || - !g_ascii_strncasecmp (cur, "webcal:", 7)) { + if (!g_ascii_strncasecmp ((char *)cur, "http://", 7) || + !g_ascii_strncasecmp ((char *)cur, "https://", 8) || + !g_ascii_strncasecmp ((char *)cur, "ftp://", 6) || + !g_ascii_strncasecmp ((char *)cur, "nntp://", 7) || + !g_ascii_strncasecmp ((char *)cur, "mailto:", 7) || + !g_ascii_strncasecmp ((char *)cur, "news:", 5) || + !g_ascii_strncasecmp ((char *)cur, "file:", 5) || + !g_ascii_strncasecmp ((char *)cur, "callto:", 7) || + !g_ascii_strncasecmp ((char *)cur, "h323:", 5) || + !g_ascii_strncasecmp ((char *)cur, "sip:", 4) || + !g_ascii_strncasecmp ((char *)cur, "webcal:", 7)) { tmpurl = url_extract (&cur, TRUE); if (tmpurl) { refurl = e_text_to_html (tmpurl, 0); dispurl = g_strdup (refurl); } - } else if (!g_ascii_strncasecmp (cur, "www.", 4) && + } else if (!g_ascii_strncasecmp ((char *)cur, "www.", 4) && is_url_char (*(cur + 4))) { tmpurl = url_extract (&cur, FALSE); if (tmpurl) { @@ -305,7 +305,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) if (!*cur) break; - u = g_utf8_get_char (cur); + u = g_utf8_get_char ((char *)cur); } if (u == '@' && (flags & E_TEXT_TO_HTML_CONVERT_ADDRESSES)) { @@ -325,7 +325,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) if (!*cur) break; - u = g_utf8_get_char (cur); + u = g_utf8_get_char ((char *)cur); } } @@ -336,7 +336,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) u = *cur; next = cur + 1; } else - next = g_utf8_next_char (cur); + next = (const unsigned char *)g_utf8_next_char (cur); out = check_size (&buffer, &buffer_size, out, 10); diff --git a/e-util/e-import.c b/e-util/e-import.c index 5a8ad50f0c..733269930d 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -491,7 +491,7 @@ emph_construct_importer(EPluginHook *eph, xmlNodePtr root) d(printf(" loading import item\n")); item = g_malloc0(sizeof(*item)); - tmp = xmlGetProp(root, "target"); + tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -542,7 +542,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "importer") == 0) { + if (strcmp((char *)node->name, "importer") == 0) { struct _EImportHookImporter *ihook; ihook = emph_construct_importer(eph, node); diff --git a/e-util/e-menu.c b/e-util/e-menu.c index 7a53c7d4e8..d7937a9a8c 100644 --- a/e-util/e-menu.c +++ b/e-util/e-menu.c @@ -757,7 +757,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) menu = g_malloc0(sizeof(*menu)); menu->hook = (EMenuHook *)eph; - tmp = xmlGetProp(root, "target"); + tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -774,14 +774,14 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) } node = root->children; while (node) { - if (0 == strcmp(node->name, "item")) { + if (0 == strcmp((char *)node->name, "item")) { struct _EMenuItem *item; item = emph_construct_item(eph, menu, node, map); if (item) menu->items = g_slist_append(menu->items, item); - } else if (0 == strcmp(node->name, "ui")) { - tmp = xmlGetProp(node, "file"); + } else if (0 == strcmp((char *)node->name, "ui")) { + tmp = (char *)xmlGetProp(node, (const unsigned char *)"file"); if (tmp) { EMenuUIFile *ui = g_malloc0(sizeof(*ui)); @@ -801,7 +801,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) ui->appname = g_strdup("Evolution"); menu->uis = g_slist_append(menu->uis, ui); } - } else if (0 == strcmp(node->name, "pixmap")) { + } else if (0 == strcmp((char *)node->name, "pixmap")) { struct _EMenuPixmap *pixmap; pixmap = emph_construct_pixmap(eph, menu, node); @@ -836,7 +836,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "menu") == 0) { + if (strcmp((char *)node->name, "menu") == 0) { struct _EMenuHookMenu *menu; menu = emph_construct_menu(eph, node); diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c index 533c2f3de7..85b9309191 100644 --- a/e-util/e-pilot-map.c +++ b/e-util/e-pilot-map.c @@ -95,7 +95,7 @@ map_set_node_timet (xmlNodePtr node, const char *name, time_t t) char *tstring; tstring = g_strdup_printf ("%ld", t); - xmlSetProp (node, name, tstring); + xmlSetProp (node, (unsigned char *)name, (unsigned char *)tstring); g_free (tstring); } @@ -105,19 +105,19 @@ map_sax_start_element (void *data, const xmlChar *name, { EPilotMap *map = (EPilotMap *)data; - if (!strcmp (name, "PilotMap")) { + if (!strcmp ((char *)name, "PilotMap")) { while (attrs && *attrs != NULL) { const xmlChar **val = attrs; val++; - if (!strcmp (*attrs, "timestamp")) - map->since = (time_t)strtoul (*val, NULL, 0); + if (!strcmp ((char *)*attrs, "timestamp")) + map->since = (time_t)strtoul ((char *)*val, NULL, 0); attrs = ++val; } } - if (!strcmp (name, "map")) { + if (!strcmp ((char *)name, "map")) { const char *uid = NULL; guint32 pid = 0; gboolean archived = FALSE; @@ -126,14 +126,14 @@ map_sax_start_element (void *data, const xmlChar *name, const xmlChar **val = attrs; val++; - if (!strcmp (*attrs, "uid")) - uid = *val; + if (!strcmp ((char *)*attrs, "uid")) + uid = (char *)*val; - if (!strcmp (*attrs, "pilot_id")) - pid = strtoul (*val, NULL, 0); + if (!strcmp ((char *)*attrs, "pilot_id")) + pid = strtoul ((char *)*val, NULL, 0); - if (!strcmp (*attrs, "archived")) - archived = strtoul (*val, NULL, 0)== 1 ? TRUE : FALSE; + if (!strcmp ((char *)*attrs, "archived")) + archived = strtoul ((char *)*val, NULL, 0)== 1 ? TRUE : FALSE; attrs = ++val; } @@ -157,18 +157,18 @@ map_write_foreach (gpointer key, gpointer value, gpointer data) if (wd->touched_only && !unode->touched) return; - mnode = xmlNewChild (root, NULL, "map", NULL); - xmlSetProp (mnode, "uid", uid); + mnode = xmlNewChild (root, NULL, (const unsigned char *)"map", NULL); + xmlSetProp (mnode, (const unsigned char *)"uid", (unsigned char *)uid); if (unode->archived) { - xmlSetProp (mnode, "archived", "1"); + xmlSetProp (mnode, (const unsigned char *)"archived", (const unsigned char *)"1"); } else { char *pidstr; pidstr = g_strdup_printf ("%d", unode->pid); - xmlSetProp (mnode, "pilot_id", pidstr); + xmlSetProp (mnode, (const unsigned char *)"pilot_id", (unsigned char *)pidstr); g_free (pidstr); - xmlSetProp (mnode, "archived", "0"); + xmlSetProp (mnode, (const unsigned char *)"archived", (const unsigned char *)"0"); } } @@ -390,12 +390,12 @@ e_pilot_map_write (const char *filename, EPilotMap *map) g_return_val_if_fail (filename != NULL, -1); g_return_val_if_fail (map != NULL, -1); - doc = xmlNewDoc ("1.0"); + doc = xmlNewDoc ((const unsigned char *)"1.0"); if (doc == NULL) { g_warning ("Pilot map file could not be created\n"); return -1; } - xmlDocSetRootElement (doc, xmlNewDocNode(doc, NULL, "PilotMap", NULL)); + xmlDocSetRootElement (doc, xmlNewDocNode(doc, NULL, (const unsigned char *)"PilotMap", NULL)); map->since = time (NULL); map_set_node_timet (xmlDocGetRootElement (doc), "timestamp", map->since); diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index b645524569..cb0364d6be 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -163,7 +163,7 @@ ep_construct(EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "hook") == 0) { + if (strcmp((char *)node->name, "hook") == 0) { struct _EPluginHook *hook; EPluginHookClass *type; char *class = e_plugin_xml_prop(node, "class"); @@ -203,9 +203,9 @@ ep_construct(EPlugin *ep, xmlNodePtr root) g_hash_table_insert(ep_plugins_pending_hooks, oldclass, l); ep->hooks_pending = g_slist_prepend(ep->hooks_pending, node); } - } else if (strcmp(node->name, "description") == 0) { + } else if (strcmp((char *)node->name, "description") == 0) { ep->description = e_plugin_xml_content_domain(node, ep->domain); - } else if (strcmp(node->name, "author") == 0) { + } else if (strcmp((char *)node->name, "author") == 0) { char *name = e_plugin_xml_prop(node, "name"); char *email = e_plugin_xml_prop(node, "email"); @@ -334,7 +334,7 @@ ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) return NULL; } - prop = xmlGetProp(root, "type"); + prop = (char *)xmlGetProp(root, (const unsigned char *)"type"); if (prop == NULL) { g_free(id); g_warning("Invalid e-plugin entry in '%s': no type", pdoc->filename); @@ -378,7 +378,7 @@ ep_load(const char *filename) return -1; root = xmlDocGetRootElement(doc); - if (strcmp(root->name, "e-plugin-list") != 0) { + if (strcmp((char *)root->name, "e-plugin-list") != 0) { g_warning("No <e-plugin-list> root element: %s", filename); xmlFreeDoc(doc); return -1; @@ -389,7 +389,7 @@ ep_load(const char *filename) pdoc->filename = g_strdup(filename); for (root = root->children; root ; root = root->next) { - if (strcmp(root->name, "e-plugin") == 0) { + if (strcmp((char *)root->name, "e-plugin") == 0) { ep = ep_load_plugin(root, pdoc); if (ep) { pdoc->plugin_hooks = g_slist_prepend(pdoc->plugin_hooks, ep); @@ -430,7 +430,7 @@ ep_load_pending(EPlugin *ep, EPluginHookClass *type) while (l) { GSList *n = l->next; xmlNodePtr node = l->data; - char *class = xmlGetProp(node, "class"); + char *class = (char *)xmlGetProp(node, (const unsigned char *)"class"); EPluginHook *hook; phd(printf(" checking pending hook '%s'\n", class?class:"<unknown>")); @@ -570,7 +570,7 @@ e_plugin_register_type(GType type) xmlNodePtr root = l->data; char *prop_type; - prop_type = xmlGetProp(root, "type"); + prop_type = (char *)xmlGetProp(root, (const unsigned char *)"type"); if (!strcmp((char *)type, klass->type)) add = g_slist_append(add, l->data); xmlFree(prop_type); @@ -696,7 +696,7 @@ e_plugin_enable(EPlugin *ep, int state) char * e_plugin_xml_prop(xmlNodePtr node, const char *id) { - char *p = xmlGetProp(node, id); + char *p = (char *)xmlGetProp(node, (const unsigned char *)id); if (g_mem_is_system_malloc()) { return p; @@ -726,7 +726,7 @@ e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain) { char *p, *out; - p = xmlGetProp(node, id); + p = (char *)xmlGetProp(node, (const unsigned char *)id); if (p == NULL) return NULL; @@ -752,7 +752,7 @@ e_plugin_xml_prop_domain(xmlNodePtr node, const char *id, const char *domain) int e_plugin_xml_int(xmlNodePtr node, const char *id, int def) { - char *p = xmlGetProp(node, id); + char *p = (char *)xmlGetProp(node, (const unsigned char *)id); if (p) return atoi(p); @@ -773,7 +773,7 @@ e_plugin_xml_int(xmlNodePtr node, const char *id, int def) char * e_plugin_xml_content(xmlNodePtr node) { - char *p = xmlNodeGetContent(node); + char *p = (char *)xmlNodeGetContent(node); if (g_mem_is_system_malloc()) { return p; @@ -802,7 +802,7 @@ e_plugin_xml_content_domain(xmlNodePtr node, const char *domain) { char *p, *out; - p = xmlNodeGetContent(node); + p = (char *)xmlNodeGetContent(node); if (p == NULL) return NULL; @@ -900,7 +900,7 @@ epl_construct(EPlugin *ep, xmlNodePtr root) if (ep->enabled) { xmlChar *tmp; - tmp = xmlGetProp(root, "load-on-startup"); + tmp = xmlGetProp(root, (const unsigned char *)"load-on-startup"); if (tmp) { xmlFree(tmp); if (epl_loadmodule(ep) != 0) @@ -1156,7 +1156,7 @@ e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, con char *val, *p, *start, c; guint32 mask = 0; - val = xmlGetProp(root, prop); + val = (char *)xmlGetProp(root, (const unsigned char *)prop); if (val == NULL) return 0; @@ -1207,7 +1207,7 @@ e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const char *val; int i; - val = xmlGetProp(root, prop); + val = (char *)xmlGetProp(root, (const unsigned char *)prop); if (val == NULL) return ~0; @@ -1256,7 +1256,7 @@ epth_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "plugin-type") == 0) { + if (strcmp((char *)node->name, "plugin-type") == 0) { epth->get_type = e_plugin_xml_prop(node, "get-type"); /* We need to run this in an idle handler, * since at this point the parent EPlugin wont diff --git a/e-util/e-popup.c b/e-util/e-popup.c index 602d59841e..f9ea13e0d9 100644 --- a/e-util/e-popup.c +++ b/e-util/e-popup.c @@ -807,7 +807,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) menu = g_malloc0(sizeof(*menu)); menu->hook = (EPopupHook *)eph; - tmp = xmlGetProp(root, "target"); + tmp = (char *)xmlGetProp(root, (const unsigned char *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup(klass->target_map, tmp); @@ -827,7 +827,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) node = root->children; while (node) { - if (0 == strcmp(node->name, "item")) { + if (0 == strcmp((char *)node->name, "item")) { struct _EPopupItem *item; item = emph_construct_item(eph, menu, node, map); @@ -858,7 +858,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) node = root->children; while (node) { - if (strcmp(node->name, "menu") == 0) { + if (strcmp((char *)node->name, "menu") == 0) { struct _EPopupHookMenu *menu; menu = emph_construct_menu(eph, node); diff --git a/e-util/e-signature.c b/e-util/e-signature.c index 07fe31de9f..268d4ae09f 100644 --- a/e-util/e-signature.c +++ b/e-util/e-signature.c @@ -144,7 +144,7 @@ xml_set_bool (xmlNodePtr node, const char *name, gboolean *val) gboolean bool; char *buf; - if ((buf = xmlGetProp (node, name))) { + if ((buf = (char *)xmlGetProp (node, (const unsigned char *)name))) { bool = (!strcmp (buf, "true") || !strcmp (buf, "yes")); xmlFree (buf); @@ -162,7 +162,7 @@ xml_set_prop (xmlNodePtr node, const char *name, char **val) { char *buf, *new_val; - buf = xmlGetProp (node, name); + buf = (char *)xmlGetProp (node, (const unsigned char *)name); new_val = g_strdup (buf); xmlFree (buf); @@ -184,7 +184,7 @@ xml_set_content (xmlNodePtr node, char **val) { char *buf, *new_val; - buf = xmlNodeGetContent (node); + buf = (char *)xmlNodeGetContent (node); new_val = g_strdup (buf); xmlFree (buf); @@ -217,11 +217,11 @@ e_signature_uid_from_xml (const char *xml) xmlDocPtr doc; char *uid = NULL; - if (!(doc = xmlParseDoc ((char *) xml))) + if (!(doc = xmlParseDoc ((unsigned char *) xml))) return NULL; node = doc->children; - if (strcmp (node->name, "signature") != 0) { + if (strcmp ((char *)node->name, "signature") != 0) { xmlFreeDoc (doc); return NULL; } @@ -251,11 +251,11 @@ e_signature_set_from_xml (ESignature *signature, const char *xml) gboolean bool; char *buf; - if (!(doc = xmlParseDoc ((char *) xml))) + if (!(doc = xmlParseDoc ((unsigned char *) xml))) return FALSE; node = doc->children; - if (strcmp (node->name, "signature") != 0) { + if (strcmp ((char *)node->name, "signature") != 0) { xmlFreeDoc (doc); return FALSE; } @@ -292,11 +292,11 @@ e_signature_set_from_xml (ESignature *signature, const char *xml) cur = node->children; while (cur) { - if (!strcmp (cur->name, "filename")) { + if (!strcmp ((char *)cur->name, "filename")) { changed |= xml_set_content (cur, &signature->filename); changed |= xml_set_bool (cur, "script", &signature->script); break; - } else if (!strcmp (cur->name, "script")) { + } else if (!strcmp ((char *)cur->name, "script")) { /* this is for handling 1.4 signature script definitions */ changed |= xml_set_content (cur, &signature->filename); if (!signature->script) { @@ -330,29 +330,29 @@ e_signature_to_xml (ESignature *signature) xmlDocPtr doc; int n; - doc = xmlNewDoc ("1.0"); + doc = xmlNewDoc ((const unsigned char *)"1.0"); - root = xmlNewDocNode (doc, NULL, "signature", NULL); + root = xmlNewDocNode (doc, NULL, (const unsigned char *)"signature", NULL); xmlDocSetRootElement (doc, root); - xmlSetProp (root, "name", signature->name); - xmlSetProp (root, "uid", signature->uid); - xmlSetProp (root, "auto", signature->autogen ? "true" : "false"); + xmlSetProp (root, (const unsigned char *)"name", (unsigned char *)signature->name); + xmlSetProp (root, (const unsigned char *)"uid", (unsigned char *)signature->uid); + xmlSetProp (root, (const unsigned char *)"auto", (const unsigned char *)(signature->autogen ? "true" : "false")); if (!signature->autogen) { - xmlSetProp (root, "format", signature->html ? "text/html" : "text/plain"); + xmlSetProp (root, (const unsigned char *)"format", (const unsigned char *)(signature->html ? "text/html" : "text/plain")); if (signature->filename) { - node = xmlNewTextChild (root, NULL, "filename", signature->filename); + node = xmlNewTextChild (root, NULL, (const unsigned char *)"filename", (unsigned char *)signature->filename); if (signature->script) - xmlSetProp (node, "script", "true"); + xmlSetProp (node, (const unsigned char *)"script", (const unsigned char *)"true"); } } else { /* this is to make Evolution-1.4 and older 1.5 versions happy */ - xmlSetProp (root, "format", "text/html"); + xmlSetProp (root, (const unsigned char *)"format", (const unsigned char *)"text/html"); } - xmlDocDumpMemory (doc, (xmlChar **) &xmlbuf, &n); + xmlDocDumpMemory (doc, (xmlChar **)&xmlbuf, &n); xmlFreeDoc (doc); /* remap to glib memory */ diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 7f9f1870c8..08f3043d20 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -76,10 +76,10 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent, } for (child = parent->xmlChildrenNode; child != NULL; child = child->next) { if (xmlStrcmp (child->name, child_name) == 0) { - xmlChar *this_lang = xmlGetProp (child, "lang"); + xmlChar *this_lang = xmlGetProp (child, (const unsigned char *)"lang"); if (this_lang == NULL) { C = child; - } else if (xmlStrcmp(this_lang, lang) == 0) { + } else if (xmlStrcmp(this_lang, (xmlChar *)lang) == 0) { #ifdef G_OS_WIN32 g_free (freeme); #endif @@ -104,10 +104,10 @@ e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent, for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { xmlChar *lang; - if (node->name == NULL || strcmp (node->name, name) != 0) { + if (node->name == NULL || strcmp ((char *)node->name, name) != 0) { continue; } - lang = xmlGetProp (node, "xml:lang"); + lang = xmlGetProp (node, (const unsigned char *)"xml:lang"); if (lang != NULL) { const GList *l; gint i; @@ -115,7 +115,7 @@ e_xml_get_child_by_name_by_lang_list_with_score (const xmlNode *parent, for (l = lang_list, i = 0; l != NULL && i < *best_lang_score; l = l->next, i++) { - if (strcmp ((gchar *) l->data, lang) == 0) { + if (strcmp ((char *) l->data, (char *)lang) == 0) { best_node = node; *best_lang_score = i; } @@ -154,7 +154,7 @@ e_xml_get_child_by_name_by_lang_list (const xmlNode *parent, language_names = g_get_language_names (); while (*language_names != NULL) lang_list = g_list_append ( - lang_list, *language_names++); + (GList *)lang_list, (char *)*language_names++); } return e_xml_get_child_by_name_by_lang_list_with_score (parent,name, @@ -177,10 +177,10 @@ e_xml_get_child_by_name_no_lang (const xmlNode *parent, const gchar *name) for (node = parent->xmlChildrenNode; node != NULL; node = node->next) { xmlChar *lang; - if (node->name == NULL || strcmp (node->name, name) != 0) { + if (node->name == NULL || strcmp ((char *)node->name, name) != 0) { continue; } - lang = xmlGetProp (node, "xml:lang"); + lang = xmlGetProp (node, (const unsigned char *)"xml:lang"); if (lang == NULL) { return node; } @@ -212,7 +212,7 @@ e_xml_get_integer_prop_by_name_with_default (const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - (void) sscanf (prop, "%d", &ret_val); + (void) sscanf ((char *)prop, "%d", &ret_val); xmlFree (prop); } return ret_val; @@ -229,7 +229,7 @@ e_xml_set_integer_prop_by_name (xmlNode *parent, g_return_if_fail (prop_name != NULL); valuestr = g_strdup_printf ("%d", value); - xmlSetProp (parent, prop_name, valuestr); + xmlSetProp (parent, prop_name, (unsigned char *)valuestr); g_free (valuestr); } @@ -255,7 +255,7 @@ e_xml_get_uint_prop_by_name_with_default (const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - (void) sscanf (prop, "%u", &ret_val); + (void) sscanf ((char *)prop, "%u", &ret_val); xmlFree (prop); } return ret_val; @@ -272,7 +272,7 @@ e_xml_set_uint_prop_by_name (xmlNode *parent, g_return_if_fail (prop_name != NULL); valuestr = g_strdup_printf ("%u", value); - xmlSetProp (parent, prop_name, valuestr); + xmlSetProp (parent, prop_name, (unsigned char *)valuestr); g_free (valuestr); } @@ -301,9 +301,9 @@ e_xml_get_bool_prop_by_name_with_default(const xmlNode *parent, prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - if (g_ascii_strcasecmp (prop, "true") == 0) { + if (g_ascii_strcasecmp ((char *)prop, "true") == 0) { ret_val = TRUE; - } else if (g_ascii_strcasecmp (prop, "false") == 0) { + } else if (g_ascii_strcasecmp ((char *)prop, "false") == 0) { ret_val = FALSE; } xmlFree(prop); @@ -318,9 +318,9 @@ e_xml_set_bool_prop_by_name (xmlNode *parent, const xmlChar *prop_name, gboolean g_return_if_fail (prop_name != NULL); if (value) { - xmlSetProp (parent, prop_name, "true"); + xmlSetProp (parent, prop_name, (const unsigned char *)"true"); } else { - xmlSetProp (parent, prop_name, "false"); + xmlSetProp (parent, prop_name, (const unsigned char *)"false"); } } @@ -344,7 +344,7 @@ e_xml_get_double_prop_by_name_with_default (const xmlNode *parent, const xmlChar prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = e_flexible_strtod (prop, NULL); + ret_val = e_flexible_strtod ((char *)prop, NULL); xmlFree (prop); } return ret_val; @@ -367,7 +367,7 @@ e_xml_set_double_prop_by_name(xmlNode *parent, const xmlChar *prop_name, gdouble e_ascii_dtostr (buffer, sizeof (buffer), format, value); g_free (format); - xmlSetProp (parent, prop_name, buffer); + xmlSetProp (parent, prop_name, (const unsigned char *)buffer); } gchar * @@ -390,7 +390,7 @@ e_xml_get_string_prop_by_name_with_default (const xmlNode *parent, const xmlChar prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = g_strdup (prop); + ret_val = g_strdup ((char *)prop); xmlFree (prop); } else { ret_val = g_strdup (def); @@ -405,7 +405,7 @@ e_xml_set_string_prop_by_name (xmlNode *parent, const xmlChar *prop_name, const g_return_if_fail (prop_name != NULL); if (value != NULL) { - xmlSetProp (parent, prop_name, value); + xmlSetProp (parent, prop_name, (unsigned char *)value); } } @@ -421,15 +421,15 @@ e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar * prop = xmlGetProp ((xmlNode *) parent, prop_name); if (prop != NULL) { - ret_val = g_strdup (prop); + ret_val = g_strdup ((char *)prop); xmlFree (prop); return ret_val; } combined_name = g_strdup_printf("_%s", prop_name); - prop = xmlGetProp ((xmlNode *) parent, combined_name); + prop = xmlGetProp ((xmlNode *) parent, (unsigned char *)combined_name); if (prop != NULL) { - ret_val = g_strdup (gettext(prop)); + ret_val = g_strdup (gettext((char *)prop)); xmlFree (prop); } g_free(combined_name); |