diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-08-03 13:02:58 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-08-05 09:30:37 +0200 |
commit | 60fe374247eba365afb7f1a7055298af575434c7 (patch) | |
tree | c3323eaf5c6939c5c9e4fd64671a443dcd521150 /cpukit/score/src/rbtreeinsert.c | |
parent | Add and use RTEMS_CONTAINER_OF() (diff) | |
download | rtems-60fe374247eba365afb7f1a7055298af575434c7.tar.bz2 |
rbtree: Add and use RBTree_Compare_result
Diffstat (limited to 'cpukit/score/src/rbtreeinsert.c')
-rw-r--r-- | cpukit/score/src/rbtreeinsert.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c index afff1ef5f9..3bccba5aaa 100644 --- a/cpukit/score/src/rbtreeinsert.c +++ b/cpukit/score/src/rbtreeinsert.c @@ -12,6 +12,16 @@ #include <rtems/score/rbtreeimpl.h> +RTEMS_STATIC_ASSERT( + sizeof( RBTree_Compare_result ) >= sizeof( intptr_t ), + RBTree_Compare_result_intptr_t +); + +RTEMS_STATIC_ASSERT( + sizeof( RBTree_Compare_result ) >= sizeof( int32_t ), + RBTree_Compare_result_int32_t +); + /** @brief Validate and fix-up tree properties for a new insert/colored node * * This routine checks and fixes the Red-Black Tree properties based on @@ -77,7 +87,8 @@ RBTree_Node *_RBTree_Insert( } else { /* typical binary search tree insert, descend tree to leaf and insert */ while ( iter_node ) { - int compare_result = ( *compare )( the_node, iter_node ); + RBTree_Compare_result compare_result = + ( *compare )( the_node, iter_node ); if ( is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; |