]> O.S.I.I.S - jp/vkvg.git/commitdiff
debug:no variable array definition in c
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 9 Sep 2020 12:16:33 +0000 (14:16 +0200)
committerj-p <jp_bruyere@hotmail.com>
Mon, 10 May 2021 06:46:18 +0000 (08:46 +0200)
tests/context.c
tests/surface.c

index 641a357a181b44587622fd07401a4bf4a3e62722..b22da8ab2b4729d5ae8f4450d688b511210996c1 100644 (file)
@@ -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(){
index 3309d4d01b243bbd835cd74c1fb3bd20f9bc7d30..ead2894977ccb3d42e9d80bfb250d2eeac6a82cf 100644 (file)
@@ -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(){