From: Matthew Fernandez Date: Fri, 2 Sep 2022 01:37:24 +0000 (-0700) Subject: smyrna makeGraph: use cgraph wrapper for allocations X-Git-Tag: 6.0.1~13^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee28656539f4eaabc4fab910414a2964122207ab;p=graphviz smyrna makeGraph: use cgraph wrapper for allocations 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/cmd/smyrna/topfisheyeview.c b/cmd/smyrna/topfisheyeview.c index 43ad3715e..4363157cd 100644 --- a/cmd/smyrna/topfisheyeview.c +++ b/cmd/smyrna/topfisheyeview.c @@ -8,7 +8,7 @@ * Contributors: Details at https://graphviz.org *************************************************************************/ #include "topfisheyeview.h" - +#include #include #include #include "viewport.h" @@ -54,9 +54,9 @@ static v_data *makeGraph(Agraph_t* gg, int *nedges) int i; int ne = agnedges(gg); int nv = agnnodes(gg); - v_data *graph = N_NEW(nv, v_data); - int *edges = N_NEW(2 * ne + nv, int); /* reserve space for self loops */ - float *ewgts = N_NEW(2 * ne + nv, float); + v_data *graph = gv_calloc(nv, sizeof(v_data)); + int *edges = gv_calloc(2 * ne + nv, sizeof(int)); /* reserve space for self loops */ + float *ewgts = gv_calloc(2 * ne + nv, sizeof(float)); Agnode_t *np; Agedge_t *ep; Agraph_t *g = NULL;