Mesa (mesa_7_6_branch): mesa: make max_buffer_index() a non-static function

Brian Paul brianp at kemper.freedesktop.org
Mon Sep 21 20:26:29 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 44d260329efaea2bc844afa42fb1b4f882ab74fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=44d260329efaea2bc844afa42fb1b4f882ab74fd

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Sep 21 14:07:35 2009 -0600

mesa: make max_buffer_index() a non-static function

---

 src/mesa/main/api_validate.c |   16 ++++++++--------
 src/mesa/main/api_validate.h |    6 ++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 2df4f17..507e21f 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -54,10 +54,10 @@ index_bytes(GLenum type, GLsizei count)
 /**
  * Find the max index in the given element/index buffer
  */
-static GLuint
-max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
-                 const void *indices,
-                 struct gl_buffer_object *elementBuf)
+GLuint
+_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
+                       const void *indices,
+                       struct gl_buffer_object *elementBuf)
 {
    const GLubyte *map = NULL;
    GLuint max = 0;
@@ -179,8 +179,8 @@ _mesa_validate_DrawElements(GLcontext *ctx,
 
    if (ctx->Const.CheckArrayBounds) {
       /* find max array index */
-      GLuint max = max_buffer_index(ctx, count, type, indices,
-                                    ctx->Array.ElementArrayBufferObj);
+      GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
+                                          ctx->Array.ElementArrayBufferObj);
       if (max >= ctx->Array.ArrayObj->_MaxElement) {
          /* the max element is out of bounds of one or more enabled arrays */
          _mesa_warning(ctx, "glDrawElements() index=%u is "
@@ -251,8 +251,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
    }
 
    if (ctx->Const.CheckArrayBounds) {
-      GLuint max = max_buffer_index(ctx, count, type, indices,
-                                    ctx->Array.ElementArrayBufferObj);
+      GLuint max = _mesa_max_buffer_index(ctx, count, type, indices,
+                                          ctx->Array.ElementArrayBufferObj);
       if (max >= ctx->Array.ArrayObj->_MaxElement) {
          /* the max element is out of bounds of one or more enabled arrays */
          return GL_FALSE;
diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h
index 10f0c34..ff82a29 100644
--- a/src/mesa/main/api_validate.h
+++ b/src/mesa/main/api_validate.h
@@ -30,6 +30,12 @@
 
 #include "mtypes.h"
 
+
+extern GLuint
+_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type,
+                       const void *indices,
+                       struct gl_buffer_object *elementBuf);
+
 extern GLboolean
 _mesa_validate_DrawArrays(GLcontext *ctx,
 			  GLenum mode, GLint start, GLsizei count);




More information about the mesa-commit mailing list