glsl: Generate compile errors for explicit blend indices < 0 or > 1.
[mesa.git] / src / glx / single2.c
index a1461956b993e3d392f4d5adc5209c2abffa533a..993ad3647f9ad3c0c7c12037e48c053e62db0f2a 100644 (file)
@@ -35,8 +35,6 @@
 #include "glxextensions.h"
 #include "indirect.h"
 #include "indirect_vertex_array.h"
-#include "glapitable.h"
-#include "glapidispatch.h"
 #include "glapi.h"
 #ifdef USE_XCB
 #include <xcb/xcb.h>
@@ -156,7 +154,7 @@ __indirect_glGetError(void)
  * On success \c GL_TRUE is returned.  Otherwise, \c GL_FALSE is returned.
  */
 static GLboolean
-get_client_data(__GLXcontext * gc, GLenum cap, GLintptr * data)
+get_client_data(struct glx_context * gc, GLenum cap, GLintptr * data)
 {
    GLboolean retval = GL_TRUE;
    __GLXattribute *state = (__GLXattribute *) (gc->client_state_private);
@@ -646,7 +644,7 @@ version_from_string(const char *ver, int *major_version, int *minor_version)
 const GLubyte *
 __indirect_glGetString(GLenum name)
 {
-   __GLXcontext *gc = __glXGetCurrentContext();
+   struct glx_context *gc = __glXGetCurrentContext();
    Display *dpy = gc->currentDpy;
    GLubyte *s = NULL;
 
@@ -723,7 +721,7 @@ __indirect_glGetString(GLenum name)
                 */
                const size_t size = 7 + strlen((char *) s) + 4;
 
-               gc->version = Xmalloc(size);
+               gc->version = malloc(size);
                if (gc->version == NULL) {
                   /* If we couldn't allocate memory for the new string,
                    * make a best-effort and just copy the client-side version
@@ -739,7 +737,7 @@ __indirect_glGetString(GLenum name)
                else {
                   snprintf((char *) gc->version, size, "%u.%u (%s)",
                            client_major, client_minor, s);
-                  Xfree(s);
+                  free(s);
                   s = gc->version;
                }
             }
@@ -784,7 +782,7 @@ __indirect_glGetString(GLenum name)
 #endif
 
             __glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
-            XFree(s);
+            free(s);
             s = gc->extensions;
             break;
          }
@@ -837,7 +835,7 @@ __indirect_glIsEnabled(GLenum cap)
 void
 __indirect_glGetPointerv(GLenum pname, void **params)
 {
-   __GLXcontext *gc = __glXGetCurrentContext();
+   struct glx_context *gc = __glXGetCurrentContext();
    __GLXattribute *state = (__GLXattribute *) (gc->client_state_private);
    Display *dpy = gc->currentDpy;
 
@@ -885,10 +883,9 @@ GLboolean
 __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures,
                                  GLboolean * residences)
 {
-   __GLXcontext *const gc = __glXGetCurrentContext();
+   struct glx_context *const gc = __glXGetCurrentContext();
    Display *const dpy = gc->currentDpy;
    GLboolean retval = (GLboolean) 0;
-   const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
    if (__builtin_expect((n >= 0) && (dpy != NULL), 1)) {
 #ifdef USE_XCB
       xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -904,6 +901,7 @@ __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures,
       retval = reply->ret_val;
       free(reply);
 #else
+      const GLuint cmdlen = 4 + __GLX_PAD((n * 4));
       GLubyte const *pc =
          __glXSetupSingleRequest(gc, X_GLsop_AreTexturesResident, cmdlen);
       (void) memcpy((void *) (pc + 0), (void *) (&n), 4);
@@ -941,14 +939,17 @@ GLboolean
 glAreTexturesResidentEXT(GLsizei n, const GLuint * textures,
                          GLboolean * residences)
 {
-   __GLXcontext *const gc = __glXGetCurrentContext();
+   struct glx_context *const gc = __glXGetCurrentContext();
 
    if (gc->isDirect) {
-      return CALL_AreTexturesResident(GET_DISPATCH(),
-                                      (n, textures, residences));
+      const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
+      PFNGLARETEXTURESRESIDENTEXTPROC p =
+         (PFNGLARETEXTURESRESIDENTEXTPROC) table[332];
+
+      return p(n, textures, residences);
    }
    else {
-      __GLXcontext *const gc = __glXGetCurrentContext();
+      struct glx_context *const gc = __glXGetCurrentContext();
       Display *const dpy = gc->currentDpy;
       GLboolean retval = (GLboolean) 0;
       const GLuint cmdlen = 4 + __GLX_PAD((n * 4));