From 7d2d4c70f224129e19d35b23bd86a8a4c3633aef Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sat, 28 Mar 2020 16:32:18 +0100 Subject: [PATCH] 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. --- lib/sfdpgen/PriorityQueue.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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); } } -- 2.40.0