summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderobj.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-10-23 09:32:08 -0600
committerBrian Paul <[email protected]>2010-10-23 10:19:30 -0600
commitf1e97dc264c95e515b13db7406c15d46f423488d (patch)
tree45b47b70499f30614700afac4c358fe50e177b12 /src/mesa/main/shaderobj.h
parentf5ed39e7e6dd31ea60477475d97d8a5ce6946ccc (diff)
mesa: minor reformatting, clean-ups
Diffstat (limited to 'src/mesa/main/shaderobj.h')
-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