mesa: minor reformatting, clean-ups
authorBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 15:32:08 +0000 (09:32 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 23 Oct 2010 16:19:30 +0000 (10:19 -0600)
src/mesa/main/shaderobj.h

index 5ea8ddc..346a5b7 100644 (file)
@@ -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