diff --git a/common/cogl-blend-string.c b/common/cogl-blend-string.c index 05fed58b3..c13a24545 100644 --- a/common/cogl-blend-string.c +++ b/common/cogl-blend-string.c @@ -68,9 +68,9 @@ typedef enum _ParserArgState #define DEFINE_COLOR_SOURCE(NAME, NAME_LEN) \ - {.type = COGL_BLEND_STRING_COLOR_SOURCE_ ## NAME, \ - .name = #NAME, \ - .name_len = NAME_LEN} + {/*.type = */COGL_BLEND_STRING_COLOR_SOURCE_ ## NAME, \ + /*.name = */#NAME, \ + /*.name_len = */NAME_LEN} static CoglBlendStringColorSourceInfo blending_color_sources[] = { DEFINE_COLOR_SOURCE (SRC_COLOR, 9), @@ -87,18 +87,18 @@ static CoglBlendStringColorSourceInfo tex_combine_color_sources[] = { }; static CoglBlendStringColorSourceInfo tex_combine_texture_n_color_source = { - .type = COGL_BLEND_STRING_COLOR_SOURCE_TEXTURE_N, - .name = "TEXTURE_N", - .name_len = 0 + /*.type = */COGL_BLEND_STRING_COLOR_SOURCE_TEXTURE_N, + /*.name = */"TEXTURE_N", + /*.name_len = */0 }; #undef DEFINE_COLOR_SOURCE #define DEFINE_FUNCTION(NAME, NAME_LEN, ARGC) \ - { .type = COGL_BLEND_STRING_FUNCTION_ ## NAME, \ - .name = #NAME, \ - .name_len = NAME_LEN, \ - .argc = ARGC } + { /*.type = */COGL_BLEND_STRING_FUNCTION_ ## NAME, \ + /*.name = */#NAME, \ + /*.name_len = */NAME_LEN, \ + /*.argc = */ARGC } /* NB: These must be sorted so any name that's a subset of another * comes later than the longer name. */ diff --git a/common/cogl-primitives.c b/common/cogl-primitives.c index b1a40dfc8..0133b36cf 100644 --- a/common/cogl-primitives.c +++ b/common/cogl-primitives.c @@ -1269,9 +1269,11 @@ void cogl_rectangles (const float *verts, guint n_rects) { - struct _CoglMutiTexturedRect rects[n_rects]; + struct _CoglMutiTexturedRect *rects; int i; + rects = g_alloca (n_rects * sizeof (struct _CoglMutiTexturedRect)); + for (i = 0; i < n_rects; i++) { rects[i].x_1 = verts[i * 4]; @@ -1289,9 +1291,11 @@ void cogl_rectangles_with_texture_coords (const float *verts, guint n_rects) { - struct _CoglMutiTexturedRect rects[n_rects]; + struct _CoglMutiTexturedRect *rects; int i; + rects = g_alloca (n_rects * sizeof (struct _CoglMutiTexturedRect)); + for (i = 0; i < n_rects; i++) { rects[i].x_1 = verts[i * 8]; diff --git a/common/cogl.c b/common/cogl.c index e1796fb5d..9c92cdab7 100644 --- a/common/cogl.c +++ b/common/cogl.c @@ -729,11 +729,13 @@ cogl_read_pixels (int x, GLint viewport[4]; GLint viewport_height; int rowstride = width * 4; - guint8 temprow[rowstride]; + guint8 *temprow; g_return_if_fail (format == COGL_PIXEL_FORMAT_RGBA_8888); g_return_if_fail (source == COGL_READ_PIXELS_COLOR_BUFFER); + temprow = g_alloca (rowstride * sizeof (guint8)); + glGetIntegerv (GL_VIEWPORT, viewport); viewport_height = viewport[3];