From: Henrik Grimler Date: Sat, 28 Mar 2020 15:32:18 +0000 (+0100) Subject: lib/sfdpgen: include malloc.h in PriorityQueue.c to define free X-Git-Tag: stable_release_2.44.0~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d2d4c70f224129e19d35b23bd86a8a4c3633aef;p=graphviz lib/sfdpgen: include malloc.h in PriorityQueue.c to define free Works now that lib/cgraph/malloc.h is not included. Since we get the `free` definition from malloc.h we also do not need `#define FREE free` and friends. --- diff --git a/lib/sfdpgen/PriorityQueue.c b/lib/sfdpgen/PriorityQueue.c index cc4803826..1c4c7072f 100644 --- a/lib/sfdpgen/PriorityQueue.c +++ b/lib/sfdpgen/PriorityQueue.c @@ -11,6 +11,8 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ +#include + #include "LinkedList.h" #include "PriorityQueue.h" #include "memory.h" @@ -18,12 +20,6 @@ #include "assert.h" #include "arith.h" -#define MALLOC gmalloc -#define REALLOC grealloc -#define FREE free -#define MEMCPY memcpy - - PriorityQueue PriorityQueue_new(int n, int ngain){ PriorityQueue q; int i; @@ -50,15 +46,15 @@ void PriorityQueue_delete(PriorityQueue q){ if (q){ if (q->buckets){ for (i = 0; i < q->ngain+1; i++) DoubleLinkedList_delete((q->buckets)[i], free); - FREE(q->buckets); + free(q->buckets); } if (q->where){ - FREE(q->where); + free(q->where); } - FREE(q->gain); - FREE(q); + free(q->gain); + free(q); } }