From: Jean-Philippe Bruyère Date: Wed, 9 Sep 2020 12:16:33 +0000 (+0200) Subject: debug:no variable array definition in c X-Git-Tag: v0.2.0~78 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d066c95b9482c3b710ab4029237dafd85b1111a8;p=jp%2Fvkvg.git debug:no variable array definition in c --- 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(){