summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-01-22 16:18:56 -0700
committerBrian Paul <[email protected]>2010-01-22 16:18:56 -0700
commitffe4e2a6677beecf1e724f4a64100b24e0b05970 (patch)
treef4a262505881d180cb2f4a2f1c7479f02e572d21 /src
parent7b5ad23c7f7f9016f725cb1caa3cf8971aeedbc8 (diff)
mesa: use switch in _mesa_DeletePrograms()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/arbprogram.c15
1 files 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;
}