]> granicus.if.org Git - graphviz/commitdiff
smyrna init_viewport: use cgraph wrapper for allocations
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:14:51 +0000 (18:14 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 01:16:05 +0000 (18:16 -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/viewport.c

index 7aed95dd407de44b5d75308edbeb84482355aaa1..96a227dd05a6c4e263fc758c96d2c7396ae5a177 100644 (file)
@@ -355,7 +355,7 @@ void init_viewport(ViewInfo * view)
     view->fmg.active = 0;
     view->mouse.down = 0;
     view->activeGraph = -1;
-    view->Topview = GNEW(topview);
+    view->Topview = gv_alloc(sizeof(topview));
     view->Topview->fisheyeParams.fs = 0;
     view->Topview->xDot=NULL;
 
@@ -388,7 +388,7 @@ void init_viewport(ViewInfo * view)
     set_viewport_settings_from_template(view, view->systemGraphs.def_attrs);
     view->Topview->Graphdata.GraphFileName = NULL;
     view->colschms = NULL;
-    view->arcball = NEW(ArcBall_t);
+    view->arcball = gv_alloc(sizeof(ArcBall_t));
     view->keymap.down=0;
     load_mouse_actions (view);
     view->refresh.color=1;