]> granicus.if.org Git - graphviz/commitdiff
sparse BinaryHeap_sanity_check: squash warnings in release mode
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 10 Jan 2023 16:00:59 +0000 (08:00 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 Jan 2023 17:05:18 +0000 (09:05 -0800)
This code triggered -Wunused-variable warnings.

lib/sparse/BinaryHeap.c

index 36467f2b2a1f95c94872af4afe104412a440b3ff..da3a9917ca65a0f4a185f465423849c6686af10b 100644 (file)
@@ -244,6 +244,8 @@ void BinaryHeap_sanity_check(BinaryHeap h){
   for (size_t i = 1; i < h->len; i++){
     size_t parentPos = ParentPos(i);
     assert((h->cmp)(heap[i], heap[parentPos]) >= 0);
+    (void)heap;
+    (void)parentPos;
   }
 
   mask = CALLOC(h->len + int_stack_size(&h->id_stack), sizeof(mask[0]));
@@ -263,6 +265,7 @@ void BinaryHeap_sanity_check(BinaryHeap h){
     assert(mask[pos_to_id[i]] == 0);/* that id is in use so can't be spare */
     mask[pos_to_id[i]] = 1;
     assert(id_to_pos[pos_to_id[i]] == i);
+    (void)id_to_pos;
   }
 
   /* all IDs, spare or in use, are accounted for and give a contiguous set */