mesa: use switch in _mesa_DeletePrograms()
authorBrian Paul <brianp@vmware.com>
Fri, 22 Jan 2010 23:18:56 +0000 (16:18 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 22 Jan 2010 23:18:56 +0000 (16:18 -0700)
src/mesa/shader/arbprogram.c

index 3cb26109508ea5d1b79cb6efe15c06cc4ad74e6b..b1915f096ef4ec1c3a038c21f0c46800ff982e1e 100644 (file)
@@ -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;
             }