swrast: Factor out texture slice counting.
[mesa.git] / src / glx / XF86dri.c
index fdbdd43000e1e567c6acaba7e05bfd83cffa4a80..b1cdc9b286538aba0fa73c7366cb6b52e7e397e0 100644 (file)
@@ -36,25 +36,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 /* THIS IS NOT AN X CONSORTIUM STANDARD */
 
-#ifdef GLX_DIRECT_RENDERING
+#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
 
-#define NEED_REPLIES
 #include <X11/Xlibint.h>
+#include <X11/Xfuncproto.h>
 #include <X11/extensions/Xext.h>
 #include <X11/extensions/extutil.h>
 #include "xf86dristr.h"
 
-
-#if defined(__GNUC__)
-#  define PUBLIC __attribute__((visibility("default")))
-#  define USED __attribute__((used))
-#else
-#  define PUBLIC
-#  define USED
-#endif
-
-
-
 static XExtensionInfo _xf86dri_info_data;
 static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
 static char xf86dri_extension_name[] = XF86DRINAME;
@@ -212,7 +201,7 @@ XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
    }
 
    if (rep.length) {
-      if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) {
+      if (!(*busIdString = calloc(rep.busIdStringLength + 1, 1))) {
          _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
@@ -313,7 +302,7 @@ XF86DRIGetClientDriverName(Display * dpy, int screen,
    if (rep.length) {
       if (!
           (*clientDriverName =
-           (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) {
+           calloc(rep.clientDriverNameLength + 1, 1))) {
          _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
@@ -532,7 +521,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
    if (*numClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numClipRects);
 
-      *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+      *pClipRects = calloc(len, 1);
       if (*pClipRects)
          _XRead(dpy, (char *) *pClipRects, len);
    }
@@ -543,7 +532,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
    if (*numBackClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
 
-      *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+      *pBackClipRects = calloc(len, 1);
       if (*pBackClipRects)
          _XRead(dpy, (char *) *pBackClipRects, len);
    }
@@ -593,7 +582,7 @@ XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer,
    *devPrivateSize = rep.devPrivateSize;
 
    if (rep.length) {
-      if (!(*pDevPrivate = (void *) Xcalloc(rep.devPrivateSize, 1))) {
+      if (!(*pDevPrivate = calloc(rep.devPrivateSize, 1))) {
          _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();