From: Matthew Fernandez Date: Fri, 2 Sep 2022 01:44:28 +0000 (-0700) Subject: smyrna new_viewport_camera: use cgraph wrapper for allocation X-Git-Tag: 6.0.1~13^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1a7a6e06b1d2fc2703d88a303613a20efc6e4e9;p=graphviz smyrna new_viewport_camera: 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/cmd/smyrna/viewportcamera.c b/cmd/smyrna/viewportcamera.c index c5b818da2..d4ff9a9bc 100644 --- a/cmd/smyrna/viewportcamera.c +++ b/cmd/smyrna/viewportcamera.c @@ -12,7 +12,6 @@ #include "viewportcamera.h" #include "gui.h" #include -#include #include #include #include @@ -25,9 +24,10 @@ static viewport_camera *new_viewport_camera(ViewInfo * view) static viewport_camera *add_camera_to_viewport(ViewInfo * view) { + view->cameras = gv_recalloc(view->cameras, view->camera_count, + view->camera_count + 1, + sizeof(viewport_camera*)); view->camera_count++; - view->cameras = - RALLOC(view->camera_count, view->cameras, viewport_camera *); view->cameras[view->camera_count - 1] = new_viewport_camera(view); view->active_camera = view->camera_count - 1; return view->cameras[view->camera_count - 1];