<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style></head>
<body>
<body><p dir="ltr">I am OK with them also. If Sebastian is unable go commit them on holiday, please commit them</p><div class="quote">On Jul 13, 2014 12:39 PM, Gedare Bloom <gedare@rtems.org> wrote:<br type="attribution"></div></body>
<font size="2"><div class="PlainText">These 2 patches looked fine at a glance through.<br>
<br>
On Sat, Jul 12, 2014 at 3:22 PM, Sebastian Huber<br>
<sebastian.huber@embedded-brains.de> wrote:<br>
> Remove compare function and is unique indicator from the control<br>
> structure. Rename RBTree_Compare_function to RBTree_Compare. Rename<br>
> rtems_rbtree_compare_function to rtems_rbtree_compare. Provide C++<br>
> compatible initializers. Add compare function and is unique indicator<br>
> to _RBTree_Find(), _RBTree_Insert(), rtems_rbtree_find() and<br>
> rtems_rbtree_insert(). Remove _RBTree_Is_unique() and<br>
> rtems_rbtree_is_unique(). Remove compare function and is unique<br>
> indicator from _RBTree_Initialize_empty() and<br>
> rtems_rbtree_initialize_empty().<br>
> ---<br>
> cpukit/posix/include/rtems/posix/keyimpl.h | 21 +++-<br>
> cpukit/posix/src/key.c | 10 +-<br>
> cpukit/posix/src/keyfreememory.c | 4 +-<br>
> cpukit/posix/src/keygetspecific.c | 13 +--<br>
> cpukit/posix/src/keysetspecific.c | 16 +--<br>
> cpukit/sapi/include/rtems/rbtree.h | 46 ++++-----<br>
> cpukit/sapi/src/rbheap.c | 8 +-<br>
> cpukit/score/include/rtems/score/rbtree.h | 111 ++++++++++-----------<br>
> .../score/include/rtems/score/scheduleredfimpl.h | 12 ++-<br>
> cpukit/score/src/rbtree.c | 19 ++--<br>
> cpukit/score/src/rbtreefind.c | 22 ++--<br>
> cpukit/score/src/rbtreeinsert.c | 32 ++----<br>
> cpukit/score/src/scheduleredf.c | 9 +-<br>
> cpukit/score/src/scheduleredfchangepriority.c | 7 +-<br>
> cpukit/score/src/scheduleredfyield.c | 7 +-<br>
> testsuites/sptests/sprbtree01/init.c | 102 +++++++++++--------<br>
> 16 files changed, 226 insertions(+), 213 deletions(-)<br>
><br>
> diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h<br>
> index 6aab244..b21c1d3 100644<br>
> --- a/cpukit/posix/include/rtems/posix/keyimpl.h<br>
> +++ b/cpukit/posix/include/rtems/posix/keyimpl.h<br>
> @@ -42,7 +42,7 @@ POSIX_EXTERN Objects_Information _POSIX_Keys_Information;<br>
> /**<br>
> * @brief The rbtree control block used to manage all key values<br>
> */<br>
> -POSIX_EXTERN RBTree_Control _POSIX_Keys_Key_value_lookup_tree;<br>
> +extern RBTree_Control _POSIX_Keys_Key_value_lookup_tree;<br>
><br>
> /**<br>
> * @brief This freechain is used as a memory pool for POSIX_Keys_Key_value_pair.<br>
> @@ -61,7 +61,7 @@ void _POSIX_Key_Manager_initialization(void);<br>
> *<br>
> * This routine compares the rbtree node<br>
> */<br>
> -int _POSIX_Keys_Key_value_lookup_tree_compare_function(<br>
> +int _POSIX_Keys_Key_value_compare(<br>
> const RBTree_Node *node1,<br>
> const RBTree_Node *node2<br>
> );<br>
> @@ -165,6 +165,23 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free(<br>
> _Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair );<br>
> }<br>
><br>
> +RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Find(<br>
> + pthread_key_t key,<br>
> + Objects_Id thread_id,<br>
> + POSIX_Keys_Key_value_pair *search_node<br>
> +)<br>
> +{<br>
> + search_node->key = key;<br>
> + search_node->thread_id = thread_id;<br>
> +<br>
> + return _RBTree_Find(<br>
> + &_POSIX_Keys_Key_value_lookup_tree,<br>
> + &search_node->Key_value_lookup_node,<br>
> + _POSIX_Keys_Key_value_compare,<br>
> + true<br>
> + );<br>
> +}<br>
> +<br>
> /** @} */<br>
><br>
> #ifdef __cplusplus<br>
> diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c<br>
> index de61b43..105706a 100644<br>
> --- a/cpukit/posix/src/key.c<br>
> +++ b/cpukit/posix/src/key.c<br>
> @@ -26,6 +26,8 @@<br>
> #include <rtems/score/objectimpl.h><br>
> #include <rtems/score/wkspace.h><br>
><br>
> +RBTREE_DEFINE_EMPTY( _POSIX_Keys_Key_value_lookup_tree );<br>
> +<br>
> /**<br>
> * @brief This routine compares the rbtree node by comparing POSIX key first<br>
> * and comparing thread id second.<br>
> @@ -42,7 +44,7 @@<br>
> * impossible<br>
> */<br>
><br>
> -int _POSIX_Keys_Key_value_lookup_tree_compare_function(<br>
> +int _POSIX_Keys_Key_value_compare(<br>
> const RBTree_Node *node1,<br>
> const RBTree_Node *node2<br>
> )<br>
> @@ -153,11 +155,5 @@ void _POSIX_Key_Manager_initialization(void)<br>
> #endif<br>
> );<br>
><br>
> - _RBTree_Initialize_empty(<br>
> - &_POSIX_Keys_Key_value_lookup_tree,<br>
> - _POSIX_Keys_Key_value_lookup_tree_compare_function,<br>
> - true<br>
> - );<br>
> -<br>
> _POSIX_Keys_Initialize_keypool();<br>
> }<br>
> diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c<br>
> index 04c914f..b419f1f 100644<br>
> --- a/cpukit/posix/src/keyfreememory.c<br>
> +++ b/cpukit/posix/src/keyfreememory.c<br>
> @@ -32,9 +32,7 @@ void _POSIX_Keys_Free_memory(<br>
> Objects_Id key_id;<br>
><br>
> key_id = the_key->Object.id;<br>
> - search_node.key = key_id;<br>
> - search_node.thread_id = 0;<br>
> - iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node );<br>
> + iter = _POSIX_Keys_Find( key_id, 0, &search_node );<br>
> if ( !iter )<br>
> return;<br>
> /**<br>
> diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c<br>
> index eeab2e3..9c54112 100644<br>
> --- a/cpukit/posix/src/keygetspecific.c<br>
> +++ b/cpukit/posix/src/keygetspecific.c<br>
> @@ -49,19 +49,14 @@ void *pthread_getspecific(<br>
> switch ( location ) {<br>
><br>
> case OBJECTS_LOCAL:<br>
> - search_node.key = key;<br>
> - search_node.thread_id = _Thread_Executing->Object.id;<br>
> - p = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree,<br>
> - &search_node.Key_value_lookup_node );<br>
> - key_data = NULL;<br>
> - if ( p ) {<br>
> + p = _POSIX_Keys_Find( key, _Thread_Executing->Object.id, &search_node );<br>
> + if ( p != NULL ) {<br>
> value_pair_p = _RBTree_Container_of( p,<br>
> POSIX_Keys_Key_value_pair,<br>
> Key_value_lookup_node );<br>
> - /* key_data = _RBTree_Container_of( p, */<br>
> - /* POSIX_Keys_Key_value_pair, */<br>
> - /* Key_value_lookup_node )->value; */<br>
> key_data = value_pair_p->value;<br>
> + } else {<br>
> + key_data = NULL;<br>
> }<br>
><br>
> _Objects_Put( &the_key->Object );<br>
> diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c<br>
> index 3284991..0f7c682 100644<br>
> --- a/cpukit/posix/src/keysetspecific.c<br>
> +++ b/cpukit/posix/src/keysetspecific.c<br>
> @@ -44,12 +44,8 @@ int pthread_setspecific(<br>
> switch ( location ) {<br>
><br>
> case OBJECTS_LOCAL:<br>
> - search_node.key = key;<br>
> - search_node.thread_id = _Thread_Executing->Object.id;<br>
> - p = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree,<br>
> - &search_node.Key_value_lookup_node );<br>
> -<br>
> - if ( p ) {<br>
> + p = _POSIX_Keys_Find( key, _Thread_Executing->Object.id, &search_node );<br>
> + if ( p != NULL ) {<br>
> value_pair_ptr = _RBTree_Container_of( p,<br>
> POSIX_Keys_Key_value_pair,<br>
> Key_value_lookup_node );<br>
> @@ -69,8 +65,12 @@ int pthread_setspecific(<br>
> value_pair_ptr->value = value;<br>
> /* The insert can only go wrong if the same node is already in a unique<br>
> * tree. This has been already checked with the _RBTree_Find() */<br>
> - (void) _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree,<br>
> - &(value_pair_ptr->Key_value_lookup_node) );<br>
> + _RBTree_Insert(<br>
> + &_POSIX_Keys_Key_value_lookup_tree,<br>
> + &value_pair_ptr->Key_value_lookup_node,<br>
> + _POSIX_Keys_Key_value_compare,<br>
> + true<br>
> + );<br>
><br>
> /** append rb_node to the thread API extension's chain */<br>
> _Chain_Append_unprotected(<br>
> diff --git a/cpukit/sapi/include/rtems/rbtree.h b/cpukit/sapi/include/rtems/rbtree.h<br>
> index 7e59e03..2005b36 100644<br>
> --- a/cpukit/sapi/include/rtems/rbtree.h<br>
> +++ b/cpukit/sapi/include/rtems/rbtree.h<br>
> @@ -55,13 +55,11 @@ typedef RBTree_Node rtems_rbtree_node;<br>
> typedef RBTree_Control rtems_rbtree_control;<br>
><br>
> /**<br>
> - * @typedef rtems_rbtree_compare_function<br>
> - *<br>
> * This type defines function pointers for user-provided comparison<br>
> * function. The function compares two nodes in order to determine<br>
> * the order in a red-black tree.<br>
> */<br>
> -typedef RBTree_Compare_function rtems_rbtree_compare_function;<br>
> +typedef RBTree_Compare rtems_rbtree_compare;<br>
><br>
> /**<br>
> * @brief RBTree initializer for an empty rbtree with designator @a name.<br>
> @@ -93,15 +91,15 @@ typedef RBTree_Compare_function rtems_rbtree_compare_function;<br>
> * @a starting_address. Each node is of @a node_size bytes.<br>
> */<br>
> RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize(<br>
> - rtems_rbtree_control *the_rbtree,<br>
> - rtems_rbtree_compare_function compare_function,<br>
> - void *starting_address,<br>
> - size_t number_nodes,<br>
> - size_t node_size,<br>
> - bool is_unique<br>
> + rtems_rbtree_control *the_rbtree,<br>
> + rtems_rbtree_compare compare,<br>
> + void *starting_address,<br>
> + size_t number_nodes,<br>
> + size_t node_size,<br>
> + bool is_unique<br>
> )<br>
> {<br>
> - _RBTree_Initialize( the_rbtree, compare_function, starting_address,<br>
> + _RBTree_Initialize( the_rbtree, compare, starting_address,<br>
> number_nodes, node_size, is_unique);<br>
> }<br>
><br>
> @@ -111,12 +109,10 @@ RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize(<br>
> * This routine initializes @a the_rbtree to contain zero nodes.<br>
> */<br>
> RTEMS_INLINE_ROUTINE void rtems_rbtree_initialize_empty(<br>
> - rtems_rbtree_control *the_rbtree,<br>
> - rtems_rbtree_compare_function compare_function,<br>
> - bool is_unique<br>
> + rtems_rbtree_control *the_rbtree<br>
> )<br>
> {<br>
> - _RBTree_Initialize_empty( the_rbtree, compare_function, is_unique );<br>
> + _RBTree_Initialize_empty( the_rbtree );<br>
> }<br>
><br>
> /**<br>
> @@ -277,10 +273,12 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_root(<br>
> */<br>
> RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find(<br>
> const rtems_rbtree_control *the_rbtree,<br>
> - const rtems_rbtree_node *the_node<br>
> + const rtems_rbtree_node *the_node,<br>
> + rtems_rbtree_compare compare,<br>
> + bool is_unique<br>
> )<br>
> {<br>
> - return _RBTree_Find( the_rbtree, the_node );<br>
> + return _RBTree_Find( the_rbtree, the_node, compare, is_unique );<br>
> }<br>
><br>
> /**<br>
> @@ -385,20 +383,12 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_control *rtems_rbtree_find_header(<br>
> */<br>
> RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert(<br>
> rtems_rbtree_control *the_rbtree,<br>
> - rtems_rbtree_node *the_node<br>
> -)<br>
> -{<br>
> - return _RBTree_Insert( the_rbtree, the_node );<br>
> -}<br>
> -<br>
> -/**<br>
> - * @brief Determines whether the tree is unique.<br>
> - */<br>
> -RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_unique(<br>
> - const rtems_rbtree_control *the_rbtree<br>
> + rtems_rbtree_node *the_node,<br>
> + rtems_rbtree_compare compare,<br>
> + bool is_unique<br>
> )<br>
> {<br>
> - return _RBTree_Is_unique(the_rbtree);<br>
> + return _RBTree_Insert( the_rbtree, the_node, compare, is_unique );<br>
> }<br>
><br>
> /** @} */<br>
> diff --git a/cpukit/sapi/src/rbheap.c b/cpukit/sapi/src/rbheap.c<br>
> index febd65f..20338eb 100644<br>
> --- a/cpukit/sapi/src/rbheap.c<br>
> +++ b/cpukit/sapi/src/rbheap.c<br>
> @@ -80,7 +80,7 @@ static void insert_into_tree(<br>
> rtems_rbheap_chunk *chunk<br>
> )<br>
> {<br>
> - _RBTree_Insert(tree, &chunk->tree_node);<br>
> + rtems_rbtree_insert(tree, &chunk->tree_node, chunk_compare, true);<br>
> }<br>
><br>
> rtems_status_code rtems_rbheap_initialize(<br>
> @@ -107,7 +107,7 @@ rtems_status_code rtems_rbheap_initialize(<br>
><br>
> rtems_chain_initialize_empty(free_chain);<br>
> rtems_chain_initialize_empty(&control->spare_descriptor_chain);<br>
> - rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);<br>
> + rtems_rbtree_initialize_empty(chunk_tree);<br>
> control->alignment = alignment;<br>
> control->handler_arg = handler_arg;<br>
> control->extend_descriptors = extend_descriptors;<br>
> @@ -198,7 +198,7 @@ static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)<br>
> rtems_rbheap_chunk chunk = { .begin = key };<br>
><br>
> return rtems_rbheap_chunk_of_node(<br>
> - _RBTree_Find(chunk_tree, &chunk.tree_node)<br>
> + rtems_rbtree_find(chunk_tree, &chunk.tree_node, chunk_compare, true)<br>
> );<br>
> }<br>
><br>
> @@ -230,7 +230,7 @@ static void check_and_merge(<br>
> a->size += b->size;<br>
> rtems_chain_extract_unprotected(&b->chain_node);<br>
> add_to_chain(free_chain, b);<br>
> - _RBTree_Extract(chunk_tree, &b->tree_node);<br>
> + rtems_rbtree_extract(chunk_tree, &b->tree_node);<br>
> }<br>
> }<br>
><br>
> diff --git a/cpukit/score/include/rtems/score/rbtree.h b/cpukit/score/include/rtems/score/rbtree.h<br>
> index 5a296b6..a219a6e 100644<br>
> --- a/cpukit/score/include/rtems/score/rbtree.h<br>
> +++ b/cpukit/score/include/rtems/score/rbtree.h<br>
> @@ -104,13 +104,21 @@ typedef enum {<br>
> } RBTree_Direction;<br>
><br>
> /**<br>
> - * This type defines function pointers for user-provided comparison<br>
> - * function. The function compares two nodes in order to determine<br>
> - * the order in a red-black tree.<br>
> + * @brief Compares two red-black tree nodes.<br>
> + *<br>
> + * @param[in] first The first node.<br>
> + * @param[in] second The second node.<br>
> + *<br>
> + * @retval positive The key value of the first node is greater than the one of<br>
> + * the second node.<br>
> + * @retval 0 The key value of the first node is equal to the one of the second<br>
> + * node.<br>
> + * @retval negative The key value of the first node is less than the one of the<br>
> + * second node.<br>
> */<br>
> -typedef int (*RBTree_Compare_function)(<br>
> - const RBTree_Node *node1,<br>
> - const RBTree_Node *node2<br>
> +typedef int ( *RBTree_Compare )(<br>
> + const RBTree_Node *first,<br>
> + const RBTree_Node *second<br>
> );<br>
><br>
> /**<br>
> @@ -139,51 +147,31 @@ typedef struct {<br>
> RBTree_Node *root;<br>
> /** This points to the min and max nodes of this RBT. */<br>
> RBTree_Node *first[2];<br>
> - /**<br>
> - * Comparison function pointer. Keys to compare have to be found<br>
> - * inside to maintain generality. It has to return 1 if first node<br>
> - * has higher key than second, -1 if lower, 0 if equal.<br>
> - */<br>
> - RBTree_Compare_function compare_function;<br>
> - /** Determines whether the tree accepts duplicate keys. */<br>
> - bool is_unique;<br>
> } RBTree_Control;<br>
><br>
> /**<br>
> * @brief RBTree initializer for an empty rbtree with designator @a name.<br>
> */<br>
> -#define RBTREE_INITIALIZER_EMPTY(name) \<br>
> -{ \<br>
> - .permanent_null = NULL, \<br>
> - .root = NULL, \<br>
> - .first[0] = NULL, \<br>
> - .first[1] = NULL, \<br>
> - .compare_function = NULL, \<br>
> - .is_unique = 0 \<br>
> -}<br>
> +#define RBTREE_INITIALIZER_EMPTY( name ) \<br>
> + { NULL, NULL, { NULL, NULL } }<br>
><br>
> /**<br>
> * @brief RBTree definition for an empty rbtree with designator @a name.<br>
> */<br>
> -#define RBTREE_DEFINE_EMPTY(name) \<br>
> -RBTree_Control name = RBTREE_INITIALIZER_EMPTY(name)<br>
> +#define RBTREE_DEFINE_EMPTY( name ) \<br>
> + RBTree_Control name = RBTREE_INITIALIZER_EMPTY( name )<br>
><br>
> /**<br>
> * @brief RBTree_Node initializer for an empty node with designator @a name.<br>
> */<br>
> -#define RBTREE_NODE_INITIALIZER_EMPTY(name) \<br>
> -{ \<br>
> - .parent = NULL, \<br>
> - .child[0] = NULL, \<br>
> - .child[1] = NULL, \<br>
> - RBT_RED \<br>
> -}<br>
> +#define RBTREE_NODE_INITIALIZER_EMPTY( name ) \<br>
> + { NULL, { NULL, NULL }, RBT_RED }<br>
><br>
> /**<br>
> * @brief RBTree definition for an empty rbtree with designator @a name.<br>
> */<br>
> -#define RBTREE_NODE_DEFINE_EMPTY(name) \<br>
> -RBTree_Node name = RBTREE_NODE_INITIALIZER_EMPTY(name)<br>
> +#define RBTREE_NODE_DEFINE_EMPTY( name ) \<br>
> + RBTree_Node name = RBTREE_NODE_INITIALIZER_EMPTY( name )<br>
><br>
> /**<br>
> * @brief Initialize a RBTree Header.<br>
> @@ -193,17 +181,20 @@ RBTree_Node name = RBTREE_NODE_INITIALIZER_EMPTY(name)<br>
> * @a starting_address. Each node is of @a node_size bytes.<br>
> *<br>
> * @param[in] the_rbtree is the pointer to rbtree header<br>
> + * @param[in] compare The node compare function.<br>
> * @param[in] starting_address is the starting address of first node<br>
> * @param[in] number_nodes is the number of nodes in rbtree<br>
> * @param[in] node_size is the size of node in bytes<br>
> + * @param[in] is_unique If true, then reject nodes with a duplicate key, else<br>
> + * otherwise.<br>
> */<br>
> void _RBTree_Initialize(<br>
> - RBTree_Control *the_rbtree,<br>
> - RBTree_Compare_function compare_function,<br>
> - void *starting_address,<br>
> - size_t number_nodes,<br>
> - size_t node_size,<br>
> - bool is_unique<br>
> + RBTree_Control *the_rbtree,<br>
> + RBTree_Compare compare,<br>
> + void *starting_address,<br>
> + size_t number_nodes,<br>
> + size_t node_size,<br>
> + bool is_unique<br>
> );<br>
><br>
> /**<br>
> @@ -211,6 +202,10 @@ void _RBTree_Initialize(<br>
> *<br>
> * @param[in] the_rbtree The red-black tree control.<br>
> * @param[in] the_node A node specifying the key.<br>
> + * @param[in] compare The node compare function.<br>
> + * @param[in] is_unique If true, then return the first node with a key equal to<br>
> + * the one of the node specified if it exits, else return the last node if it<br>
> + * exists.<br>
> *<br>
> * @retval node A node corresponding to the key. If the tree is not unique<br>
> * and contains duplicate keys, the set of duplicate keys acts as FIFO.<br>
> @@ -218,7 +213,9 @@ void _RBTree_Initialize(<br>
> */<br>
> RBTree_Node *_RBTree_Find(<br>
> const RBTree_Control *the_rbtree,<br>
> - const RBTree_Node *the_node<br>
> + const RBTree_Node *the_node,<br>
> + RBTree_Compare compare,<br>
> + bool is_unique<br>
> );<br>
><br>
> /**<br>
> @@ -226,6 +223,12 @@ RBTree_Node *_RBTree_Find(<br>
> *<br>
> * This routine inserts @a the_node on the Red-Black Tree @a the_rbtree.<br>
> *<br>
> + * @param[in] the_rbtree The red-black tree control.<br>
> + * @param[in] the_node The node to insert.<br>
> + * @param[in] compare The node compare function.<br>
> + * @param[in] is_unique If true, then reject nodes with a duplicate key, else<br>
> + * otherwise.<br>
> + *<br>
> * @retval 0 Successfully inserted.<br>
> * @retval -1 NULL @a the_node.<br>
> * @retval RBTree_Node* if one with equal value to @a the_node 's key exists<br>
> @@ -233,7 +236,9 @@ RBTree_Node *_RBTree_Find(<br>
> */<br>
> RBTree_Node *_RBTree_Insert(<br>
> RBTree_Control *the_rbtree,<br>
> - RBTree_Node *the_node<br>
> + RBTree_Node *the_node,<br>
> + RBTree_Compare compare,<br>
> + bool is_unique<br>
> );<br>
><br>
> /**<br>
> @@ -437,17 +442,13 @@ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header(<br>
> * This routine initializes @a the_rbtree to contain zero nodes.<br>
> */<br>
> RTEMS_INLINE_ROUTINE void _RBTree_Initialize_empty(<br>
> - RBTree_Control *the_rbtree,<br>
> - RBTree_Compare_function compare_function,<br>
> - bool is_unique<br>
> - )<br>
> + RBTree_Control *the_rbtree<br>
> +)<br>
> {<br>
> the_rbtree->permanent_null = NULL;<br>
> the_rbtree->root = NULL;<br>
> - the_rbtree->first[0] = NULL;<br>
> - the_rbtree->first[1] = NULL;<br>
> - the_rbtree->compare_function = compare_function;<br>
> - the_rbtree->is_unique = is_unique;<br>
> + the_rbtree->first[RBT_LEFT] = NULL;<br>
> + the_rbtree->first[RBT_RIGHT] = NULL;<br>
> }<br>
><br>
> /**<br>
> @@ -502,16 +503,6 @@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Get(<br>
> return the_node;<br>
> }<br>
><br>
> -/**<br>
> - * @brief Determines whether the tree is unique.<br>
> - */<br>
> -RTEMS_INLINE_ROUTINE bool _RBTree_Is_unique(<br>
> - const RBTree_Control *the_rbtree<br>
> -)<br>
> -{<br>
> - return( the_rbtree && the_rbtree->is_unique );<br>
> -}<br>
> -<br>
> /**@}*/<br>
><br>
> #ifdef __cplusplus<br>
> diff --git a/cpukit/score/include/rtems/score/scheduleredfimpl.h b/cpukit/score/include/rtems/score/scheduleredfimpl.h<br>
> index aab338e..019c544 100644<br>
> --- a/cpukit/score/include/rtems/score/scheduleredfimpl.h<br>
> +++ b/cpukit/score/include/rtems/score/scheduleredfimpl.h<br>
> @@ -44,6 +44,11 @@ RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Thread_get_node(<br>
> return (Scheduler_EDF_Node *) _Scheduler_Thread_get_node( the_thread );<br>
> }<br>
><br>
> +int _Scheduler_EDF_Compare(<br>
> + const RBTree_Node* n1,<br>
> + const RBTree_Node* n2<br>
> +);<br>
> +<br>
> RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue(<br>
> const Scheduler_Control *scheduler,<br>
> Thread_Control *the_thread<br>
> @@ -53,7 +58,12 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Enqueue(<br>
> _Scheduler_EDF_Get_context( scheduler );<br>
> Scheduler_EDF_Node *node = _Scheduler_EDF_Thread_get_node( the_thread );<br>
><br>
> - _RBTree_Insert( &context->Ready, &node->Node );<br>
> + _RBTree_Insert(<br>
> + &context->Ready,<br>
> + &node->Node,<br>
> + _Scheduler_EDF_Compare,<br>
> + false<br>
> + );<br>
> node->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES;<br>
> }<br>
><br>
> diff --git a/cpukit/score/src/rbtree.c b/cpukit/score/src/rbtree.c<br>
> index 958aed0..5e8520d 100644<br>
> --- a/cpukit/score/src/rbtree.c<br>
> +++ b/cpukit/score/src/rbtree.c<br>
> @@ -23,12 +23,12 @@<br>
> #include <rtems/score/isr.h><br>
><br>
> void _RBTree_Initialize(<br>
> - RBTree_Control *the_rbtree,<br>
> - RBTree_Compare_function compare_function,<br>
> - void *starting_address,<br>
> - size_t number_nodes,<br>
> - size_t node_size,<br>
> - bool is_unique<br>
> + RBTree_Control *the_rbtree,<br>
> + RBTree_Compare compare,<br>
> + void *starting_address,<br>
> + size_t number_nodes,<br>
> + size_t node_size,<br>
> + bool is_unique<br>
> )<br>
> {<br>
> size_t count;<br>
> @@ -38,13 +38,12 @@ void _RBTree_Initialize(<br>
> if (!the_rbtree) return;<br>
><br>
> /* could do sanity checks here */<br>
> - _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);<br>
> + _RBTree_Initialize_empty( the_rbtree );<br>
><br>
> count = number_nodes;<br>
> next = starting_address;<br>
> while ( count-- ) {<br>
> - _RBTree_Insert(the_rbtree, next);<br>
> - next = (RBTree_Node *)<br>
> - _Addresses_Add_offset( (void *) next, node_size );<br>
> + _RBTree_Insert( the_rbtree, next, compare, is_unique );<br>
> + next = (RBTree_Node *) _Addresses_Add_offset( next, node_size );<br>
> }<br>
> }<br>
> diff --git a/cpukit/score/src/rbtreefind.c b/cpukit/score/src/rbtreefind.c<br>
> index 4aaf236..ad0c9fd 100644<br>
> --- a/cpukit/score/src/rbtreefind.c<br>
> +++ b/cpukit/score/src/rbtreefind.c<br>
> @@ -18,28 +18,30 @@<br>
> #endif<br>
><br>
> #include <rtems/score/rbtreeimpl.h><br>
> -#include <rtems/score/isr.h><br>
><br>
> RBTree_Node *_RBTree_Find(<br>
> const RBTree_Control *the_rbtree,<br>
> - const RBTree_Node *the_node<br>
> + const RBTree_Node *the_node,<br>
> + RBTree_Compare compare,<br>
> + bool is_unique<br>
> )<br>
> {<br>
> RBTree_Node* iter_node = the_rbtree->root;<br>
> RBTree_Node* found = NULL;<br>
> - int compare_result;<br>
> - while (iter_node) {<br>
> - compare_result = the_rbtree->compare_function(the_node, iter_node);<br>
> +<br>
> + while ( iter_node != NULL ) {<br>
> + int compare_result = ( *compare )( the_node, iter_node );<br>
> + RBTree_Direction dir;<br>
> +<br>
> if ( _RBTree_Is_equal( compare_result ) ) {<br>
> found = iter_node;<br>
> - if ( the_rbtree->is_unique )<br>
> + if ( is_unique )<br>
> break;<br>
> }<br>
><br>
> - RBTree_Direction dir =<br>
> - (RBTree_Direction) _RBTree_Is_greater( compare_result );<br>
> - iter_node = iter_node->child[dir];<br>
> - } /* while(iter_node) */<br>
> + dir = (RBTree_Direction) _RBTree_Is_greater( compare_result );<br>
> + iter_node = iter_node->child[ dir ];<br>
> + }<br>
><br>
> return found;<br>
> }<br>
> diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c<br>
> index 39f7c2b..7174529 100644<br>
> --- a/cpukit/score/src/rbtreeinsert.c<br>
> +++ b/cpukit/score/src/rbtreeinsert.c<br>
> @@ -59,24 +59,12 @@ static void _RBTree_Validate_insert(<br>
> if(!the_node->parent->parent) the_node->color = RBT_BLACK;<br>
> }<br>
><br>
> -<br>
> -<br>
> -/** @brief Insert a Node (unprotected)<br>
> - *<br>
> - * This routine inserts @a the_node on the Red-Black Tree @a the_rbtree.<br>
> - *<br>
> - * @retval 0 Successfully inserted.<br>
> - * @retval -1 NULL @a the_node.<br>
> - * @retval RBTree_Node* if one with equal key to the key of @a the_node exists<br>
> - * in an unique @a the_rbtree.<br>
> - *<br>
> - * @note It does NOT disable interrupts to ensure the atomicity<br>
> - * of the extract operation.<br>
> - */<br>
> RBTree_Node *_RBTree_Insert(<br>
> - RBTree_Control *the_rbtree,<br>
> - RBTree_Node *the_node<br>
> - )<br>
> + RBTree_Control *the_rbtree,<br>
> + RBTree_Node *the_node,<br>
> + RBTree_Compare compare,<br>
> + bool is_unique<br>
> +)<br>
> {<br>
> if(!the_node) return (RBTree_Node*)-1;<br>
><br>
> @@ -92,8 +80,8 @@ RBTree_Node *_RBTree_Insert(<br>
> } else {<br>
> /* typical binary search tree insert, descend tree to leaf and insert */<br>
> while (iter_node) {<br>
> - compare_result = the_rbtree->compare_function(the_node, iter_node);<br>
> - if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )<br>
> + compare_result = ( *compare )( the_node, iter_node );<br>
> + if ( is_unique && _RBTree_Is_equal( compare_result ) )<br>
> return iter_node;<br>
> RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );<br>
> if (!iter_node->child[dir]) {<br>
> @@ -102,9 +90,9 @@ RBTree_Node *_RBTree_Insert(<br>
> iter_node->child[dir] = the_node;<br>
> the_node->parent = iter_node;<br>
> /* update min/max */<br>
> - compare_result = the_rbtree->compare_function(<br>
> - the_node,<br>
> - _RBTree_First(the_rbtree, dir)<br>
> + compare_result = ( *compare )(<br>
> + the_node,<br>
> + _RBTree_First( the_rbtree, dir )<br>
> );<br>
> if ( (!dir && _RBTree_Is_lesser(compare_result)) ||<br>
> (dir && _RBTree_Is_greater(compare_result)) ) {<br>
> diff --git a/cpukit/score/src/scheduleredf.c b/cpukit/score/src/scheduleredf.c<br>
> index 010d053..01b5244 100644<br>
> --- a/cpukit/score/src/scheduleredf.c<br>
> +++ b/cpukit/score/src/scheduleredf.c<br>
> @@ -20,8 +20,7 @@<br>
><br>
> #include <rtems/score/scheduleredfimpl.h><br>
><br>
> -static int _Scheduler_EDF_RBTree_compare_function<br>
> -(<br>
> +int _Scheduler_EDF_Compare(<br>
> const RBTree_Node* n1,<br>
> const RBTree_Node* n2<br>
> )<br>
> @@ -43,9 +42,5 @@ void _Scheduler_EDF_Initialize( const Scheduler_Control *scheduler )<br>
> Scheduler_EDF_Context *context =<br>
> _Scheduler_EDF_Get_context( scheduler );<br>
><br>
> - _RBTree_Initialize_empty(<br>
> - &context->Ready,<br>
> - _Scheduler_EDF_RBTree_compare_function,<br>
> - 0<br>
> - );<br>
> + _RBTree_Initialize_empty( &context->Ready );<br>
> }<br>
> diff --git a/cpukit/score/src/scheduleredfchangepriority.c b/cpukit/score/src/scheduleredfchangepriority.c<br>
> index 32b0993..3eabc83 100644<br>
> --- a/cpukit/score/src/scheduleredfchangepriority.c<br>
> +++ b/cpukit/score/src/scheduleredfchangepriority.c<br>
> @@ -32,7 +32,12 @@ Scheduler_Void_or_thread _Scheduler_EDF_Change_priority(<br>
> Scheduler_EDF_Node *node = _Scheduler_EDF_Thread_get_node( the_thread );<br>
><br>
> _RBTree_Extract( &context->Ready, &node->Node );<br>
> - _RBTree_Insert( &context->Ready, &node->Node );<br>
> + _RBTree_Insert(<br>
> + &context->Ready,<br>
> + &node->Node,<br>
> + _Scheduler_EDF_Compare,<br>
> + false<br>
> + );<br>
><br>
> SCHEDULER_RETURN_VOID_OR_NULL;<br>
> }<br>
> diff --git a/cpukit/score/src/scheduleredfyield.c b/cpukit/score/src/scheduleredfyield.c<br>
> index 5aa2afd..0ad5c32 100644<br>
> --- a/cpukit/score/src/scheduleredfyield.c<br>
> +++ b/cpukit/score/src/scheduleredfyield.c<br>
> @@ -35,7 +35,12 @@ Scheduler_Void_or_thread _Scheduler_EDF_Yield(<br>
> * with the same priority in case there are such ones.<br>
> */<br>
> _RBTree_Extract( &context->Ready, &node->Node );<br>
> - _RBTree_Insert( &context->Ready, &node->Node );<br>
> + _RBTree_Insert(<br>
> + &context->Ready,<br>
> + &node->Node,<br>
> + _Scheduler_EDF_Compare,<br>
> + false<br>
> + );<br>
><br>
> _Scheduler_EDF_Schedule_body( scheduler, the_thread, false );<br>
><br>
> diff --git a/testsuites/sptests/sprbtree01/init.c b/testsuites/sptests/sprbtree01/init.c<br>
> index abec11e..d58a8b5 100644<br>
> --- a/testsuites/sptests/sprbtree01/init.c<br>
> +++ b/testsuites/sptests/sprbtree01/init.c<br>
> @@ -42,6 +42,38 @@ static int test_compare_function (<br>
> return key1 - key2;<br>
> }<br>
><br>
> +static rtems_rbtree_node *rb_insert_unique(<br>
> + rtems_rbtree_control *rbtree,<br>
> + rtems_rbtree_node *node<br>
> +)<br>
> +{<br>
> + return rtems_rbtree_insert( rbtree, node, test_compare_function, true );<br>
> +}<br>
> +<br>
> +static rtems_rbtree_node *rb_insert_multi(<br>
> + rtems_rbtree_control *rbtree,<br>
> + rtems_rbtree_node *node<br>
> +)<br>
> +{<br>
> + return rtems_rbtree_insert( rbtree, node, test_compare_function, false );<br>
> +}<br>
> +<br>
> +static rtems_rbtree_node *rb_find_unique(<br>
> + rtems_rbtree_control *rbtree,<br>
> + rtems_rbtree_node *node<br>
> +)<br>
> +{<br>
> + return rtems_rbtree_find( rbtree, node, test_compare_function, true );<br>
> +}<br>
> +<br>
> +static rtems_rbtree_node *rb_find_multi(<br>
> + rtems_rbtree_control *rbtree,<br>
> + rtems_rbtree_node *node<br>
> +)<br>
> +{<br>
> + return rtems_rbtree_find( rbtree, node, test_compare_function, false );<br>
> +}<br>
> +<br>
> /*<br>
> * recursively checks tree. if the tree is built properly it should only<br>
> * be a depth of 7 function calls for 100 entries in the tree.<br>
> @@ -106,12 +138,7 @@ rtems_task Init(<br>
> TEST_BEGIN();<br>
><br>
> puts( "Init - Initialize rbtree empty" );<br>
> - rtems_rbtree_initialize_empty( &rbtree1, &test_compare_function, true );<br>
> -<br>
> - if ( !rtems_rbtree_is_unique( &rbtree1 ) )<br>
> - puts( "INIT - FAILED IS UNIQUE CHECK" );<br>
> - if ( rtems_rbtree_is_unique( NULL ) )<br>
> - puts( "INIT - FAILED IS UNIQUE CHECK" );<br>
> + rtems_rbtree_initialize_empty( &rbtree1 );<br>
><br>
> /* verify that the rbtree insert work */<br>
> puts( "INIT - Verify rtems_rbtree_insert with two nodes" );<br>
> @@ -119,10 +146,10 @@ rtems_task Init(<br>
> node1.key = 1;<br>
> node2.id = 2;<br>
> node2.key = 2;<br>
> - rtems_rbtree_insert( &rbtree1, &node1.Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node2.Node );<br>
> + rb_insert_unique( &rbtree1, &node1.Node );<br>
> + rb_insert_unique( &rbtree1, &node2.Node );<br>
><br>
> - p = rtems_rbtree_insert( &rbtree1, NULL );<br>
> + p = rb_insert_unique( &rbtree1, NULL );<br>
> if (p != (void *)(-1))<br>
> puts( "INIT - FAILED NULL NODE INSERT" );<br>
><br>
> @@ -159,8 +186,8 @@ rtems_task Init(<br>
><br>
> puts("INIT - Verify rtems_rbtree_insert with the same value twice");<br>
> node2.key = node1.key;<br>
> - rtems_rbtree_insert(&rbtree1, &node1.Node);<br>
> - p = rtems_rbtree_insert(&rbtree1, &node2.Node);<br>
> + rb_insert_unique(&rbtree1, &node1.Node);<br>
> + p = rb_insert_unique(&rbtree1, &node2.Node);<br>
><br>
> if (p != &node1.Node)<br>
> puts( "INIT - FAILED DUPLICATE INSERT" );<br>
> @@ -218,8 +245,8 @@ rtems_task Init(<br>
> node1.key = 2;<br>
> node2.id = 1;<br>
> node2.key = 1;<br>
> - rtems_rbtree_insert( &rbtree1, &node1.Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node2.Node );<br>
> + rb_insert_unique( &rbtree1, &node1.Node );<br>
> + rb_insert_unique( &rbtree1, &node2.Node );<br>
><br>
> puts( "INIT - Verify rtems_rbtree_peek_max/min, rtems_rbtree_extract" );<br>
> test_node *t1 = rtems_rbtree_container_of(rtems_rbtree_peek_max(&rbtree1),<br>
> @@ -237,7 +264,7 @@ rtems_task Init(<br>
> puts( "INIT - rtems_rbtree_extract failed");<br>
> rtems_test_exit(0);<br>
> }<br>
> - rtems_rbtree_insert(&rbtree1, p);<br>
> + rb_insert_unique(&rbtree1, p);<br>
><br>
> for ( p = rtems_rbtree_get_min(&rbtree1), id = 1 ; p ;<br>
> p = rtems_rbtree_get_min(&rbtree1) , id++ ) {<br>
> @@ -256,7 +283,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = i;<br>
> node_array[i].key = i;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -289,7 +316,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = 99-i;<br>
> node_array[i].key = 99-i;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -324,7 +351,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = i;<br>
> node_array[i].key = i;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -376,13 +403,13 @@ rtems_task Init(<br>
> node_array[i].id = i;<br>
> node_array[i].key = i;<br>
> }<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[3].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[1].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[5].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[0].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[2].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[4].Node );<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[6].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[3].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[1].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[5].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[0].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[2].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[4].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[6].Node );<br>
> rtems_rbtree_extract( &rbtree1, &node_array[2].Node );<br>
> /* node_array[1] has now only a left child. */<br>
> if ( !node_array[1].Node.child[RBT_LEFT] ||<br>
> @@ -395,7 +422,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = 99-i;<br>
> node_array[i].key = 99-i;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -428,7 +455,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = i;<br>
> node_array[i].key = i;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -436,7 +463,7 @@ rtems_task Init(<br>
><br>
> puts( "INIT - Verify rtems_rbtree_find" );<br>
> search_node.key = 30;<br>
> - p = rtems_rbtree_find(&rbtree1, &search_node.Node);<br>
> + p = rb_find_unique(&rbtree1, &search_node.Node);<br>
> if(rtems_rbtree_container_of(p,test_node,Node)->id != 30) {<br>
> puts ("INIT - ERROR ON RBTREE ID MISMATCH");<br>
> rtems_test_exit(0);<br>
> @@ -448,14 +475,14 @@ rtems_task Init(<br>
> puts ("INIT - ERROR ON RBTREE ID MISMATCH");<br>
> rtems_test_exit(0);<br>
> }<br>
> - p = rtems_rbtree_find(&rbtree1, &search_node.Node);<br>
> + p = rb_find_unique(&rbtree1, &search_node.Node);<br>
> p = rtems_rbtree_successor(p);<br>
> if(p && rtems_rbtree_container_of(p,test_node,Node)->id != 31) {<br>
> puts ("INIT - ERROR ON RBTREE ID MISMATCH");<br>
> rtems_test_exit(0);<br>
> }<br>
><br>
> - p = rtems_rbtree_find(&rbtree1, &search_node.Node);<br>
> + p = rb_find_unique(&rbtree1, &search_node.Node);<br>
> puts( "INIT - Verify rtems_rbtree_find_header" );<br>
> if (rtems_rbtree_find_header(p) != &rbtree1) {<br>
> puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");<br>
> @@ -509,7 +536,7 @@ rtems_task Init(<br>
> for (i = 0; i < 20; i++) {<br>
> node_array[i].id = numbers[i];<br>
> node_array[i].key = numbers[i];<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_unique( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -573,18 +600,13 @@ rtems_task Init(<br>
><br>
> /* Initialize the tree for duplicate keys */<br>
> puts( "Init - Initialize duplicate rbtree empty" );<br>
> - rtems_rbtree_initialize_empty( &rbtree1, &test_compare_function, false );<br>
> -<br>
> - if ( rtems_rbtree_is_unique( &rbtree1 ) )<br>
> - puts( "INIT - FAILED IS UNIQUE CHECK" );<br>
> - if ( rtems_rbtree_is_unique( NULL ) )<br>
> - puts( "INIT - FAILED IS UNIQUE CHECK" );<br>
> + rtems_rbtree_initialize_empty( &rbtree1 );<br>
><br>
> puts( "INIT - Verify rtems_rbtree_insert with 100 nodes value [0,99]" );<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = i;<br>
> node_array[i].key = i%5;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_multi( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -592,7 +614,7 @@ rtems_task Init(<br>
><br>
> puts( "INIT - Verify rtems_rbtree_find in a duplicate tree" );<br>
> search_node.key = 2;<br>
> - p = rtems_rbtree_find(&rbtree1, &search_node.Node);<br>
> + p = rb_find_multi(&rbtree1, &search_node.Node);<br>
> if(rtems_rbtree_container_of(p,test_node,Node)->id != 2) {<br>
> puts ("INIT - ERROR ON RBTREE ID MISMATCH");<br>
> rtems_test_exit(0);<br>
> @@ -625,7 +647,7 @@ rtems_task Init(<br>
> for (i = 0; i < 100; i++) {<br>
> node_array[i].id = 99-i;<br>
> node_array[i].key = (99-i)%5;<br>
> - rtems_rbtree_insert( &rbtree1, &node_array[i].Node );<br>
> + rb_insert_multi( &rbtree1, &node_array[i].Node );<br>
><br>
> if (!rb_assert(rbtree1.root) )<br>
> puts( "INIT - FAILED TREE CHECK" );<br>
> @@ -633,7 +655,7 @@ rtems_task Init(<br>
><br>
> puts( "INIT - Verify rtems_rbtree_find in a duplicate tree" );<br>
> search_node.key = 2;<br>
> - p = rtems_rbtree_find(&rbtree1, &search_node.Node);<br>
> + p = rb_find_multi(&rbtree1, &search_node.Node);<br>
> if(rtems_rbtree_container_of(p,test_node,Node)->id != 97) {<br>
> puts ("INIT - ERROR ON RBTREE ID MISMATCH");<br>
> rtems_test_exit(0);<br>
> --<br>
> 1.8.1.4<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> devel@rtems.org<br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
devel@rtems.org<br>
<a href="http://lists.rtems.org/mailman/listinfo/devel">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</div></font>
</body>
</html>