From f1e97dc264c95e515b13db7406c15d46f423488d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 23 Oct 2010 09:32:08 -0600 Subject: [PATCH] mesa: minor reformatting, clean-ups --- src/mesa/main/shaderobj.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h index 5ea8ddc88d0..346a5b75175 100644 --- a/src/mesa/main/shaderobj.h +++ b/src/mesa/main/shaderobj.h @@ -97,11 +97,11 @@ _mesa_init_shader_state(struct gl_context *ctx); extern void _mesa_free_shader_state(struct gl_context *ctx); + static INLINE GLuint _mesa_shader_type_to_index(GLenum v) { - switch(v) - { + switch (v) { case GL_VERTEX_SHADER: return MESA_SHADER_VERTEX; case GL_FRAGMENT_SHADER: @@ -109,25 +109,27 @@ _mesa_shader_type_to_index(GLenum v) case GL_GEOMETRY_SHADER: return MESA_SHADER_GEOMETRY; default: - ASSERT(0); + ASSERT(0 && "bad value in _mesa_shader_type_to_index()"); return ~0; } } + static INLINE GLenum _mesa_shader_index_to_type(GLuint i) { - GLenum enums[MESA_SHADER_TYPES] = { - GL_VERTEX_SHADER, - GL_FRAGMENT_SHADER, - GL_GEOMETRY_SHADER , + static const GLenum enums[MESA_SHADER_TYPES] = { + GL_VERTEX_SHADER, + GL_FRAGMENT_SHADER, + GL_GEOMETRY_SHADER , }; - if(i >= MESA_SHADER_TYPES) + if (i >= MESA_SHADER_TYPES) return 0; else return enums[i]; } + #ifdef __cplusplus } #endif -- 2.30.2