summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/shaderobj.h18
1 files 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