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

index 138c2104791025e71b02d4c17f08c9d56452ba5e..c5b818da29f56e991b6379051ce2775b827c47de 100644 (file)
@@ -8,6 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <cgraph/alloc.h>
 #include "viewportcamera.h"
 #include "gui.h"
 #include <math.h>
@@ -19,7 +20,7 @@
 
 static viewport_camera *new_viewport_camera(ViewInfo * view)
 {
-    return NEW(viewport_camera);
+    return gv_alloc(sizeof(viewport_camera));
 }
 
 static viewport_camera *add_camera_to_viewport(ViewInfo * view)