From: Brian Paul Date: Sat, 23 Oct 2010 15:32:08 +0000 (-0600) Subject: mesa: minor reformatting, clean-ups X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1e97dc264c95e515b13db7406c15d46f423488d;p=mesa.git mesa: minor reformatting, clean-ups --- 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