dispatch: stop generating separate GLES1 API code.
[mesa.git] / src / mesa / main / shaderobj.h
index 5ea8ddc88d0710b790182f86c55a988b533b1a4f..5470b51d7a039b3cf844fcfbb80b689e60740080 100644 (file)
 #include "main/mtypes.h"
 #include "program/ir_to_mesa.h"
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+
 /**
  * Internal functions
  */
@@ -97,11 +100,11 @@ _mesa_init_shader_state(struct gl_context *ctx);
 extern void
 _mesa_free_shader_state(struct gl_context *ctx);
 
-static INLINE GLuint
+
+static inline gl_shader_type
 _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 +112,27 @@ _mesa_shader_type_to_index(GLenum v)
    case GL_GEOMETRY_SHADER:
       return MESA_SHADER_GEOMETRY;
    default:
-      ASSERT(0);
-      return ~0;
+      ASSERT(0 && "bad value in _mesa_shader_type_to_index()");
+      return MESA_SHADER_TYPES;
    }
 }
 
-static INLINE GLenum
+
+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