source: rtems/cpukit/score/src/rbtreeextract.c @ fce900b5

5
Last change on this file since fce900b5 was 6d6f6a20, checked in by Sebastian Huber <sebastian.huber@…>, on 10/21/17 at 07:42:30

score: Fix warning

  • Property mode set to 100644
File size: 992 bytes
Line 
1/*
2 *  Copyright (c) 2010 Gedare Bloom.
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.org/license/LICENSE.
7 */
8
9#if HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <rtems/score/rbtreeimpl.h>
14
15RB_GENERATE_REMOVE_COLOR( RBTree_Control, RBTree_Node, Node, static )
16
17RB_GENERATE_REMOVE( RBTree_Control, RBTree_Node, Node, static )
18
19#if defined(RTEMS_DEBUG)
20static const RBTree_Node *_RBTree_Find_root( const RBTree_Node *the_node )
21{
22  while ( true ) {
23    const RBTree_Node *potential_root;
24
25    potential_root = the_node;
26    the_node = _RBTree_Parent( the_node );
27
28    if ( the_node == NULL ) {
29      return potential_root;
30    }
31  }
32}
33#endif
34
35void _RBTree_Extract(
36  RBTree_Control *the_rbtree,
37  RBTree_Node    *the_node
38)
39{
40  _Assert( _RBTree_Find_root( the_node ) == _RBTree_Root( the_rbtree ) );
41  RB_REMOVE( RBTree_Control, the_rbtree, the_node );
42  _RBTree_Initialize_node( the_node );
43}
Note: See TracBrowser for help on using the repository browser.