diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-24 13:21:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-24 13:21:58 +0000 |
commit | 7b0de11bc686f2ba876a9d55b438a71c6586ee00 (patch) | |
tree | f6deed68a0e3c88205d756fd05b85702654dfefd /src/util/container_heap.c | |
parent | ffcf7bdcb1149189682572e5f2fe268a1bd9dda2 (diff) | |
download | gnunet-7b0de11bc686f2ba876a9d55b438a71c6586ee00.tar.gz gnunet-7b0de11bc686f2ba876a9d55b438a71c6586ee00.zip |
use static'
'
Diffstat (limited to 'src/util/container_heap.c')
-rw-r--r-- | src/util/container_heap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 16918985d..8c3cb41aa 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -87,7 +87,7 @@ void *GNUNET_CONTAINER_heap_peek (struct GNUNET_CONTAINER_Heap *heap) | |||
87 | return heap->root->element; | 87 | return heap->root->element; |
88 | } | 88 | } |
89 | 89 | ||
90 | int | 90 | static int |
91 | next_power_of_2(int v) | 91 | next_power_of_2(int v) |
92 | { | 92 | { |
93 | v |= v >> 1; | 93 | v |= v >> 1; |
@@ -99,7 +99,8 @@ next_power_of_2(int v) | |||
99 | return v; | 99 | return v; |
100 | } | 100 | } |
101 | 101 | ||
102 | void | 102 | #if 0 |
103 | static void | ||
103 | internal_print (struct GNUNET_CONTAINER_heap_node *root) | 104 | internal_print (struct GNUNET_CONTAINER_heap_node *root) |
104 | { | 105 | { |
105 | fprintf (stdout, "%llu\n", (unsigned long long) root->cost); | 106 | fprintf (stdout, "%llu\n", (unsigned long long) root->cost); |
@@ -115,11 +116,12 @@ internal_print (struct GNUNET_CONTAINER_heap_node *root) | |||
115 | } | 116 | } |
116 | } | 117 | } |
117 | 118 | ||
118 | void | 119 | static void |
119 | printTree (struct GNUNET_CONTAINER_Heap *root) | 120 | printTree (struct GNUNET_CONTAINER_Heap *root) |
120 | { | 121 | { |
121 | internal_print (root->root); | 122 | internal_print (root->root); |
122 | } | 123 | } |
124 | #endif | ||
123 | 125 | ||
124 | struct GNUNET_CONTAINER_Heap * | 126 | struct GNUNET_CONTAINER_Heap * |
125 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder type) | 127 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder type) |
@@ -414,7 +416,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *root) | |||
414 | /* We are removing the last node in the heap! */ | 416 | /* We are removing the last node in the heap! */ |
415 | root->root = NULL; | 417 | root->root = NULL; |
416 | root->traversal_pos = NULL; | 418 | root->traversal_pos = NULL; |
417 | root->size = 0; | 419 | GNUNET_assert (0 == --root->size); |
418 | return ret; | 420 | return ret; |
419 | } | 421 | } |
420 | 422 | ||