mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 03:15:30 +00:00
Fix compiler warnings (Issue #333)
This commit is contained in:
parent
95445118c2
commit
5e35d50f75
@ -7,6 +7,7 @@ Changes in Mini-XML 4.0.4
|
|||||||
|
|
||||||
- Fixed an issue when reporting errors with a `NULL` options pointer
|
- Fixed an issue when reporting errors with a `NULL` options pointer
|
||||||
(Issue #329)
|
(Issue #329)
|
||||||
|
- Fixed some compiler warnings (Issue #333)
|
||||||
|
|
||||||
|
|
||||||
Changes in Mini-XML 4.0.3
|
Changes in Mini-XML 4.0.3
|
||||||
|
@ -232,7 +232,7 @@ mxml_set_attr(mxml_node_t *node, // I - Element node
|
|||||||
const char *name, // I - Attribute name
|
const char *name, // I - Attribute name
|
||||||
char *value) // I - Attribute value
|
char *value) // I - Attribute value
|
||||||
{
|
{
|
||||||
int i; // Looping var
|
size_t i; // Looping var
|
||||||
_mxml_attr_t *attr; // New attribute
|
_mxml_attr_t *attr; // New attribute
|
||||||
|
|
||||||
|
|
||||||
|
12
mxml-index.c
12
mxml-index.c
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
static int index_compare(mxml_index_t *ind, mxml_node_t *first, mxml_node_t *second);
|
static int index_compare(mxml_index_t *ind, mxml_node_t *first, mxml_node_t *second);
|
||||||
static int index_find(mxml_index_t *ind, const char *element, const char *value, mxml_node_t *node);
|
static int index_find(mxml_index_t *ind, const char *element, const char *value, mxml_node_t *node);
|
||||||
static void index_sort(mxml_index_t *ind, int left, int right);
|
static void index_sort(mxml_index_t *ind, size_t left, size_t right);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -80,8 +80,8 @@ mxmlIndexFind(mxml_index_t *ind, // I - Index to search
|
|||||||
const char *element, // I - Element name to find, if any
|
const char *element, // I - Element name to find, if any
|
||||||
const char *value) // I - Attribute value, if any
|
const char *value) // I - Attribute value, if any
|
||||||
{
|
{
|
||||||
int diff, // Difference between names
|
int diff; // Difference between names
|
||||||
current, // Current entity in search
|
size_t current, // Current entity in search
|
||||||
first, // First entity in search
|
first, // First entity in search
|
||||||
last; // Last entity in search
|
last; // Last entity in search
|
||||||
|
|
||||||
@ -369,12 +369,12 @@ index_find(mxml_index_t *ind, // I - Index
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
index_sort(mxml_index_t *ind, // I - Index to sort
|
index_sort(mxml_index_t *ind, // I - Index to sort
|
||||||
int left, // I - Left node in partition
|
size_t left, // I - Left node in partition
|
||||||
int right) // I - Right node in partition
|
size_t right) // I - Right node in partition
|
||||||
{
|
{
|
||||||
mxml_node_t *pivot, // Pivot node
|
mxml_node_t *pivot, // Pivot node
|
||||||
*temp; // Swap node
|
*temp; // Swap node
|
||||||
int templ, // Temporary left node
|
size_t templ, // Temporary left node
|
||||||
tempr; // Temporary right node
|
tempr; // Temporary right node
|
||||||
|
|
||||||
|
|
||||||
|
17
mxml-node.c
17
mxml-node.c
@ -811,9 +811,13 @@ mxmlRelease(mxml_node_t *node) // I - Node
|
|||||||
mxmlDelete(node);
|
mxmlDelete(node);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
else if (node->ref_count < INT_MAX)
|
||||||
|
{
|
||||||
|
return ((int)node->ref_count);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (node->ref_count);
|
return (INT_MAX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -831,9 +835,18 @@ int // O - New reference count
|
|||||||
mxmlRetain(mxml_node_t *node) // I - Node
|
mxmlRetain(mxml_node_t *node) // I - Node
|
||||||
{
|
{
|
||||||
if (node)
|
if (node)
|
||||||
return (++ node->ref_count);
|
{
|
||||||
|
node->ref_count ++;
|
||||||
|
|
||||||
|
if (node->ref_count < INT_MAX)
|
||||||
|
return ((int)node->ref_count);
|
||||||
|
else
|
||||||
|
return (INT_MAX);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return (-1);
|
return (-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user