diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-16 15:44:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-16 15:44:32 +0000 |
commit | 7d1c10c4b0cf298d12eeac4425f27207d28ab428 (patch) | |
tree | ba8c24881610c23fd414a6df03798f13a1d1bed4 /src/util/container_heap.c | |
parent | b7d63eaae6bfb3e72a452d1841e808a0159be173 (diff) | |
download | gnunet-7d1c10c4b0cf298d12eeac4425f27207d28ab428.tar.gz gnunet-7d1c10c4b0cf298d12eeac4425f27207d28ab428.zip |
stuff
Diffstat (limited to 'src/util/container_heap.c')
-rw-r--r-- | src/util/container_heap.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index b5ccd7950..7e41c40f2 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -26,8 +26,7 @@ | |||
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_protocols.h" | 28 | #include "gnunet_protocols.h" |
29 | #include "gnunet_util.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_util_containers.h" | ||
31 | 30 | ||
32 | /* | 31 | /* |
33 | * Struct that is stored in hashmap, pointers to | 32 | * Struct that is stored in hashmap, pointers to |
@@ -65,7 +64,7 @@ struct GNUNET_CONTAINER_Heap | |||
65 | 64 | ||
66 | unsigned int max_size; | 65 | unsigned int max_size; |
67 | 66 | ||
68 | enum type; | 67 | enum GNUNET_CONTAINER_HeapOrder type; |
69 | 68 | ||
70 | struct GNUNET_CONTAINER_heap_node *root; | 69 | struct GNUNET_CONTAINER_heap_node *root; |
71 | 70 | ||
@@ -96,7 +95,7 @@ printTree (struct GNUNET_CONTAINER_Heap *root) | |||
96 | } | 95 | } |
97 | 96 | ||
98 | struct GNUNET_CONTAINER_Heap * | 97 | struct GNUNET_CONTAINER_Heap * |
99 | GNUNET_CONTAINER_heap_create (enum type) | 98 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder type) |
100 | { | 99 | { |
101 | struct GNUNET_CONTAINER_Heap *heap; | 100 | struct GNUNET_CONTAINER_Heap *heap; |
102 | heap = malloc (sizeof (struct GNUNET_CONTAINER_Heap)); | 101 | heap = malloc (sizeof (struct GNUNET_CONTAINER_Heap)); |
@@ -491,7 +490,7 @@ internal_iterator (struct GNUNET_CONTAINER_Heap *root, | |||
491 | return; | 490 | return; |
492 | internal_iterator (root, node->left_child, iterator, cls); | 491 | internal_iterator (root, node->left_child, iterator, cls); |
493 | internal_iterator (root, node->right_child, iterator, cls); | 492 | internal_iterator (root, node->right_child, iterator, cls); |
494 | iterator (node->element, node->cost, root, cls); | 493 | iterator (cls, node->element, node->cost); |
495 | } | 494 | } |
496 | 495 | ||
497 | int | 496 | int |
@@ -519,7 +518,7 @@ GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *root) | |||
519 | 518 | ||
520 | element = root->traversal_pos->element; | 519 | element = root->traversal_pos->element; |
521 | 520 | ||
522 | choice = GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 2); | 521 | choice = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 2); |
523 | 522 | ||
524 | switch (choice) | 523 | switch (choice) |
525 | { | 524 | { |