[PATCH weston] gl: Don't declare variables in for loop

Bryce Harrington bryce at osg.samsung.com
Mon Nov 21 18:02:42 UTC 2016


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 at osg.samsung.com>
---
 libweston/gl-renderer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 1a8cf67..4077c62 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -2828,6 +2828,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
 	struct gl_renderer *gr = get_renderer(ec);
 	const char *extensions;
 	EGLBoolean ret;
+	unsigned i;
 
 	gr->create_image = (void *) eglGetProcAddress("eglCreateImageKHR");
 	gr->destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR");
@@ -2859,7 +2860,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
 		weston_log("warning: EGL_EXT_buffer_age not supported. "
 			   "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,
 				swap_damage_ext_to_entrypoint[i].extension)) {
 			gr->swap_buffers_with_damage =
-- 
1.9.1



More information about the wayland-devel mailing list