diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2007-06-03 10:00:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-06-03 10:00:45 +0800 |
commit | 677df14504c5ad80efbb417c6ceea8d8494e583d (patch) | |
tree | afc5cbc68e6029b5bea0a79c4e42a3f621ba929e | |
parent | 187e0c0464e1db79762e2c80b0301eccb3312bad (diff) | |
download | gsoc2013-evolution-677df14504c5ad80efbb417c6ceea8d8494e583d.tar.gz gsoc2013-evolution-677df14504c5ad80efbb417c6ceea8d8494e583d.tar.zst gsoc2013-evolution-677df14504c5ad80efbb417c6ceea8d8494e583d.zip |
Fix compilation warnings in filter directory (#439118).
svn path=/trunk/; revision=33624
-rw-r--r-- | filter/ChangeLog | 19 | ||||
-rw-r--r-- | filter/filter-code.c | 2 | ||||
-rw-r--r-- | filter/filter-colour.c | 26 | ||||
-rw-r--r-- | filter/filter-datespec.c | 26 | ||||
-rw-r--r-- | filter/filter-element.c | 2 | ||||
-rw-r--r-- | filter/filter-file.c | 20 | ||||
-rw-r--r-- | filter/filter-input.c | 22 | ||||
-rw-r--r-- | filter/filter-int.c | 14 | ||||
-rw-r--r-- | filter/filter-option.c | 28 | ||||
-rw-r--r-- | filter/filter-part.c | 22 | ||||
-rw-r--r-- | filter/filter-rule.c | 40 | ||||
-rw-r--r-- | filter/rule-context.c | 16 |
12 files changed, 128 insertions, 109 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 93dc9c20cd..31a18c3656 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,22 @@ +2007-05-17 Gilles Dartiguelongue <dartigug@esiee.fr> + + ** Fixes bug #439118 + + * filter-code.c: (filter_code_init): + * filter-colour.c: (xml_encode), (xml_decode): + * filter-datespec.c: (xml_encode), (xml_decode): + * filter-element.c: (xml_create): + * filter-file.c: (filter_file_new_type_name), (xml_encode), + (xml_decode): + * filter-input.c: (filter_input_new_type_name), (xml_encode), + (xml_decode): + * filter-int.c: (xml_encode), (xml_decode): + * filter-option.c: (xml_create), (xml_encode), (xml_decode): + * filter-part.c: (filter_part_xml_create), + (filter_part_xml_encode), (filter_part_xml_decode): + * filter-rule.c: (xml_encode), (load_set), (xml_decode): + * rule-context.c: (load), (save), (revert): fix compilation warnings + 2007-05-11 Srinivasa Ragavan <sragavan@novell.com> ** Patch from Trever Adams for bug #211058 diff --git a/filter/filter-code.c b/filter/filter-code.c index 7b308506cc..613816e7d6 100644 --- a/filter/filter-code.c +++ b/filter/filter-code.c @@ -80,7 +80,7 @@ filter_code_class_init (FilterCodeClass *klass) static void filter_code_init (FilterCode *fc) { - ((FilterInput *) fc)->type = xmlStrdup ("code"); + ((FilterInput *) fc)->type = (char *)xmlStrdup ((const unsigned char *)"code"); } static void diff --git a/filter/filter-colour.c b/filter/filter-colour.c index 97a343bc63..c674928109 100644 --- a/filter/filter-colour.c +++ b/filter/filter-colour.c @@ -144,10 +144,10 @@ xml_encode (FilterElement *fe) g_snprintf (spec, sizeof (spec), "#%04x%04x%04x", fc->color.red, fc->color.green, fc->color.blue); - value = xmlNewNode(NULL, "value"); - xmlSetProp(value, "name", fe->name); - xmlSetProp(value, "type", "colour"); - xmlSetProp(value, "spec", spec); + value = xmlNewNode(NULL, (const unsigned char *)"value"); + xmlSetProp(value, (const unsigned char *)"type", (const unsigned char *)"colour"); + xmlSetProp(value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp(value, (const unsigned char *)"spec", (unsigned char *)spec); return value; } @@ -159,22 +159,22 @@ xml_decode (FilterElement *fe, xmlNodePtr node) xmlChar *prop; xmlFree (fe->name); - fe->name = xmlGetProp(node, "name"); + fe->name = (char *)xmlGetProp(node, (const unsigned char *)"name"); - prop = xmlGetProp(node, "spec"); + prop = xmlGetProp(node, (const unsigned char *)"spec"); if (prop != NULL) { - gdk_color_parse(prop, &fc->color); + gdk_color_parse((char *)prop, &fc->color); xmlFree (prop); } else { /* try reading the old RGB properties */ - prop = xmlGetProp(node, "red"); - sscanf(prop, "%" G_GINT16_MODIFIER "x", &fc->color.red); + prop = xmlGetProp(node, (const unsigned char *)"red"); + sscanf((char *)prop, "%" G_GINT16_MODIFIER "x", &fc->color.red); xmlFree (prop); - prop = xmlGetProp(node, "green"); - sscanf(prop, "%" G_GINT16_MODIFIER "x", &fc->color.green); + prop = xmlGetProp(node, (const unsigned char *)"green"); + sscanf((char *)prop, "%" G_GINT16_MODIFIER "x", &fc->color.green); xmlFree (prop); - prop = xmlGetProp(node, "blue"); - sscanf(prop, "%" G_GINT16_MODIFIER "x", &fc->color.blue); + prop = xmlGetProp(node, (const unsigned char *)"blue"); + sscanf((char *)prop, "%" G_GINT16_MODIFIER "x", &fc->color.blue); xmlFree (prop); } diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c index f8bceb3e6a..53a03c8387 100644 --- a/filter/filter-datespec.c +++ b/filter/filter-datespec.c @@ -220,15 +220,15 @@ xml_encode (FilterElement *fe) d(printf ("Encoding datespec as xml\n")); - value = xmlNewNode (NULL, "value"); - xmlSetProp (value, "name", fe->name); - xmlSetProp (value, "type", "datespec"); + value = xmlNewNode (NULL, (const unsigned char *)"value"); + xmlSetProp (value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp (value, (const unsigned char *)"type", (const unsigned char *)"datespec"); - work = xmlNewChild (value, NULL, "datespec", NULL); + work = xmlNewChild (value, NULL, (const unsigned char *)"datespec", NULL); sprintf (str, "%d", fds->type); - xmlSetProp (work, "type", str); + xmlSetProp (work, (const unsigned char *)"type", (unsigned char *)str); sprintf (str, "%d", (int)fds->value); - xmlSetProp (work, "value", str); + xmlSetProp (work, (const unsigned char *)"value", (unsigned char *)str); return value; } @@ -238,21 +238,21 @@ xml_decode (FilterElement *fe, xmlNodePtr node) { FilterDatespec *fds = (FilterDatespec *)fe; xmlNodePtr n; - char *val; + xmlChar *val; d(printf ("Decoding datespec from xml %p\n", fe)); xmlFree (fe->name); - fe->name = xmlGetProp (node, "name"); + fe->name = (char *)xmlGetProp (node, (const unsigned char *)"name"); n = node->children; while (n) { - if (!strcmp (n->name, "datespec")) { - val = xmlGetProp (n, "type"); - fds->type = atoi (val); + if (!strcmp ((char *)n->name, "datespec")) { + val = xmlGetProp (n, (const unsigned char *)"type"); + fds->type = atoi ((char *)val); xmlFree (val); - val = xmlGetProp (n, "value"); - fds->value = atoi (val); + val = xmlGetProp (n, (const unsigned char *)"value"); + fds->value = atoi ((char *)val); xmlFree (val); break; } diff --git a/filter/filter-element.c b/filter/filter-element.c index 60ca789a69..cefe8320e8 100644 --- a/filter/filter-element.c +++ b/filter/filter-element.c @@ -254,7 +254,7 @@ element_eq (FilterElement *fe, FilterElement *cm) static void xml_create (FilterElement *fe, xmlNodePtr node) { - fe->name = xmlGetProp (node, "name"); + fe->name = (char *)xmlGetProp (node, (const unsigned char *)"name"); } static FilterElement * diff --git a/filter/filter-file.c b/filter/filter-file.c index 99e011f077..f72f53dd08 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -140,7 +140,7 @@ filter_file_new_type_name (const char *type) FilterFile *file; file = filter_file_new (); - file->type = xmlStrdup (type); + file->type = (char *)xmlStrdup ((xmlChar *)type); return file; } @@ -218,12 +218,12 @@ xml_encode (FilterElement *fe) d(printf ("Encoding %s as xml\n", type)); - value = xmlNewNode (NULL, "value"); - xmlSetProp (value, "name", fe->name); - xmlSetProp (value, "type", type); + value = xmlNewNode (NULL, (const unsigned char *)"value"); + xmlSetProp (value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp (value, (const unsigned char *)"type", (unsigned char *)type); - cur = xmlNewChild (value, NULL, type, NULL); - xmlNodeSetContent (cur, file->path); + cur = xmlNewChild (value, NULL, (unsigned char *)type, NULL); + xmlNodeSetContent (cur, (unsigned char *)file->path); return value; } @@ -235,8 +235,8 @@ xml_decode (FilterElement *fe, xmlNodePtr node) char *name, *str, *type; xmlNodePtr n; - name = xmlGetProp (node, "name"); - type = xmlGetProp (node, "type"); + name = (char *)xmlGetProp (node, (const unsigned char *)"name"); + type = (char *)xmlGetProp (node, (const unsigned char *)"type"); d(printf("Decoding %s from xml %p\n", type, fe)); d(printf ("Name = %s\n", name)); @@ -251,8 +251,8 @@ xml_decode (FilterElement *fe, xmlNodePtr node) n = node->children; while (n != NULL) { - if (!strcmp (n->name, type)) { - str = xmlNodeGetContent (n); + if (!strcmp ((char *)n->name, type)) { + str = (char *)xmlNodeGetContent (n); file->path = g_strdup (str ? str : ""); xmlFree (str); diff --git a/filter/filter-input.c b/filter/filter-input.c index de690b2f55..733ed0d9ea 100644 --- a/filter/filter-input.c +++ b/filter/filter-input.c @@ -137,7 +137,7 @@ filter_input_new_type_name (const char *type) FilterInput *fi; fi = filter_input_new (); - fi->type = xmlStrdup (type); + fi->type = (char *)xmlStrdup ((xmlChar *)type); d(printf("new type %s = %p\n", type, fi)); @@ -243,15 +243,15 @@ xml_encode (FilterElement *fe) d(printf ("Encoding %s as xml\n", type)); - value = xmlNewNode (NULL, "value"); - xmlSetProp (value, "name", fe->name); - xmlSetProp (value, "type", type); + value = xmlNewNode (NULL, (const unsigned char *)"value"); + xmlSetProp (value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp (value, (const unsigned char *)"type", (unsigned char *)type); l = fi->values; while (l) { xmlNodePtr cur; - char *str = l->data; + xmlChar *str = l->data; - cur = xmlNewChild (value, NULL, type, NULL); + cur = xmlNewChild (value, NULL, (unsigned char *)type, NULL); str = xmlEncodeEntitiesReentrant (NULL, str); xmlNodeSetContent (cur, str); @@ -279,8 +279,8 @@ xml_decode (FilterElement *fe, xmlNodePtr node) g_list_free (fi->values); fi->values = NULL; - name = xmlGetProp (node, "name"); - type = xmlGetProp (node, "type"); + name = (char *)xmlGetProp (node, (const unsigned char *)"name"); + type = (char *)xmlGetProp (node, (const unsigned char *)"type"); d(printf("Decoding %s from xml %p\n", type, fe)); d(printf ("Name = %s\n", name)); @@ -290,9 +290,9 @@ xml_decode (FilterElement *fe, xmlNodePtr node) fi->type = type; n = node->children; while (n) { - if (!strcmp (n->name, type)) { - if (!(str = xmlNodeGetContent (n))) - str = xmlStrdup (""); + if (!strcmp ((char *)n->name, type)) { + if (!(str = (char *)xmlNodeGetContent (n))) + str = (char *)xmlStrdup ((const unsigned char *)""); d(printf (" '%s'\n", str)); fi->values = g_list_append (fi->values, g_strdup (str)); diff --git a/filter/filter-int.c b/filter/filter-int.c index eb14eaa695..873e6a4a33 100644 --- a/filter/filter-int.c +++ b/filter/filter-int.c @@ -184,12 +184,12 @@ xml_encode (FilterElement *fe) d(printf("Encoding %s as xml\n", type)); - value = xmlNewNode (NULL, "value"); - xmlSetProp (value, "name", fe->name); - xmlSetProp (value, "type", type); + value = xmlNewNode (NULL, (const unsigned char *)"value"); + xmlSetProp (value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp (value, (const unsigned char *)"type", (unsigned char *)type); sprintf(intval, "%d", fs->val); - xmlSetProp (value, type, intval); + xmlSetProp (value, (unsigned char *)type, (unsigned char *)intval); return value; } @@ -203,18 +203,18 @@ xml_decode (FilterElement *fe, xmlNodePtr node) d(printf("Decoding integer from xml %p\n", fe)); - name = xmlGetProp (node, "name"); + name = (char *)xmlGetProp (node, (const unsigned char *)"name"); d(printf ("Name = %s\n", name)); xmlFree (fe->name); fe->name = name; - type = xmlGetProp(node, "type"); + type = (char *)xmlGetProp(node, (const unsigned char *)"type"); d(printf ("Type = %s\n", type)); g_free(fs->type); fs->type = g_strdup(type); xmlFree(type); - intval = xmlGetProp (node, fs->type ? fs->type : "integer"); + intval = (char *)xmlGetProp (node, (unsigned char *)(fs->type ? fs->type : "integer")); if (intval) { d(printf ("Value = %s\n", intval)); fs->val = atoi (intval); diff --git a/filter/filter-option.c b/filter/filter-option.c index 79878711dc..2c8ca43829 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -204,24 +204,24 @@ xml_create (FilterElement *fe, xmlNodePtr node) n = node->children; while (n) { - if (!strcmp (n->name, "option")) { + if (!strcmp ((char *)n->name, "option")) { char *tmp, *value, *title = NULL, *code = NULL; - value = xmlGetProp (n, "value"); + value = (char *)xmlGetProp (n, (const unsigned char *)"value"); work = n->children; while (work) { - if (!strcmp (work->name, "title")) { + if (!strcmp ((char *)work->name, "title")) { if (!title) { - if (!(tmp = xmlNodeGetContent (work))) - tmp = xmlStrdup (""); + if (!(tmp = (char *)xmlNodeGetContent (work))) + tmp = (char *)xmlStrdup ((const unsigned char *)""); title = g_strdup (tmp); xmlFree (tmp); } - } else if (!strcmp (work->name, "code")) { + } else if (!strcmp ((char *)work->name, "code")) { if (!code) { - if (!(tmp = xmlNodeGetContent (work))) - tmp = xmlStrdup (""); + if (!(tmp = (char*)xmlNodeGetContent (work))) + tmp = (char *)xmlStrdup ((const unsigned char *)""); code = g_strdup (tmp); xmlFree (tmp); @@ -248,11 +248,11 @@ xml_encode (FilterElement *fe) FilterOption *fo = (FilterOption *)fe; d(printf ("Encoding option as xml\n")); - value = xmlNewNode (NULL, "value"); - xmlSetProp (value, "name", fe->name); - xmlSetProp (value, "type", fo->type); + value = xmlNewNode (NULL, (const unsigned char *)"value"); + xmlSetProp (value, (const unsigned char *)"name", (unsigned char *)fe->name); + xmlSetProp (value, (const unsigned char *)"type", (unsigned char *)fo->type); if (fo->current) - xmlSetProp (value, "value", fo->current->value); + xmlSetProp (value, (const unsigned char *)"value", (unsigned char *)fo->current->value); return value; } @@ -265,8 +265,8 @@ xml_decode (FilterElement *fe, xmlNodePtr node) d(printf ("Decoding option from xml\n")); xmlFree (fe->name); - fe->name = xmlGetProp (node, "name"); - value = xmlGetProp (node, "value"); + fe->name = (char *)xmlGetProp (node, (const unsigned char *)"name"); + value = (char *)xmlGetProp (node, (const unsigned char *)"value"); if (value) { fo->current = find_option (fo, value); xmlFree (value); diff --git a/filter/filter-part.c b/filter/filter-part.c index 3f1b19b542..6756674f0b 100644 --- a/filter/filter-part.c +++ b/filter/filter-part.c @@ -170,15 +170,15 @@ filter_part_xml_create (FilterPart *ff, xmlNodePtr node, RuleContext *rc) char *type, *str; FilterElement *el; - str = xmlGetProp (node, "name"); + str = (char *)xmlGetProp (node, (const unsigned char *)"name"); ff->name = g_strdup (str); if (str) xmlFree (str); n = node->children; while (n) { - if (!strcmp (n->name, "input")) { - type = xmlGetProp (n, "type"); + if (!strcmp ((char *)n->name, "input")) { + type = (char *)xmlGetProp (n, (const unsigned char *)"type"); d(printf ("creating new element type input '%s'\n", type)); if (type != NULL && (el = rule_context_new_element(rc, type)) != NULL) { @@ -189,16 +189,16 @@ filter_part_xml_create (FilterPart *ff, xmlNodePtr node, RuleContext *rc) } else { g_warning ("Invalid xml format, missing/unknown input type"); } - } else if (!strcmp (n->name, "title")) { + } else if (!strcmp ((char *)n->name, "title")) { if (!ff->title) { - str = xmlNodeGetContent (n); + str = (char *)xmlNodeGetContent (n); ff->title = g_strdup (str); if (str) xmlFree (str); } - } else if (!strcmp (n->name, "code")) { + } else if (!strcmp ((char *)n->name, "code")) { if (!ff->code) { - str = xmlNodeGetContent (n); + str = (char *)xmlNodeGetContent (n); ff->code = g_strdup (str); if (str) xmlFree (str); @@ -221,8 +221,8 @@ filter_part_xml_encode (FilterPart *fp) g_return_val_if_fail (fp != NULL, NULL); - part = xmlNewNode (NULL, "part"); - xmlSetProp (part, "name", fp->name); + part = xmlNewNode (NULL, (const unsigned char *)"part"); + xmlSetProp (part, (const unsigned char *)"name", (unsigned char *)fp->name); l = fp->elements; while (l) { fe = l->data; @@ -247,8 +247,8 @@ filter_part_xml_decode (FilterPart *fp, xmlNodePtr node) n = node->children; while (n) { - if (!strcmp (n->name, "value")) { - name = xmlGetProp (n, "name"); + if (!strcmp ((char *)n->name, "value")) { + name = (char *)xmlGetProp (n, (const unsigned char *)"name"); d(printf ("finding element part %p %s = %p\n", name, name, fe)); fe = filter_part_find_element (fp, name); d(printf ("finding element part %p %s = %p\n", name, name, fe)); diff --git a/filter/filter-rule.c b/filter/filter-rule.c index c5c8dbce03..3c0b9be9f6 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -280,13 +280,13 @@ xml_encode (FilterRule *fr) xmlNodePtr node, set, work; GList *l; - node = xmlNewNode (NULL, "rule"); + node = xmlNewNode (NULL, (const unsigned char *)"rule"); switch (fr->grouping) { case FILTER_GROUP_ALL: - xmlSetProp (node, "grouping", "all"); + xmlSetProp (node, (const unsigned char *)"grouping", (const unsigned char *)"all"); break; case FILTER_GROUP_ANY: - xmlSetProp (node, "grouping", "any"); + xmlSetProp (node, (const unsigned char *)"grouping", (const unsigned char *)"any"); break; } @@ -294,33 +294,33 @@ xml_encode (FilterRule *fr) case FILTER_THREAD_NONE: break; case FILTER_THREAD_ALL: - xmlSetProp(node, "threading", "all"); + xmlSetProp(node, (const unsigned char *)"threading", (const unsigned char *)"all"); break; case FILTER_THREAD_REPLIES: - xmlSetProp(node, "threading", "replies"); + xmlSetProp(node, (const unsigned char *)"threading", (const unsigned char *)"replies"); break; case FILTER_THREAD_REPLIES_PARENTS: - xmlSetProp(node, "threading", "replies_parents"); + xmlSetProp(node, (const unsigned char *)"threading", (const unsigned char *)"replies_parents"); break; case FILTER_THREAD_SINGLE: - xmlSetProp(node, "threading", "single"); + xmlSetProp(node, (const unsigned char *)"threading", (const unsigned char *)"single"); break; } if (fr->source) { - xmlSetProp (node, "source", fr->source); + xmlSetProp (node, (const unsigned char *)"source", (unsigned char *)fr->source); } else { /* set to the default filter type */ - xmlSetProp (node, "source", "incoming"); + xmlSetProp (node, (const unsigned char *)"source", (const unsigned char *)"incoming"); } if (fr->name) { - work = xmlNewNode (NULL, "title"); - xmlNodeSetContent (work, fr->name); + work = xmlNewNode (NULL, (const unsigned char *)"title"); + xmlNodeSetContent (work, (unsigned char *)fr->name); xmlAddChild (node, work); } - set = xmlNewNode (NULL, "partset"); + set = xmlNewNode (NULL, (const unsigned char *)"partset"); xmlAddChild (node, set); l = fr->parts; while (l) { @@ -341,8 +341,8 @@ load_set (xmlNodePtr node, FilterRule *fr, RuleContext *f) work = node->children; while (work) { - if (!strcmp (work->name, "part")) { - rulename = xmlGetProp (work, "name"); + if (!strcmp ((char *)work->name, "part")) { + rulename = (char *)xmlGetProp (work, (const unsigned char *)"name"); part = rule_context_find_part (f, rulename); if (part) { part = filter_part_clone (part); @@ -389,7 +389,7 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f) fr->name = NULL; } - grouping = xmlGetProp (node, "grouping"); + grouping = (char *)xmlGetProp (node, (const unsigned char *)"grouping"); if (!strcmp (grouping, "any")) fr->grouping = FILTER_GROUP_ANY; else @@ -398,7 +398,7 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f) fr->threading = FILTER_THREAD_NONE; if (f->flags & RULE_CONTEXT_THREADING - && (grouping = xmlGetProp (node, "threading"))) { + && (grouping = (char *)xmlGetProp (node, (const unsigned char *)"threading"))) { if (!strcmp(grouping, "all")) fr->threading = FILTER_THREAD_ALL; else if (!strcmp(grouping, "replies")) @@ -411,7 +411,7 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f) } g_free (fr->source); - source = xmlGetProp (node, "source"); + source = (char *)xmlGetProp (node, (const unsigned char *)"source"); if (source) { fr->source = g_strdup (source); xmlFree (source); @@ -422,13 +422,13 @@ xml_decode (FilterRule *fr, xmlNodePtr node, RuleContext *f) work = node->children; while (work) { - if (!strcmp (work->name, "partset")) { + if (!strcmp ((char *)work->name, "partset")) { load_set (work, fr, f); - } else if (!strcmp (work->name, "title") || !strcmp (work->name, "_title")) { + } else if (!strcmp ((char *)work->name, "title") || !strcmp ((char *)work->name, "_title")) { if (!fr->name) { char *str, *decstr; - str = xmlNodeGetContent (work); + str = (char *)xmlNodeGetContent (work); decstr = g_strdup (str); if (str) xmlFree (str); diff --git a/filter/rule-context.c b/filter/rule-context.c index 2334862677..c08bcf1c5e 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -317,7 +317,7 @@ load(RuleContext *rc, const char *system, const char *user) } root = xmlDocGetRootElement(systemdoc); - if (root == NULL || strcmp(root->name, "filterdescription")) { + if (root == NULL || strcmp((char *)root->name, "filterdescription")) { rule_context_set_error(rc, g_strdup_printf("Unable to load system rules '%s': Invalid format", system)); xmlFreeDoc(systemdoc); return -1; @@ -337,7 +337,7 @@ load(RuleContext *rc, const char *system, const char *user) d(printf("loading parts ...\n")); rule = set->children; while (rule) { - if (!strcmp(rule->name, "part")) { + if (!strcmp((char *)rule->name, "part")) { FilterPart *part = FILTER_PART(g_object_new(part_map->type, NULL, NULL)); if (filter_part_xml_create(part, rule, rc) == 0) { @@ -354,7 +354,7 @@ load(RuleContext *rc, const char *system, const char *user) rule = set->children; while (rule) { d(printf("checking node: %s\n", rule->name)); - if (!strcmp(rule->name, "rule")) { + if (!strcmp((char *)rule->name, "rule")) { FilterRule *part = FILTER_RULE(g_object_new(rule_map->type, NULL, NULL)); if (filter_rule_xml_decode(part, rule, rc) == 0) { @@ -383,7 +383,7 @@ load(RuleContext *rc, const char *system, const char *user) rule = set->children; while (rule) { d(printf("checking node: %s\n", rule->name)); - if (!strcmp(rule->name, "rule")) { + if (!strcmp((char *)rule->name, "rule")) { FilterRule *part = FILTER_RULE(g_object_new(rule_map->type, NULL, NULL)); if (filter_rule_xml_decode(part, rule, rc) == 0) { @@ -434,14 +434,14 @@ save(RuleContext *rc, const char *user) struct _rule_set_map *map; int ret; - doc = xmlNewDoc("1.0"); + doc = xmlNewDoc((const unsigned char *)"1.0"); /* FIXME: set character encoding to UTF-8? */ - root = xmlNewDocNode(doc, NULL, "filteroptions", NULL); + root = xmlNewDocNode(doc, NULL, (const unsigned char *)"filteroptions", NULL); xmlDocSetRootElement(doc, root); l = rc->rule_set_list; while (l) { map = l->data; - rules = xmlNewDocNode(doc, NULL, map->name, NULL); + rules = xmlNewDocNode(doc, NULL, (unsigned char *)map->name, NULL); xmlAddChild(root, rules); rule = NULL; while ((rule = map->next(rc, rule, NULL))) { @@ -563,7 +563,7 @@ revert(RuleContext *rc, const char *user) rule = set->children; while (rule) { d(printf("checking node: %s\n", rule->name)); - if (!strcmp(rule->name, "rule")) { + if (!strcmp((char *)rule->name, "rule")) { FilterRule *part = FILTER_RULE(g_object_new(rule_map->type, NULL, NULL)); if (filter_rule_xml_decode(part, rule, rc) == 0) { |