Changeset 8abbbdde in rtems


Ignore:
Timestamp:
07/21/14 16:29:00 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
3b6352d
Parents:
d7a94693
git-author:
Sebastian Huber <sebastian.huber@…> (07/21/14 16:29:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/22/14 10:31:41)
Message:

rbtree: Do not set node off-tree in extract

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/rbtree.h

    rd7a94693 r8abbbdde  
    242242
    243243/**
    244  *  @brief Extracts (removes) @a the_node from @a the_rbtree.
    245  *
    246  *  This routine extracts (removes) @a the_node from @a the_rbtree.
     244 * @brief Extracts (removes) the node from the red-black tree.
     245 *
     246 * This function does not set the node off-tree.  In case this is desired, then
     247 * call _RBTree_Set_off_rbtree() after the extraction.
     248 *
     249 * In case the node to extract is not a node of the tree, then this function
     250 * yields unpredictable results.
     251 *
     252 * @param[in] the_rbtree The red-black tree control.
     253 * @param[in] the_node The node to extract.
    247254 */
    248255void _RBTree_Extract(
  • cpukit/score/src/rbtreeextract.c

    rd7a94693 r8abbbdde  
    203203  }
    204204
    205   /* Wipe the_node */
    206   _RBTree_Set_off_rbtree( the_node );
    207 
    208205  /* set root to black, if it exists */
    209206  if ( the_rbtree->root )
  • testsuites/sptests/sprbtree01/init.c

    rd7a94693 r8abbbdde  
    141141  rtems_rbtree_initialize_empty( &rbtree1 );
    142142
     143  rtems_rbtree_set_off_rbtree( &node1.Node );
     144  rtems_test_assert( rtems_rbtree_is_node_off_rbtree( &node1.Node ) );
     145
    143146  /* verify that the rbtree insert work */
    144147  puts( "INIT - Verify rtems_rbtree_insert with two nodes" );
     
    150153  rb_insert_unique( &rbtree1, &node2.Node );
    151154
     155  rtems_test_assert( !rtems_rbtree_is_node_off_rbtree( &node1.Node ) );
    152156
    153157  _RBTree_Rotate(NULL, RBT_LEFT);
     
    262266    rtems_test_exit(0);
    263267  }
     268  rtems_test_assert( !rtems_rbtree_is_node_off_rbtree( p ) );
    264269  rb_insert_unique(&rbtree1, p);
    265270
     
    521526  }
    522527
    523   if (rtems_rbtree_find_header(&node_array[0].Node) != NULL) {
    524     puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");
    525     rtems_test_exit(0);
    526   }
    527528  if (rtems_rbtree_find_header(NULL) != NULL) {
    528529    puts ("INIT - ERROR ON RBTREE HEADER MISMATCH");
Note: See TracChangeset for help on using the changeset viewer.