]> granicus.if.org Git - graphviz/commitdiff
dotgen swap_bezier: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:34:19 +0000 (18:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:39:23 +0000 (18:39 -0700)
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.

lib/dotgen/dotsplines.c

index 2cac2a95cc1c0a452ffca6ec13541961201ba245..d5e7ade1fb55c81b071e81368a936260bf9f9354 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <assert.h>
+#include <cgraph/alloc.h>
 #include <common/memory.h>
 #include <dotgen/dot.h>
 #include <limits.h>
@@ -196,7 +197,7 @@ static void swap_bezier(bezier * old, bezier * new)
     int i, sz;
 
     sz = old->size;
-    list = N_GNEW(sz, pointf);
+    list = gv_calloc(sz, sizeof(pointf));
     lp = list;
     olp = old->list + (sz - 1);
     for (i = 0; i < sz; i++) { /* reverse list of points */