summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-03-05 12:17:17 -0800
committerJosh Triplett <josh@freedesktop.org>2006-03-05 12:17:17 -0800
commit1a4a21a2e4c7b14dd2e994456652fc1bbbc3b806 (patch)
tree38f00f4725aead300767abbf53398461d3f3f82a
parent6f5572427ef533fee89daedfb1d08afefa49e611 (diff)
Fix the last signedness warning.
-rw-r--r--src/xamine.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/xamine.c b/src/xamine.c
index aee5a47..8fd4f01 100644
--- a/src/xamine.c
+++ b/src/xamine.c
@@ -81,6 +81,7 @@ static const XamineDefinition core_type_definitions[] =
static char *xamine_xml_get_prop(xmlNodePtr node, const char *name);
static char *xamine_xml_get_node_name(xmlNodePtr node);
+static char *xamine_xml_get_node_content(xmlNodePtr node);
static void xamine_parse_xmlxcb_file(XamineState *state, char *filename);
static char* xamine_make_name(XamineExtension *extension, char *name);
static XamineDefinition *xamine_find_type(XamineState *state, char *name);
@@ -304,6 +305,12 @@ static char *xamine_xml_get_node_name(xmlNodePtr node)
return (char *)node->name;
}
+/* Helper function to avoid casting. */
+static char *xamine_xml_get_node_content(xmlNodePtr node)
+{
+ return (char *)xmlNodeGetContent(node);
+}
+
static void xamine_parse_xmlxcb_file(XamineState *state, char *filename)
{
xmlDoc *doc;
@@ -589,12 +596,12 @@ static XamineExpression *xamine_parse_expression(XamineState *state,
else if(strcmp(xamine_xml_get_node_name(elem), "value") == 0)
{
e->type = XAMINE_VALUE;
- e->value = strtol(elem->children->content, NULL, 0);
+ e->value = strtol(xamine_xml_get_node_content(elem), NULL, 0);
}
else if(strcmp(xamine_xml_get_node_name(elem), "fieldref") == 0)
{
e->type = XAMINE_FIELDREF;
- e->field = strdup(elem->children->content);
+ e->field = strdup(xamine_xml_get_node_content(elem));
}
return e;
}