From 6caf34b97e5d22f5910695e30941bea3d0bf2e46 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 21 Jan 2014 22:46:39 -0800 Subject: [PATCH] meta: Move loop variable declaration outside loop. Fixes MSVC build error introduced with commit 69b258cb4636315b4c1aaaceeedd1eed8af98ba8. meta.c(618) : error C2143: syntax error : missing ';' before 'type' meta.c(618) : error C2143: syntax error : missing ')' before 'type' meta.c(618) : error C2065: 'i' : undeclared identifier meta.c(618) : warning C4552: '<' : operator has no effect; expected operator with side-effect meta.c(618) : error C2059: syntax error : ')' meta.c(618) : error C2143: syntax error : missing ';' before '{' meta.c(619) : error C2065: 'i' : undeclared identifier meta.c(620) : error C2065: 'i' : undeclared identifier Signed-off-by: Vinson Lee --- src/mesa/drivers/common/meta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 44fafac6cbb..2443a772366 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -596,6 +596,8 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } if (state & MESA_META_SHADER) { + int i; + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) { save->VertexProgramEnabled = ctx->VertexProgram.Enabled; _mesa_reference_vertprog(ctx, &save->VertexProgram, @@ -615,7 +617,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI, GL_FALSE); } - for (int i = 0; i < MESA_SHADER_STAGES; i++) { + for (i = 0; i < MESA_SHADER_STAGES; i++) { _mesa_reference_shader_program(ctx, &save->Shader[i], ctx->Shader.CurrentProgram[i]); } -- 2.30.2