5
Last change
on this file since 80cf60e was
80cf60e,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32
|
Canonicalize config.h include
Use the following variant which was already used by most source files:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
|
-
Property mode set to
100644
|
File size:
1017 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Initialize a Red-Black Tree |
---|
5 | * @ingroup ClassicRBTrees |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Copyright (c) 2010 Gedare Bloom. |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifdef HAVE_CONFIG_H |
---|
17 | #include "config.h" |
---|
18 | #endif |
---|
19 | |
---|
20 | #include <rtems/rbtree.h> |
---|
21 | #include <rtems/score/address.h> |
---|
22 | |
---|
23 | void rtems_rbtree_initialize( |
---|
24 | rtems_rbtree_control *the_rbtree, |
---|
25 | rtems_rbtree_compare compare, |
---|
26 | void *starting_address, |
---|
27 | size_t number_nodes, |
---|
28 | size_t node_size, |
---|
29 | bool is_unique |
---|
30 | ) |
---|
31 | { |
---|
32 | size_t count; |
---|
33 | rtems_rbtree_node *next; |
---|
34 | |
---|
35 | /* could do sanity checks here */ |
---|
36 | rtems_rbtree_initialize_empty( the_rbtree ); |
---|
37 | |
---|
38 | count = number_nodes; |
---|
39 | next = starting_address; |
---|
40 | |
---|
41 | while ( count-- ) { |
---|
42 | rtems_rbtree_insert( the_rbtree, next, compare, is_unique ); |
---|
43 | next = (rtems_rbtree_node *) _Addresses_Add_offset( next, node_size ); |
---|
44 | } |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.