OSDN Git Service

Fix some build warnings, mostly with XCB.
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 30 Oct 2007 16:47:17 +0000 (17:47 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 30 Oct 2007 16:58:50 +0000 (17:58 +0100)
src/glx/x11/glxext.c
src/glx/x11/indirect.c
src/mesa/glapi/glX_proto_send.py

index 4b78ca8..4fcf6e5 100644 (file)
@@ -1361,7 +1361,8 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
 
     if ( (dpy != NULL) && (size > 0) ) {
 #ifdef USE_XCB
-       xcb_glx_render(c, ctx->currentContextTag, size, (char *)ctx->buf);
+       xcb_glx_render(c, ctx->currentContextTag, size,
+                      (const uint8_t *)ctx->buf);
 #else
        /* Send the entire buffer as an X request */
        LockDisplay(dpy);
index 87c5233..0d66296 100644 (file)
@@ -300,7 +300,9 @@ __indirect_glNewList(GLuint list, GLenum mode)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -324,7 +326,9 @@ __indirect_glEndList(void)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 0;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -393,7 +397,9 @@ __indirect_glDeleteLists(GLuint list, GLsizei range)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -418,7 +424,9 @@ __indirect_glGenLists(GLsizei range)
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
     GLuint retval = (GLuint) 0;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3716,7 +3724,9 @@ __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 28;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3808,7 +3818,9 @@ __indirect_glGetClipPlane(GLenum plane, GLdouble * equation)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3841,7 +3853,9 @@ __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3879,7 +3893,9 @@ __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3917,7 +3933,9 @@ __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3953,7 +3971,9 @@ __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -3989,7 +4009,9 @@ __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4025,7 +4047,9 @@ __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4063,7 +4087,9 @@ __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4101,7 +4127,9 @@ __indirect_glGetPixelMapfv(GLenum map, GLfloat * values)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4137,7 +4165,9 @@ __indirect_glGetPixelMapuiv(GLenum map, GLuint * values)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4174,7 +4204,9 @@ __indirect_glGetPixelMapusv(GLenum map, GLushort * values)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4210,9 +4242,10 @@ void
 __indirect_glGetPolygonStipple(GLubyte *mask)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
-    const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4247,7 +4280,9 @@ __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4285,7 +4320,9 @@ __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4323,7 +4360,9 @@ __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4361,7 +4400,9 @@ __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4399,7 +4440,9 @@ __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4439,7 +4482,9 @@ __indirect_glGetTexImage(GLenum target, GLint level, GLenum format,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 20;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4483,7 +4528,9 @@ __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4522,7 +4569,9 @@ __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4562,7 +4611,9 @@ __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 12;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4603,7 +4654,9 @@ __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 12;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -4644,7 +4697,9 @@ __indirect_glIsList(GLuint list)
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
     GLboolean retval = (GLboolean) 0;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5012,7 +5067,9 @@ __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures,
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
     GLboolean retval = (GLboolean) 0;
+#ifndef USE_XCB
     const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
+#endif
     if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5163,7 +5220,9 @@ __indirect_glDeleteTextures(GLsizei n, const GLuint * textures)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
+#endif
     if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5212,7 +5271,9 @@ __indirect_glGenTextures(GLsizei n, GLuint * textures)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5271,7 +5332,9 @@ __indirect_glIsTexture(GLuint texture)
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
     GLboolean retval = (GLboolean) 0;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5565,7 +5628,9 @@ __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 16;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5641,7 +5706,9 @@ __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -5709,7 +5776,9 @@ __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6029,7 +6098,9 @@ __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 16;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6103,7 +6174,9 @@ __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6171,7 +6244,9 @@ __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6240,7 +6315,9 @@ __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 16;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6319,7 +6396,9 @@ __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6385,7 +6464,9 @@ __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6452,7 +6533,9 @@ __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format,
     __GLXcontext *const gc = __glXGetCurrentContext();
     const __GLXattribute *const state = gc->client_state_private;
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 16;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6526,7 +6609,9 @@ __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname,
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -6589,7 +6674,9 @@ __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8240,7 +8327,9 @@ __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
+#endif
     if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8278,7 +8367,9 @@ __indirect_glGenQueriesARB(GLsizei n, GLuint * ids)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8311,7 +8402,9 @@ __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8347,7 +8440,9 @@ __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8383,7 +8478,9 @@ __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params)
 {
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
+#ifndef USE_XCB
     const GLuint cmdlen = 8;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -8423,7 +8520,9 @@ __indirect_glIsQueryARB(GLuint id)
     __GLXcontext *const gc = __glXGetCurrentContext();
     Display *const dpy = gc->currentDpy;
     GLboolean retval = (GLboolean) 0;
+#ifndef USE_XCB
     const GLuint cmdlen = 4;
+#endif
     if (__builtin_expect(dpy != NULL, 1)) {
 #ifdef USE_XCB
         xcb_connection_t *c = XGetXCBConnection(dpy);
index 1b6a5f3..0fa0f7e 100644 (file)
@@ -511,7 +511,7 @@ generic_%u_byte( GLint rop, const void * ptr )
                return
 
 
-       def common_func_print_just_start(self, f):
+       def common_func_print_just_start(self, f, name):
                print '    __GLXcontext * const gc = __glXGetCurrentContext();'
 
                # The only reason that single and vendor private commands need
@@ -529,7 +529,7 @@ generic_%u_byte( GLint rop, const void * ptr )
 
                if not f.glx_rop:
                        for p in f.parameterIterateOutputs():
-                               if p.is_image():
+                               if p.is_image() and (p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP"):
                                        print '    const __GLXattribute * const state = gc->client_state_private;'
                                        break
 
@@ -545,7 +545,11 @@ generic_%u_byte( GLint rop, const void * ptr )
                        print '    %s retval = (%s) 0;' % (f.return_type, f.return_type)
 
 
+               if name != None and name not in f.glx_vendorpriv_names:
+                       print '#ifndef USE_XCB'
                self.emit_packet_size_calculation(f, 0)
+               if name != None and name not in f.glx_vendorpriv_names:
+                       print '#endif'
 
                condition_list = []
                for p in f.parameterIterateCounters():
@@ -567,7 +571,7 @@ generic_%u_byte( GLint rop, const void * ptr )
 
 
        def printSingleFunction(self, f, name):
-               self.common_func_print_just_start(f)
+               self.common_func_print_just_start(f, name)
 
                if self.debug:
                        print '        printf( "Enter %%s...\\n", "gl%s" );' % (f.name)
@@ -739,7 +743,7 @@ generic_%u_byte( GLint rop, const void * ptr )
                        return
 
 
-               if self.common_func_print_just_start(f):
+               if self.common_func_print_just_start(f, None):
                        trailer = "    }"
                else:
                        trailer = None
@@ -791,7 +795,7 @@ generic_%u_byte( GLint rop, const void * ptr )
                                        print '    generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name)
                                        return
 
-               if self.common_func_print_just_start(f):
+               if self.common_func_print_just_start(f, None):
                        trailer = "    }"
                else:
                        trailer = None