[gtk+] gsk/gskrendernodeimpl.c: Avoid VLAs
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gsk/gskrendernodeimpl.c: Avoid VLAs
- Date: Thu, 29 Dec 2016 09:54:39 +0000 (UTC)
commit 1e084567f919fa902e70e944b0bebb02443d1d36
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Dec 26 12:40:36 2016 +0800
gsk/gskrendernodeimpl.c: Avoid VLAs
Use g_newa() instead of VLAs, as VLAs may never be supported by some
compilers as it became optional in C11 and there are concerns about their
implementations in compilers that do support it.
https://bugzilla.gnome.org/show_bug.cgi?id=773299
gsk/gskrendernodeimpl.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index cade17a..6a632f0 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -247,7 +247,7 @@ gsk_linear_gradient_node_real_deserialize (GVariant *variant,
&iter);
n_stops = g_variant_iter_n_children (iter);
- GskColorStop stops[n_stops];
+ GskColorStop *stops = g_newa (GskColorStop, n_stops);
for (i = 0; i < n_stops; i++)
{
double offset;
@@ -1910,7 +1910,7 @@ gsk_container_node_deserialize (GVariant *variant,
i = 0;
n_children = g_variant_iter_init (&iter, variant);
- GskRenderNode *children[n_children];
+ GskRenderNode **children = g_newa (GskRenderNode *, n_children);
while (g_variant_iter_loop (&iter, "(uv)", &child_type, &child_variant))
{
@@ -2784,7 +2784,7 @@ gsk_shadow_node_deserialize (GVariant *variant,
}
n_shadows = g_variant_iter_n_children (iter);
- GskShadow shadows[n_shadows];
+ GskShadow *shadows = g_newa (GskShadow, n_shadows);
for (i = 0; i < n_shadows; i++)
{
double dx, dy, radius;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]