[Xcb-commit] 2 commits - libXamine
Josh Triplett
josh at kemper.freedesktop.org
Sun Mar 5 12:17:45 PST 2006
libXamine/src/xamine.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
New commits:
diff-tree 5d1b7553f9eb654e28b50f4f75ad6e120cc7e29f (from 240c4429b8ff8ae9dbdf735992baa4d7e9460d6e)
Author: Josh Triplett <josh at freedesktop.org>
Date: Sun Mar 5 12:17:17 2006 -0800
Fix the last signedness warning.
diff --git a/libXamine/src/xamine.c b/libXamine/src/xamine.c
index aee5a47..8fd4f01 100644
--- a/libXamine/src/xamine.c
+++ b/libXamine/src/xamine.c
@@ -81,6 +81,7 @@ static const XamineDefinition core_type_
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(xm
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_ex
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;
}
diff-tree 240c4429b8ff8ae9dbdf735992baa4d7e9460d6e (from 8ea0b1487e07d079065631ba27de3a68f1e4f311)
Author: Josh Triplett <josh at freedesktop.org>
Date: Sun Mar 5 12:10:24 2006 -0800
Fix another signedness error.
diff --git a/libXamine/src/xamine.c b/libXamine/src/xamine.c
index 1f987b7..aee5a47 100644
--- a/libXamine/src/xamine.c
+++ b/libXamine/src/xamine.c
@@ -275,7 +275,7 @@ XaminedItem *xamine(XamineConversation *
return NULL;
/* Dissect the data based on the definition. */
- int offset = 0;
+ unsigned int offset = 0;
return xamine_definition(conversation, &data, &size, &offset,
definition, NULL);
}
More information about the xcb-commit
mailing list