aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_heap.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-06 01:12:57 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-06 01:12:57 +0000
commit9fac6b6eefdc9144053f736fd388cb2199a97046 (patch)
tree82740a981b7f6ae973d915aa77797acd9db668b2 /src/util/container_heap.c
parent23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff)
downloadgnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz
gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/util/container_heap.c')
-rw-r--r--src/util/container_heap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/container_heap.c b/src/util/container_heap.c
index c34e220ce..b9cab1e9c 100644
--- a/src/util/container_heap.c
+++ b/src/util/container_heap.c
@@ -30,7 +30,7 @@
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 32
33#define DEBUG 0 33#define EXTRA_CHECKS 0
34 34
35/** 35/**
36 * Node in the heap. 36 * Node in the heap.
@@ -104,7 +104,7 @@ struct GNUNET_CONTAINER_Heap
104}; 104};
105 105
106 106
107#if DEBUG 107#if EXTRA_CHECKS
108/** 108/**
109 * Check if internal invariants hold for the given node. 109 * Check if internal invariants hold for the given node.
110 * 110 *
@@ -401,7 +401,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap)
401 insert_node (heap, heap->root, root->right_child); 401 insert_node (heap, heap->root, root->right_child);
402 } 402 }
403 GNUNET_free (root); 403 GNUNET_free (root);
404#if DEBUG 404#if EXTRA_CHECKS
405 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 405 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
406 (heap->size == heap->root->tree_size + 1)); 406 (heap->size == heap->root->tree_size + 1));
407 CHECK (heap->root); 407 CHECK (heap->root);
@@ -502,7 +502,7 @@ GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node)
502 if (heap->walk_pos == node) 502 if (heap->walk_pos == node)
503 heap->walk_pos = NULL; 503 heap->walk_pos = NULL;
504 GNUNET_free (node); 504 GNUNET_free (node);
505#if DEBUG 505#if EXTRA_CHECKS
506 CHECK (heap->root); 506 CHECK (heap->root);
507 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 507 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
508 (heap->size == heap->root->tree_size + 1)); 508 (heap->size == heap->root->tree_size + 1));
@@ -523,13 +523,13 @@ GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
523 struct GNUNET_CONTAINER_HeapNode *node, 523 struct GNUNET_CONTAINER_HeapNode *node,
524 GNUNET_CONTAINER_HeapCostType new_cost) 524 GNUNET_CONTAINER_HeapCostType new_cost)
525{ 525{
526#if DEBUG 526#if EXTRA_CHECKS
527 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 527 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
528 (heap->size == heap->root->tree_size + 1)); 528 (heap->size == heap->root->tree_size + 1));
529 CHECK (heap->root); 529 CHECK (heap->root);
530#endif 530#endif
531 remove_node (node); 531 remove_node (node);
532#if DEBUG 532#if EXTRA_CHECKS
533 CHECK (heap->root); 533 CHECK (heap->root);
534 GNUNET_assert (((heap->size == 1) && (heap->root == NULL)) || 534 GNUNET_assert (((heap->size == 1) && (heap->root == NULL)) ||
535 (heap->size == heap->root->tree_size + 2)); 535 (heap->size == heap->root->tree_size + 2));
@@ -539,7 +539,7 @@ GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
539 heap->root = node; 539 heap->root = node;
540 else 540 else
541 insert_node (heap, heap->root, node); 541 insert_node (heap, heap->root, node);
542#if DEBUG 542#if EXTRA_CHECKS
543 CHECK (heap->root); 543 CHECK (heap->root);
544 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) || 544 GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
545 (heap->size == heap->root->tree_size + 1)); 545 (heap->size == heap->root->tree_size + 1));