glx: Sync <GL/glxext.h> with Khronos
[mesa.git] / src / gallium / state_trackers / glx / xlib / glx_api.c
index 3bd07c280d0d34c12ab0c4e4fae6195138aedea5..748efea864926639fd491fc0cfb6cde3c9e7ab02 100644 (file)
@@ -39,6 +39,9 @@
 #include <GL/glxproto.h>
 
 #include "xm_api.h"
+#include "main/imports.h"
+#include "main/errors.h"
+#include "util/u_math.h"
 
 /* An "Atrribs/Attribs" typo was fixed in glxproto.h in Nov 2014.
  * This is in case we don't have the updated header.
@@ -417,9 +420,9 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
     * 10 bits per color channel.  Mesa's limited to a max of 8 bits/channel.
     */
    if (vis && depth > 24 && (xclass==TrueColor || xclass==DirectColor)) {
-      if (_mesa_bitcount((GLuint) vis->red_mask  ) <= 8 &&
-          _mesa_bitcount((GLuint) vis->green_mask) <= 8 &&
-          _mesa_bitcount((GLuint) vis->blue_mask ) <= 8) {
+      if (util_bitcount((GLuint) vis->red_mask  ) <= 8 &&
+          util_bitcount((GLuint) vis->green_mask) <= 8 &&
+          util_bitcount((GLuint) vis->blue_mask ) <= 8) {
          return vis;
       }
       else {
@@ -2492,7 +2495,7 @@ glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf)
 }
 
 
-PUBLIC int
+PUBLIC void
 glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute,
                        unsigned int *value)
 {
@@ -2500,7 +2503,7 @@ glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute,
 
    if (!xmbuf) {
       /* Generate GLXBadPbufferSGIX for bad pbuffer */
-      return 0;
+      return;
    }
 
    switch (attribute) {
@@ -2522,7 +2525,6 @@ glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute,
       default:
          *value = 0;
    }
-   return 0;
 }
 
 
@@ -2651,7 +2653,7 @@ glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer,
 
 PUBLIC Status
 glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay,
-                          long *pTransparent)
+                          unsigned long *pTransparent)
 {
    (void) dpy;
    (void) overlay;