From 6f727f73c5de2c6aec217756f6eb39521585669d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 9 Sep 2020 14:16:33 +0200 Subject: [PATCH] debug:no variable array definition in c --- tests/context.c | 7 ++++--- tests/surface.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/context.c b/tests/context.c index 641a357..b22da8a 100644 --- a/tests/context.c +++ b/tests/context.c @@ -1,11 +1,12 @@ #include "test.h" void create_destroy_multi(){ - VkvgContext ctxs[test_size]; + VkvgContext* ctxs = (VkvgContext*)malloc(sizeof(VkvgContext)*test_size); for (uint32_t i = 0; i < test_size; i++) ctxs[i] = vkvg_create(surf); - for (uint32_t i = 0; i < test_size; i++) - vkvg_destroy(ctxs[i]); + for (uint32_t i = 0; i < test_size; i++) + vkvg_destroy(ctxs[i]); + free(ctxs); } void create_destroy_single(){ diff --git a/tests/surface.c b/tests/surface.c index 3309d4d..ead2894 100644 --- a/tests/surface.c +++ b/tests/surface.c @@ -1,11 +1,12 @@ #include "test.h" -void create_destroy_multi_512(){ - VkvgSurface surfs[test_size]; +void create_destroy_multi_512(){ + VkvgSurface* surfs = (VkvgSurface*)malloc(sizeof(VkvgSurface)*test_size); for (uint32_t i = 0; i < test_size; i++) surfs[i] = vkvg_surface_create (device, 512, 512); for (uint32_t i = 0; i < test_size; i++) vkvg_surface_destroy(surfs[i]); + free(surf); } void create_destroy_single_512(){ -- 2.47.3