From: Magnus Jacobsson Date: Sat, 7 Nov 2020 12:57:56 +0000 (+0100) Subject: Correct assertion and remove 1 -Wparentheses warning in BinaryHeap.c X-Git-Tag: 2.46.0~11^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce87e3bad55a884fe02fa650077e409758c2b828;p=graphviz Correct assertion and remove 1 -Wparentheses warning in BinaryHeap.c Note the operator is changed from assigment to *inequality*. From the surrounding code it's apparent that the intent was to check that no -1 values are left in the mask array (equality to 1 would also have been correct). --- diff --git a/lib/sparse/BinaryHeap.c b/lib/sparse/BinaryHeap.c index 2720ace09..4062e5a1c 100644 --- a/lib/sparse/BinaryHeap.c +++ b/lib/sparse/BinaryHeap.c @@ -266,7 +266,7 @@ void BinaryHeap_sanity_check(BinaryHeap h){ } /* all IDs, spare or in use, are ccounted for and give a contiguous set */ - for (i = 0; i < h->len + IntStack_get_length(h->id_stack); i++) assert(mask[i] =- 1); + for (i = 0; i < h->len + IntStack_get_length(h->id_stack); i++) assert(mask[i] != -1); FREE(mask); }