From 9448d85d8f3d021fc1b68ba2bcb4f6c70d6ed953 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 20 Dec 2022 21:22:19 -0800 Subject: [PATCH] smyrna add_camera_to_viewport: remove shadowing of 'view' global --- cmd/smyrna/viewportcamera.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/smyrna/viewportcamera.c b/cmd/smyrna/viewportcamera.c index 501496616..0f6c57fc7 100644 --- a/cmd/smyrna/viewportcamera.c +++ b/cmd/smyrna/viewportcamera.c @@ -21,15 +21,14 @@ static viewport_camera *new_viewport_camera(void) { return gv_alloc(sizeof(viewport_camera)); } -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[view->camera_count - 1] = new_viewport_camera(); - view->active_camera = view->camera_count - 1; - return view->cameras[view->camera_count - 1]; +static viewport_camera *add_camera_to_viewport(ViewInfo *vi) { + vi->cameras = gv_recalloc(vi->cameras, vi->camera_count, + vi->camera_count + 1, + sizeof(viewport_camera*)); + vi->camera_count++; + vi->cameras[vi->camera_count - 1] = new_viewport_camera(); + vi->active_camera = vi->camera_count - 1; + return vi->cameras[vi->camera_count - 1]; } void menu_click_add_camera(void) -- 2.40.0