From: Matthew Fernandez Date: Sat, 3 Sep 2022 18:09:19 +0000 (-0700) Subject: ortho monotonate_trapezoids: use cgraph wrappers for allocation X-Git-Tag: 6.0.1~11^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fd530acfccb0d56becb916d079653b1374f5aed;p=graphviz ortho monotonate_trapezoids: use cgraph wrappers for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- diff --git a/lib/ortho/partition.c b/lib/ortho/partition.c index 6dcbada7a..6122e6715 100644 --- a/lib/ortho/partition.c +++ b/lib/ortho/partition.c @@ -9,7 +9,7 @@ *************************************************************************/ #include "config.h" - +#include #include #include #include @@ -599,11 +599,11 @@ monotonate_trapezoids(int nsegs, segment_t*seg, trap_t* tr, int i, size; int tr_start; int tr_size = TRSIZE(nsegs); - int* visited = N_NEW(tr_size,int); + int* visited = gv_calloc(tr_size, sizeof(int)); - mchain = N_NEW(tr_size, monchain_t); - vert = N_NEW(nsegs+1,vertexchain_t); - mon = N_NEW(nsegs, int); + mchain = gv_calloc(tr_size, sizeof(monchain_t)); + vert = gv_calloc(nsegs + 1, sizeof(vertexchain_t)); + mon = gv_calloc(nsegs, sizeof(int)); /* First locate a trapezoid which lies inside the polygon */ /* and which is triangular */