diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-08-21 05:24:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-08-31 09:59:42 +0200 |
commit | 2d48456ef55717224065d21c6c3b837c816a69c1 (patch) | |
tree | 9b2d7a4d9894280bfb2fee6e9fedd1b3c99e0560 /cpukit | |
parent | rbtree: Delete _RBTree_Is_first() (diff) | |
download | rtems-2d48456ef55717224065d21c6c3b837c816a69c1.tar.bz2 |
rbheap: Drop direction from _RBTree_Iterate()
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/src/resource_snapshot.c | 3 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/rbtreeimpl.h | 4 | ||||
-rw-r--r-- | cpukit/score/src/rbtreeiterate.c | 8 |
3 files changed, 3 insertions, 12 deletions
diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c index 5475139535..d6f2e4606e 100644 --- a/cpukit/libcsupport/src/resource_snapshot.c +++ b/cpukit/libcsupport/src/resource_snapshot.c @@ -107,14 +107,12 @@ static void get_heap_info(Heap_Control *heap, Heap_Information_block *info) static bool count_posix_key_value_pairs( const RBTree_Node *node, - RBTree_Direction dir, void *visitor_arg ) { uint32_t *count = visitor_arg; (void) node; - (void) dir; ++(*count); @@ -128,7 +126,6 @@ static uint32_t get_active_posix_key_value_pairs(void) _Thread_Disable_dispatch(); _RBTree_Iterate( &_POSIX_Keys_Key_value_lookup_tree, - RBT_LEFT, count_posix_key_value_pairs, &count ); diff --git a/cpukit/score/include/rtems/score/rbtreeimpl.h b/cpukit/score/include/rtems/score/rbtreeimpl.h index ed4cbd558a..607e7ebf84 100644 --- a/cpukit/score/include/rtems/score/rbtreeimpl.h +++ b/cpukit/score/include/rtems/score/rbtreeimpl.h @@ -37,7 +37,6 @@ extern "C" { * @brief Red-black tree visitor. * * @param[in] node The node. - * @param[in] dir The direction. * @param[in] visitor_arg The visitor argument. * * @retval true Stop the iteration. @@ -47,7 +46,6 @@ extern "C" { */ typedef bool (*RBTree_Visitor)( const RBTree_Node *node, - RBTree_Direction dir, void *visitor_arg ); @@ -55,13 +53,11 @@ typedef bool (*RBTree_Visitor)( * @brief Red-black tree iteration. * * @param[in] rbtree The red-black tree. - * @param[in] dir The direction. * @param[in] visitor The visitor. * @param[in] visitor_arg The visitor argument. */ void _RBTree_Iterate( const RBTree_Control *rbtree, - RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ); diff --git a/cpukit/score/src/rbtreeiterate.c b/cpukit/score/src/rbtreeiterate.c index 8b5da1ea9f..46a0e43fcd 100644 --- a/cpukit/score/src/rbtreeiterate.c +++ b/cpukit/score/src/rbtreeiterate.c @@ -28,18 +28,16 @@ void _RBTree_Iterate( const RBTree_Control *rbtree, - RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { - RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); - const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); + const RBTree_Node *current = _RBTree_Minimum( rbtree ); bool stop = false; while ( !stop && current != NULL ) { - stop = ( *visitor )( current, dir, visitor_arg ); + stop = ( *visitor )( current, visitor_arg ); - current = _RBTree_Next( current, dir ); + current = _RBTree_Successor( current ); } } |