From: Matthew Fernandez Date: Mon, 5 Sep 2022 15:48:51 +0000 (-0700) Subject: label doxlabel: use cgraph wrappers for allocation X-Git-Tag: 6.0.1~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac01e4621c9fa48d63d7b5e2264e33b93ae16ea3;p=graphviz label doxlabel: 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/label/nrtmain.c b/lib/label/nrtmain.c index b363aa356..d19d96061 100644 --- a/lib/label/nrtmain.c +++ b/lib/label/nrtmain.c @@ -11,9 +11,8 @@ #include #include #include - +#include #include -#include #include #include @@ -128,8 +127,8 @@ int doxlabel(opts_t * opts) } n_objs = agnnodes(gp) + n_elbls; n_lbls = n_nlbls + n_elbls; - objp = objs = N_NEW(n_objs, object_t); - xlp = lbls = N_NEW(n_lbls, xlabel_t); + objp = objs = gv_calloc(n_objs, sizeof(object_t)); + xlp = lbls = gv_calloc(n_lbls, sizeof(xlabel_t)); bb.LL = pointfof(INT_MAX, INT_MAX); bb.UR = pointfof(-INT_MAX, -INT_MAX);