]> granicus.if.org Git - graphviz/commitdiff
smyrna mTestgvpr: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:46:04 +0000 (18:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:46:04 +0000 (18:46 -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.

cmd/smyrna/gui/menucallbacks.c

index 3c4846b092442a0f5b4d2f51372445df85a37f02..614989e27c164879f55dfe61396bf47e13fe844f 100644 (file)
@@ -8,6 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <cgraph/alloc.h>
 #include "menucallbacks.h"
 #include "viewport.h"
 #include "tvnodes.h"
@@ -15,7 +16,6 @@
 #include "gvprpipe.h"
 #include "topviewsettings.h"
 #include "gltemplate.h"
-#include <common/memory.h>
 #include <common/const.h>
 #include <cgraph/agxbuf.h>
 #include <assert.h>
@@ -305,7 +305,7 @@ void mTestgvpr(GtkWidget * widget, gpointer user_data)
        argc++;
     } else
        cloneGraph = 0;
-    argv = N_NEW(argc + 1, char *);
+    argv = gv_calloc(argc + 1, sizeof(char*));
     j = 0;
     argv[j++] = "smyrna";
     if (cloneGraph)