summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-21 10:30:00 +0100
committerLuke from DC <[email protected]>2021-02-25 04:07:11 +0000
commit61ab4b0088628429259810780a7d9360863fe3df (patch)
tree378187421ebc50706ff8b7fab1494896f5e9e0cb /eel
parent8ffff0ec396a40caa9251ac78597ff70ae1df4d1 (diff)
downloadcaja-61ab4b0088628429259810780a7d9360863fe3df.tar.bz2
caja-61ab4b0088628429259810780a7d9360863fe3df.tar.xz
Fix warnings about xmlChar cast
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-xml-extensions.c33
-rw-r--r--eel/eel-xml-extensions.h18
2 files changed, 25 insertions, 26 deletions
diff --git a/eel/eel-xml-extensions.c b/eel/eel-xml-extensions.c
index da2cf6b5..855096c1 100644
--- a/eel/eel-xml-extensions.c
+++ b/eel/eel-xml-extensions.c
@@ -43,25 +43,25 @@ eel_xml_get_children (xmlNodePtr parent)
}
xmlNodePtr
-eel_xml_get_child_by_name_and_property (xmlNodePtr parent,
- const char *child_name,
- const char *property_name,
- const char *property_value)
+eel_xml_get_child_by_name_and_property (xmlNodePtr parent,
+ const xmlChar *child_name,
+ const xmlChar *property_name,
+ const xmlChar *property_value)
{
xmlNodePtr child;
xmlChar *property;
gboolean match;
- if (parent == NULL)
+ if (parent == NULL || property_name == NULL || property_value == NULL)
{
return NULL;
}
- for (child = eel_xml_get_children (parent); child != NULL; child = child->next)
+ for (child = parent->children; child != NULL; child = child->next)
{
- if (strcmp (child->name, child_name) == 0)
+ if (child->name != NULL && xmlStrcmp (child->name, child_name) == 0)
{
property = xmlGetProp (child, property_name);
- match = eel_strcmp (property, property_value) == 0;
+ match = property != NULL && xmlStrcmp (property, property_value) == 0;
xmlFree (property);
if (match)
{
@@ -73,14 +73,13 @@ eel_xml_get_child_by_name_and_property (xmlNodePtr parent,
}
xmlNodePtr
-eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
- const char *child_name,
- const char *property_name,
- const char *property_value)
+eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
+ const xmlChar *child_name,
+ const xmlChar *property_name,
+ const xmlChar *property_value)
{
- return eel_xml_get_child_by_name_and_property
- (xmlDocGetRootElement (document),
- child_name,
- property_name,
- property_value);
+ return eel_xml_get_child_by_name_and_property (xmlDocGetRootElement (document),
+ child_name,
+ property_name,
+ property_value);
}
diff --git a/eel/eel-xml-extensions.h b/eel/eel-xml-extensions.h
index fba9ba57..7e746886 100644
--- a/eel/eel-xml-extensions.h
+++ b/eel/eel-xml-extensions.h
@@ -28,14 +28,14 @@
#include <libxml/tree.h>
#include <glib.h>
-xmlNodePtr eel_xml_get_children (xmlNodePtr parent);
-xmlNodePtr eel_xml_get_child_by_name_and_property (xmlNodePtr parent,
- const char *child_name,
- const char *property_name,
- const char *property_value);
-xmlNodePtr eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
- const char *child_name,
- const char *property_name,
- const char *property_value);
+xmlNodePtr eel_xml_get_children (xmlNodePtr parent);
+xmlNodePtr eel_xml_get_child_by_name_and_property (xmlNodePtr parent,
+ const xmlChar *child_name,
+ const xmlChar *property_name,
+ const xmlChar *property_value);
+xmlNodePtr eel_xml_get_root_child_by_name_and_property (xmlDocPtr document,
+ const xmlChar *child_name,
+ const xmlChar *property_name,
+ const xmlChar *property_value);
#endif /* EEL_XML_EXTENSIONS_H */