From ffe4e2a6677beecf1e724f4a64100b24e0b05970 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Jan 2010 16:18:56 -0700 Subject: [PATCH] mesa: use switch in _mesa_DeletePrograms() --- src/mesa/shader/arbprogram.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 3cb26109508..b1915f096ef 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -180,23 +180,24 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) } else if (prog) { /* Unbind program if necessary */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB || /* == GL_VERTEX_PROGRAM_NV */ - prog->Target == GL_VERTEX_STATE_PROGRAM_NV) { + switch (prog->Target) { + case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ + case GL_VERTEX_STATE_PROGRAM_NV: if (ctx->VertexProgram.Current && ctx->VertexProgram.Current->Base.Id == ids[i]) { /* unbind this currently bound program */ _mesa_BindProgram(prog->Target, 0); } - } - else if (prog->Target == GL_FRAGMENT_PROGRAM_NV || - prog->Target == GL_FRAGMENT_PROGRAM_ARB) { + break; + case GL_FRAGMENT_PROGRAM_NV: + case GL_FRAGMENT_PROGRAM_ARB: if (ctx->FragmentProgram.Current && ctx->FragmentProgram.Current->Base.Id == ids[i]) { /* unbind this currently bound program */ _mesa_BindProgram(prog->Target, 0); } - } - else { + break; + default: _mesa_problem(ctx, "bad target in glDeleteProgramsNV"); return; } -- 2.30.2