From: Matthew Fernandez Date: Sat, 3 Sep 2022 17:58:35 +0000 (-0700) Subject: ortho orthoEdges: use cgraph wrappers for allocation X-Git-Tag: 6.0.1~11^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0122602fa1a22686ca87c19c0db1a8578c31339;p=graphviz ortho orthoEdges: 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/ortho.c b/lib/ortho/ortho.c index dbfe7bc83..e99bc6cd6 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -1250,7 +1249,7 @@ orthoEdges (Agraph_t* g, int doLbls) Agedge_t* e; snode* sn; snode* dn; - epair_t* es = N_GNEW(agnedges(g), epair_t); + epair_t* es = gv_calloc(agnedges(g), sizeof(epair_t)); cell* start; cell* dest; PointSet* ps = NULL; @@ -1320,7 +1319,7 @@ orthoEdges (Agraph_t* g, int doLbls) } } - route_list = N_NEW (n_edges, route); + route_list = gv_calloc(n_edges, sizeof(route)); qsort(es, n_edges, sizeof(epair_t), (qsort_cmpf) edgecmp);