[gtk] testsuite/gtk/[flatten|sort]listmodel.c: Avoid VLA usage



commit 1ca906008ecfd94077a0fe1c607f13a8de83d4b8
Author: Chun-wei Fan <fanc999 yahoo com tw>
Date:   Tue Oct 9 16:22:28 2018 +0800

    testsuite/gtk/[flatten|sort]listmodel.c: Avoid VLA usage
    
    Visual Studio is unlikely to support VLAs at any point, so avoid using
    them and use g_newa() instead.

 testsuite/gtk/flattenlistmodel.c | 2 +-
 testsuite/gtk/sortlistmodel.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/testsuite/gtk/flattenlistmodel.c b/testsuite/gtk/flattenlistmodel.c
index f522f1e121..c06e30b350 100644
--- a/testsuite/gtk/flattenlistmodel.c
+++ b/testsuite/gtk/flattenlistmodel.c
@@ -61,7 +61,7 @@ splice (GListStore *store,
         guint      *numbers,
         guint       added)
 {
-  GObject *objects[added];
+  GObject **objects = g_newa (GObject *, added);
   guint i;
 
   for (i = 0; i < added; i++)
diff --git a/testsuite/gtk/sortlistmodel.c b/testsuite/gtk/sortlistmodel.c
index 31a6711f04..1b54d0b976 100644
--- a/testsuite/gtk/sortlistmodel.c
+++ b/testsuite/gtk/sortlistmodel.c
@@ -56,7 +56,7 @@ splice (GListStore *store,
         guint      *numbers,
         guint       added)
 {
-  GObject *objects[added];
+  GObject **objects = g_newa (GObject *, added);
   guint i;
 
   for (i = 0; i < added; i++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]