gl: Don't declare variables in for loop

Fixes compilation error introduced by 43cea54c:

  libweston/gl-renderer.c:2862:2: error: ‘for’ loop initial declarations
  are only allowed in C99 mode
    for (unsigned i = 0; i < ARRAY_LENGTH(swap_damage_ext_to_entrypoint);
    i++) {
    ^

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Bryce Harrington 8 years ago committed by Daniel Stone
parent 3447619a3a
commit fe0410b0cc
  1. 3
      libweston/gl-renderer.c

@ -2847,6 +2847,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
struct gl_renderer *gr = get_renderer(ec); struct gl_renderer *gr = get_renderer(ec);
const char *extensions; const char *extensions;
EGLBoolean ret; EGLBoolean ret;
unsigned i;
gr->create_image = (void *) eglGetProcAddress("eglCreateImageKHR"); gr->create_image = (void *) eglGetProcAddress("eglCreateImageKHR");
gr->destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR"); gr->destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR");
@ -2878,7 +2879,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
weston_log("warning: EGL_EXT_buffer_age not supported. " weston_log("warning: EGL_EXT_buffer_age not supported. "
"Performance could be affected.\n"); "Performance could be affected.\n");
for (unsigned i = 0; i < ARRAY_LENGTH(swap_damage_ext_to_entrypoint); i++) { for (i = 0; i < ARRAY_LENGTH(swap_damage_ext_to_entrypoint); i++) {
if (weston_check_egl_extension(extensions, if (weston_check_egl_extension(extensions,
swap_damage_ext_to_entrypoint[i].extension)) { swap_damage_ext_to_entrypoint[i].extension)) {
gr->swap_buffers_with_damage = gr->swap_buffers_with_damage =

Loading…
Cancel
Save