From: Matthew Fernandez Date: Sat, 10 Sep 2022 03:43:28 +0000 (-0700) Subject: sfdpgen attach_edge_label_coordinates: use cgraph wrapper for allocation X-Git-Tag: 6.0.2~44^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66c408d95467b4d0d5402befd2b08a6d94dcf640;p=graphviz sfdpgen attach_edge_label_coordinates: use cgraph wrapper 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/sfdpgen/spring_electrical.c b/lib/sfdpgen/spring_electrical.c index 5c9f32ba5..3ea60eddb 100644 --- a/lib/sfdpgen/spring_electrical.c +++ b/lib/sfdpgen/spring_electrical.c @@ -1732,12 +1732,11 @@ static void rotate(int n, int dim, double *x, double angle){ } static void attach_edge_label_coordinates(int dim, SparseMatrix A, int n_edge_label_nodes, int *edge_label_nodes, double *x, double *x2){ - int *mask; int i, ii, j, k; int nnodes = 0; double len; - mask = MALLOC(sizeof(int)*A->m); + int *mask = gv_calloc(A->m, sizeof(int)); for (i = 0; i < A->m; i++) mask[i] = 1; for (i = 0; i < n_edge_label_nodes; i++) {