From 6398a97affb8d2dde90dd77cb65aef8e9827e63d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 27 Jan 2005 19:50:59 +0000 Subject: Mark a couple more function parameters as counters. --- src/glx/x11/indirect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/glx/x11/indirect.c') diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index 3468f0d8b70..d2189090991 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -273,7 +273,7 @@ __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) __GLXcontext * const gc = __glXGetCurrentContext(); const GLuint compsize = __glCallLists_size(type); const GLuint cmdlen = 12 + __GLX_PAD((compsize * n)); - if (__builtin_expect(gc->currentDpy != NULL, 1)) { + if (__builtin_expect((n >= 0) && (gc->currentDpy != NULL), 1)) { if (cmdlen <= gc->maxSmallRenderCommandSize) { if ( (gc->pc + cmdlen) > gc->bufEnd ) { (void) __glXFlushRenderBuffer(gc, gc->pc); @@ -4030,7 +4030,7 @@ __indirect_glGenTextures(GLsizei n, GLuint * textures) __GLXcontext * const gc = __glXGetCurrentContext(); Display * const dpy = gc->currentDpy; const GLuint cmdlen = 4; - if (__builtin_expect(dpy != NULL, 1)) { + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { GLubyte const * pc = setup_single_request(gc, X_GLsop_GenTextures, cmdlen); (void) memcpy((void *)(pc + 0), (void *)(&n), 4); (void) read_reply(dpy, 4, textures, GL_TRUE); @@ -5285,7 +5285,7 @@ __indirect_glGenTexturesEXT(GLsizei n, GLuint * textures) __GLXcontext * const gc = __glXGetCurrentContext(); Display * const dpy = gc->currentDpy; const GLuint cmdlen = 4; - if (__builtin_expect(dpy != NULL, 1)) { + if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) { GLubyte const * pc = setup_vendor_request(gc, X_GLXVendorPrivateWithReply, X_GLvop_GenTexturesEXT, cmdlen); (void) memcpy((void *)(pc + 0), (void *)(&n), 4); (void) read_reply(dpy, 4, textures, GL_TRUE); -- cgit v1.2.3