OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2004-09-28 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git]
/
libiberty
/
splay-tree.c
diff --git
a/libiberty/splay-tree.c
b/libiberty/splay-tree.c
index
f12b4cc
..
fc98db1
100644
(file)
--- a/
libiberty/splay-tree.c
+++ b/
libiberty/splay-tree.c
@@
-230,13
+230,17
@@
splay_tree_foreach_helper (sp, node, fn, data)
/* An allocator and deallocator based on xmalloc. */
static void *
/* An allocator and deallocator based on xmalloc. */
static void *
-splay_tree_xmalloc_allocate (int size, void *data)
+splay_tree_xmalloc_allocate (size, data)
+ int size;
+ void *data ATTRIBUTE_UNUSED;
{
{
- return xmalloc (size);
+ return
(void *)
xmalloc (size);
}
static void
}
static void
-splay_tree_xmalloc_deallocate (void *object, void *data)
+splay_tree_xmalloc_deallocate (object, data)
+ void *object;
+ void *data ATTRIBUTE_UNUSED;
{
free (object);
}
{
free (object);
}
@@
-468,7
+472,7
@@
splay_tree_predecessor (sp, key)
if (comparison < 0)
return sp->root;
if (comparison < 0)
return sp->root;
- /* Otherwise, find the
leftmost element of the righ
t subtree. */
+ /* Otherwise, find the
rightmost element of the lef
t subtree. */
node = sp->root->left;
if (node)
while (node->right)
node = sp->root->left;
if (node)
while (node->right)
@@
-478,7
+482,7
@@
splay_tree_predecessor (sp, key)
}
/* Return the immediate successor KEY, or NULL if there is no
}
/* Return the immediate successor KEY, or NULL if there is no
-
prede
cessor. KEY need not be present in the tree. */
+
suc
cessor. KEY need not be present in the tree. */
splay_tree_node
splay_tree_successor (sp, key)
splay_tree_node
splay_tree_successor (sp, key)
@@
-488,7
+492,7
@@
splay_tree_successor (sp, key)
int comparison;
splay_tree_node node;
int comparison;
splay_tree_node node;
- /* If the tree is empty, there is certainly no
prede
cessor. */
+ /* If the tree is empty, there is certainly no
suc
cessor. */
if (!sp->root)
return NULL;
if (!sp->root)
return NULL;
@@
-501,7
+505,7
@@
splay_tree_successor (sp, key)
if (comparison > 0)
return sp->root;
if (comparison > 0)
return sp->root;
- /* Otherwise, find the
rightmost element of the lef
t subtree. */
+ /* Otherwise, find the
leftmost element of the righ
t subtree. */
node = sp->root->right;
if (node)
while (node->left)
node = sp->root->right;
if (node)
while (node->left)