mesa: Fix const correctness of API implementation functions.
authorPaul Berry <stereotype441@gmail.com>
Tue, 6 Nov 2012 15:26:56 +0000 (07:26 -0800)
committerPaul Berry <stereotype441@gmail.com>
Mon, 12 Nov 2012 18:53:57 +0000 (10:53 -0800)
This patch changes the use of const in the type signatures of
_mesa_ShaderSource() and _mesa_TransformFeedbackVaryings(), to match
the type signatures in the GL spec.  This avoids warnings when
building the code-generated api_exec.c file.

Note: previously we avoided the build warnings because these functions
were being type-checked against ShaderSourceARB and
TransformFeedbackVaryingsEXT; those functions are semantically
equivalent, but have fewer const qualifiers in their type signatures.

Acked-by: Brian Paul <brianp@vmware.com>
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h
src/mesa/main/transformfeedback.c
src/mesa/main/transformfeedback.h

index 2d93e90a2a144e24a748d205b5e20809aee22fbb..7271150154a9e3b830a8b568ba1a77dc8be4c46f 100644 (file)
@@ -1292,7 +1292,7 @@ read_shader(const char *fname)
  */
 void GLAPIENTRY
 _mesa_ShaderSource(GLhandleARB shaderObj, GLsizei count,
-                      const GLcharARB ** string, const GLint * length)
+                      const GLcharARB * const * string, const GLint * length)
 {
    GET_CURRENT_CONTEXT(ctx);
    GLint *offsets;
index 64798bc2e23721585a418c7069f97da4d3e29ef1..8ee68d82da352a7dd74e0f7ee3e20cebd3dd7953 100644 (file)
@@ -112,7 +112,7 @@ extern void GLAPIENTRY
 _mesa_LinkProgram(GLhandleARB programObj);
 
 extern void GLAPIENTRY
-_mesa_ShaderSource(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+_mesa_ShaderSource(GLhandleARB, GLsizei, const GLcharARB* const *, const GLint *);
 
 extern void GLAPIENTRY
 _mesa_UseProgram(GLhandleARB);
index 52cb065c296398a84f8df6cc238cf127c6a24a51..e0dd4e886e9e4c1cf63bd1bf07d0ab09d9cc0e77 100644 (file)
@@ -512,7 +512,8 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
  */
 void GLAPIENTRY
 _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
-                                const GLchar **varyings, GLenum bufferMode)
+                                const GLchar * const *varyings,
+                                GLenum bufferMode)
 {
    struct gl_shader_program *shProg;
    GLint i;
index dec11ffa0d1cf49bc2968053b35218543bf6c7ec..01c2af3599be63660a8f31563b579bd15058d21b 100644 (file)
@@ -73,7 +73,8 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
 
 extern void GLAPIENTRY
 _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
-                                const GLchar **varyings, GLenum bufferMode);
+                                const GLchar * const *varyings,
+                                GLenum bufferMode);
 
 extern void GLAPIENTRY
 _mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,