Remove Xcalloc/Xmalloc/Xfree calls
authorMatt Turner <mattst88@gmail.com>
Wed, 5 Sep 2012 05:52:36 +0000 (22:52 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 6 Sep 2012 05:28:49 +0000 (22:28 -0700)
These calls allowed Xlib to use a custom memory allocator, but Xlib has
used the standard C library functions since at least its initial import
into git in 2003. It seems unlikely that it will grow a custom memory
allocator. The functions now just add extra overhead. Replacing them
will make future Coccinelle patches simpler.

This patch has been generated by the following Coccinelle semantic
patch:

// Remove Xcalloc/Xmalloc/Xfree calls

@@ expression E1, E2; @@
- Xcalloc (E1, E2)
+ calloc (E1, E2)

@@ expression E; @@
- Xmalloc (E)
+ malloc (E)

@@ expression E; @@
- Xfree (E)
+ free (E)

@@ expression E; @@
- XFree (E)
+ free (E)

Reviewed-by: Brian Paul <brianp@vmware.com>
31 files changed:
src/egl/drivers/glx/egl_glx.c
src/gallium/state_trackers/egl/x11/glxinit.c
src/gallium/state_trackers/egl/x11/x11_screen.c
src/gallium/state_trackers/glx/xlib/glx_api.c
src/gallium/state_trackers/xvmc/context.c
src/gallium/state_trackers/xvmc/subpicture.c
src/gallium/state_trackers/xvmc/tests/test_subpicture.c
src/gallium/state_trackers/xvmc/tests/testlib.c
src/gallium/targets/graw-xlib/graw_xlib.c
src/glx/XF86dri.c
src/glx/apple/glxreply.c
src/glx/applegl_glx.c
src/glx/clientattrib.c
src/glx/clientinfo.c
src/glx/dri2.c
src/glx/dri2_glx.c
src/glx/dri_common.c
src/glx/dri_glx.c
src/glx/drisw_glx.c
src/glx/glx_pbuffer.c
src/glx/glx_query.c
src/glx/glxcmds.c
src/glx/glxext.c
src/glx/glxextensions.c
src/glx/indirect_glx.c
src/glx/render2.c
src/glx/renderpix.c
src/glx/single2.c
src/glx/singlepix.c
src/glx/xfont.c
src/mesa/drivers/x11/fakeglx.c

index 607185354f2d8e772ddf0d928159650b882e86ee..7181145ae89922fa0c7743fa12f979647d3bccf8 100644 (file)
@@ -656,9 +656,9 @@ GLX_eglTerminate(_EGLDriver *drv, _EGLDisplay *disp)
    _eglCleanupDisplay(disp);
 
    if (GLX_dpy->visuals)
    _eglCleanupDisplay(disp);
 
    if (GLX_dpy->visuals)
-      XFree(GLX_dpy->visuals);
+      free(GLX_dpy->visuals);
    if (GLX_dpy->fbconfigs)
    if (GLX_dpy->fbconfigs)
-      XFree(GLX_dpy->fbconfigs);
+      free(GLX_dpy->fbconfigs);
 
    if (!disp->PlatformDisplay)
       XCloseDisplay(GLX_dpy->dpy);
 
    if (!disp->PlatformDisplay)
       XCloseDisplay(GLX_dpy->dpy);
@@ -909,7 +909,7 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
       if (vinfo) {
          GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
                vinfo, GLX_surf->drawable);
       if (vinfo) {
          GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
                vinfo, GLX_surf->drawable);
-         XFree(vinfo);
+         free(vinfo);
       }
    }
    else {
       }
    }
    else {
index df8370f8d7d9b81f244f50cbe891dde4e02ce1ad..c88d921a6cd838b2abd697f097ec4fb59726d278 100644 (file)
@@ -85,7 +85,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes)
    while (modes != NULL) {
       __GLcontextModes *const next = modes->next;
 
    while (modes != NULL) {
       __GLcontextModes *const next = modes->next;
 
-      Xfree(modes);
+      free(modes);
       modes = next;
    }
 }
       modes = next;
    }
 }
@@ -101,7 +101,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size)
 
    next = &base;
    for (i = 0; i < count; i++) {
 
    next = &base;
    for (i = 0; i < count; i++) {
-      *next = (__GLcontextModes *) Xmalloc(size);
+      *next = (__GLcontextModes *) malloc(size);
       if (*next == NULL) {
          _gl_context_modes_destroy(base);
          base = NULL;
       if (*next == NULL) {
          _gl_context_modes_destroy(base);
          base = NULL;
@@ -165,7 +165,7 @@ __glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
    length = reply.length * 4;
    numbytes = reply.size;
 
    length = reply.length * 4;
    numbytes = reply.size;
 
-   buf = (char *) Xmalloc(numbytes);
+   buf = (char *) malloc(numbytes);
    if (buf != NULL) {
       _XRead(dpy, buf, numbytes);
       length -= numbytes;
    if (buf != NULL) {
       _XRead(dpy, buf, numbytes);
       length -= numbytes;
@@ -200,9 +200,9 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
          _gl_context_modes_destroy(psc->configs);
          psc->configs = NULL;   /* NOTE: just for paranoia */
       }
          _gl_context_modes_destroy(psc->configs);
          psc->configs = NULL;   /* NOTE: just for paranoia */
       }
-      Xfree((char *) psc->serverGLXexts);
+      free((char *) psc->serverGLXexts);
    }
    }
-   XFree((char *) priv->screenConfigs);
+   free((char *) priv->screenConfigs);
    priv->screenConfigs = NULL;
 }
 
    priv->screenConfigs = NULL;
 }
 
@@ -218,9 +218,9 @@ __glXFreeDisplayPrivate(XExtData * extension)
    priv = (__GLXdisplayPrivate *) extension->private_data;
    FreeScreenConfigs(priv);
    if (priv->serverGLXversion)
    priv = (__GLXdisplayPrivate *) extension->private_data;
    FreeScreenConfigs(priv);
    if (priv->serverGLXversion)
-      Xfree((char *) priv->serverGLXversion);
+      free((char *) priv->serverGLXversion);
 
 
-   Xfree((char *) priv);
+   free((char *) priv);
    return 0;
 }
 
    return 0;
 }
 
@@ -491,7 +491,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
    if (prop_size <= sizeof(buf))
       props = buf;
    else
    if (prop_size <= sizeof(buf))
       props = buf;
    else
-      props = Xmalloc(prop_size);
+      props = malloc(prop_size);
 
    /* Read each config structure and convert it into our format */
    m = modes;
 
    /* Read each config structure and convert it into our format */
    m = modes;
@@ -506,7 +506,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
    }
 
    if (props != buf)
    }
 
    if (props != buf)
-      Xfree(props);
+      free(props);
 
    return modes;
 }
 
    return modes;
 }
@@ -568,7 +568,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
     ** First allocate memory for the array of per screen configs.
     */
    screens = ScreenCount(dpy);
     ** First allocate memory for the array of per screen configs.
     */
    screens = ScreenCount(dpy);
-   priv->screenConfigs = Xmalloc(screens * sizeof *priv->screenConfigs);
+   priv->screenConfigs = malloc(screens * sizeof *priv->screenConfigs);
    if (!priv->screenConfigs) {
       return GL_FALSE;
    }
    if (!priv->screenConfigs) {
       return GL_FALSE;
    }
@@ -581,7 +581,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
    }
 
    for (i = 0; i < screens; i++) {
    }
 
    for (i = 0; i < screens; i++) {
-      psc = Xcalloc(1, sizeof *psc);
+      psc = calloc(1, sizeof *psc);
       if (!psc)
          return GL_FALSE;
       getFBConfigs(psc, priv, i);
       if (!psc)
          return GL_FALSE;
       getFBConfigs(psc, priv, i);
@@ -619,12 +619,12 @@ __glXInitialize(Display * dpy)
    /*
     ** Allocate memory for all the pieces needed for this buffer.
     */
    /*
     ** Allocate memory for all the pieces needed for this buffer.
     */
-   private = (XExtData *) Xmalloc(sizeof(XExtData));
+   private = (XExtData *) malloc(sizeof(XExtData));
    if (!private)
       return NULL;
    if (!private)
       return NULL;
-   dpyPriv = (__GLXdisplayPrivate *) Xcalloc(1, sizeof(__GLXdisplayPrivate));
+   dpyPriv = (__GLXdisplayPrivate *) calloc(1, sizeof(__GLXdisplayPrivate));
    if (!dpyPriv) {
    if (!dpyPriv) {
-      Xfree(private);
+      free(private);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -636,8 +636,8 @@ __glXInitialize(Display * dpy)
    dpyPriv->dpy = dpy;
 
    if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
    dpyPriv->dpy = dpy;
 
    if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
-      Xfree(dpyPriv);
-      Xfree(private);
+      free(dpyPriv);
+      free(private);
       return NULL;
    }
 
       return NULL;
    }
 
index f8f9e2ae767bf12a9b0567e6df12ea59624aba54..47d9a69c7ddfaf76e2e867b781bd836bc107ad51 100644 (file)
@@ -96,9 +96,9 @@ x11_screen_destroy(struct x11_screen *xscr)
    if (xscr->dri_fd >= 0)
       close(xscr->dri_fd);
    if (xscr->dri_driver)
    if (xscr->dri_fd >= 0)
       close(xscr->dri_fd);
    if (xscr->dri_driver)
-      Xfree(xscr->dri_driver);
+      free(xscr->dri_driver);
    if (xscr->dri_device)
    if (xscr->dri_device)
-      Xfree(xscr->dri_device);
+      free(xscr->dri_device);
 
 #ifdef GLX_DIRECT_RENDERING
    /* xscr->glx_dpy will be destroyed with the X display */
 
 #ifdef GLX_DIRECT_RENDERING
    /* xscr->glx_dpy will be destroyed with the X display */
@@ -107,7 +107,7 @@ x11_screen_destroy(struct x11_screen *xscr)
 #endif
 
    if (xscr->visuals)
 #endif
 
    if (xscr->visuals)
-      XFree(xscr->visuals);
+      free(xscr->visuals);
    FREE(xscr);
 }
 
    FREE(xscr);
 }
 
index 9a487dcc27b00829fe2bcee86ee904473d616c83..08db6e821ec1cc856420437b04572f2c31d209ac 100644 (file)
@@ -409,7 +409,7 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
          return vis;
       }
       else {
          return vis;
       }
       else {
-         XFree((void *) vis);
+         free((void *) vis);
          return NULL;
       }
    }
          return NULL;
       }
    }
index 366f29bcdfa742a1a274a99139d19b3ff510465e..23f9d10ca92f9b66c98db7eed1640dcb91001c4e 100644 (file)
@@ -113,7 +113,7 @@ static Status Validate(Display *dpy, XvPortID port, int surface_type_id,
                                     *mc_type, *surface_flags, *subpic_max_w, *subpic_max_h);
             }
 
                                     *mc_type, *surface_flags, *subpic_max_w, *subpic_max_h);
             }
 
-            XFree(surface_info);
+            free(surface_info);
          }
       }
 
          }
       }
 
index b33f16e6a311061d4fdf72c965ad662e58bfa2cc..f9f646b7496c01eaa2d26884d22b3a6deae04d43 100644 (file)
@@ -116,7 +116,7 @@ static Status Validate(Display *dpy, XvPortID port, int surface_type_id, int xvi
    subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
    if (num_subpics < 1) {
       if (subpictures)
    subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
    if (num_subpics < 1) {
       if (subpictures)
-         XFree(subpictures);
+         free(subpictures);
       return BadMatch;
    }
    if (!subpictures)
       return BadMatch;
    }
    if (!subpictures)
@@ -161,7 +161,7 @@ static Status Validate(Display *dpy, XvPortID port, int surface_type_id, int xvi
       }
    }
 
       }
    }
 
-   XFree(subpictures);
+   free(subpictures);
 
    return i < num_subpics ? Success : BadMatch;
 }
 
    return i < num_subpics ? Success : BadMatch;
 }
index 9683a1a2a448e736c30fd520426c764c8347d5f2..9336bfac4463c727fd909d06277df1364073c2a9 100644 (file)
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
 
        assert(XvMCDestroyContext(display, &context) == Success);
 
 
        assert(XvMCDestroyContext(display, &context) == Success);
 
-       XFree(subpics);
+       free(subpics);
        XvUngrabPort(display, port_num, CurrentTime);
        XCloseDisplay(display);
 
        XvUngrabPort(display, port_num, CurrentTime);
        XCloseDisplay(display);
 
index 86d4b1c6c28b511c407adc96fda5a905994c4cd2..de3b8da7787485fc076af3c925285597470615b0 100644 (file)
@@ -102,7 +102,7 @@ int GetPort
                                        }
                                }
 
                                        }
                                }
 
-                               XFree(surface_info);
+                               free(surface_info);
                        }
                }
        }
                        }
                }
        }
index b6d798e577c262176b6fa8e6cd8c6e19dcfed253..95b856815db8e5ba2f93b191a3e45958920d0c0a 100644 (file)
@@ -147,7 +147,7 @@ graw_create_window_and_screen( int x,
    if (screen == NULL)
       goto fail;
 
    if (screen == NULL)
       goto fail;
 
-   XFree(visinfo);
+   free(visinfo);
    return screen;
 
 fail:
    return screen;
 
 fail:
@@ -158,7 +158,7 @@ fail:
       FREE(xlib_handle);
 
    if (visinfo)
       FREE(xlib_handle);
 
    if (visinfo)
-      XFree(visinfo);
+      free(visinfo);
 
    if (win)
       XDestroyWindow(graw.display, win);
 
    if (win)
       XDestroyWindow(graw.display, win);
index 5c181d6db9eae5755e2119b7f6fa7ab9ff5efcc5..fe3a1551fa62240693bd8001104cc260d7bb7434 100644 (file)
@@ -201,7 +201,7 @@ XF86DRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA,
    }
 
    if (rep.length) {
    }
 
    if (rep.length) {
-      if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) {
+      if (!(*busIdString = (char *) calloc(rep.busIdStringLength + 1, 1))) {
          _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
          _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
@@ -302,7 +302,7 @@ XF86DRIGetClientDriverName(Display * dpy, int screen,
    if (rep.length) {
       if (!
           (*clientDriverName =
    if (rep.length) {
       if (!
           (*clientDriverName =
-           (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) {
+           (char *) calloc(rep.clientDriverNameLength + 1, 1))) {
          _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
          _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
@@ -521,7 +521,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
    if (*numClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numClipRects);
 
    if (*numClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numClipRects);
 
-      *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+      *pClipRects = (drm_clip_rect_t *) calloc(len, 1);
       if (*pClipRects)
          _XRead(dpy, (char *) *pClipRects, len);
    }
       if (*pClipRects)
          _XRead(dpy, (char *) *pClipRects, len);
    }
@@ -532,7 +532,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable,
    if (*numBackClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
 
    if (*numBackClipRects) {
       int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
 
-      *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1);
+      *pBackClipRects = (drm_clip_rect_t *) calloc(len, 1);
       if (*pBackClipRects)
          _XRead(dpy, (char *) *pBackClipRects, len);
    }
       if (*pBackClipRects)
          _XRead(dpy, (char *) *pBackClipRects, len);
    }
@@ -582,7 +582,7 @@ XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer,
    *devPrivateSize = rep.devPrivateSize;
 
    if (rep.length) {
    *devPrivateSize = rep.devPrivateSize;
 
    if (rep.length) {
-      if (!(*pDevPrivate = (void *) Xcalloc(rep.devPrivateSize, 1))) {
+      if (!(*pDevPrivate = (void *) calloc(rep.devPrivateSize, 1))) {
          _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
          _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3));
          UnlockDisplay(dpy);
          SyncHandle();
index f17ebe6b406d4e00b922de2c10ee27ad4470e277..240caa738f9742c1ad602291105500e08e1473fa 100644 (file)
@@ -79,7 +79,7 @@ __glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim,
 
    size = reply.length * 4;
    if (size != 0) {
 
    size = reply.length * 4;
    if (size != 0) {
-      void *buf = Xmalloc(size);
+      void *buf = malloc(size);
 
       if (buf == NULL) {
          _XEatData(dpy, size);
 
       if (buf == NULL) {
          _XEatData(dpy, size);
@@ -94,7 +94,7 @@ __glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim,
          }
 
          __glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
          }
 
          __glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
-         Xfree(buf);
+         free(buf);
       }
    }
 }
       }
    }
 }
index 9be12b0f6b26fba1c3b1fd53828c01f096c2e8e8..c3597cee7659b3a9541a134c9db35378dc4a5e3e 100644 (file)
@@ -134,12 +134,12 @@ applegl_create_context(struct glx_screen *psc,
    /* TODO: Integrate this with apple_glx_create_context and make
     * struct apple_glx_context inherit from struct glx_context. */
 
    /* TODO: Integrate this with apple_glx_create_context and make
     * struct apple_glx_context inherit from struct glx_context. */
 
-   gc = Xcalloc(1, sizeof (*gc));
+   gc = calloc(1, sizeof(*gc));
    if (gc == NULL)
       return NULL;
 
    if (!glx_context_init(gc, psc, config)) {
    if (gc == NULL)
       return NULL;
 
    if (!glx_context_init(gc, psc, config)) {
-      Xfree(gc);
+      free(gc);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -173,7 +173,7 @@ applegl_create_screen(int screen, struct glx_display * priv)
 {
    struct glx_screen *psc;
 
 {
    struct glx_screen *psc;
 
-   psc = Xmalloc(sizeof *psc);
+   psc = malloc(sizeof *psc);
    if (psc == NULL)
       return NULL;
 
    if (psc == NULL)
       return NULL;
 
index 7792fa31f9d41233f040431f58b87b8f9e9fc719..4721fe938fde94380061cf6675cb3b29cf7d792c 100644 (file)
@@ -75,7 +75,7 @@ __indirect_glPushClientAttrib(GLuint mask)
 
    if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
       if (!(sp = *spp)) {
 
    if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
       if (!(sp = *spp)) {
-         sp = (__GLXattribute *) Xmalloc(sizeof(__GLXattribute));
+         sp = (__GLXattribute *) malloc(sizeof(__GLXattribute));
          *spp = sp;
       }
       sp->mask = mask;
          *spp = sp;
       }
       sp->mask = mask;
@@ -135,7 +135,7 @@ __glFreeAttributeState(struct glx_context * gc)
         spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
       sp = *spp;
       if (sp) {
         spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
       sp = *spp;
       if (sp) {
-         XFree((char *) sp);
+         free((char *) sp);
       }
       else {
          break;
       }
       else {
          break;
index 429e9a3bfa75b949b5f244587f5528b61ce03210..e90fd7962979985d5950fb240aa0f186ff3a83de 100644 (file)
@@ -152,5 +152,5 @@ __glX_send_client_info(struct glx_display *glx_dpy)
                          gl_extension_string);
    }
 
                          gl_extension_string);
    }
 
-   Xfree(gl_extension_string);
+   free(gl_extension_string);
 }
 }
index d6b99db768c611c5b6845fd11c64a121ede48f03..1214cb47a782953f99382cd21ea270adbb6506e7 100644 (file)
@@ -303,7 +303,7 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
       return False;
    }
 
       return False;
    }
 
-   *driverName = Xmalloc(rep.driverNameLength + 1);
+   *driverName = malloc(rep.driverNameLength + 1);
    if (*driverName == NULL) {
       _XEatData(dpy,
                 ((rep.driverNameLength + 3) & ~3) +
    if (*driverName == NULL) {
       _XEatData(dpy,
                 ((rep.driverNameLength + 3) & ~3) +
@@ -315,9 +315,9 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
    _XReadPad(dpy, *driverName, rep.driverNameLength);
    (*driverName)[rep.driverNameLength] = '\0';
 
    _XReadPad(dpy, *driverName, rep.driverNameLength);
    (*driverName)[rep.driverNameLength] = '\0';
 
-   *deviceName = Xmalloc(rep.deviceNameLength + 1);
+   *deviceName = malloc(rep.deviceNameLength + 1);
    if (*deviceName == NULL) {
    if (*deviceName == NULL) {
-      Xfree(*driverName);
+      free(*driverName);
       _XEatData(dpy, ((rep.deviceNameLength + 3) & ~3));
       UnlockDisplay(dpy);
       SyncHandle();
       _XEatData(dpy, ((rep.deviceNameLength + 3) & ~3));
       UnlockDisplay(dpy);
       SyncHandle();
@@ -431,7 +431,7 @@ DRI2GetBuffers(Display * dpy, XID drawable,
    *height = rep.height;
    *outCount = rep.count;
 
    *height = rep.height;
    *outCount = rep.count;
 
-   buffers = Xmalloc(rep.count * sizeof buffers[0]);
+   buffers = malloc(rep.count * sizeof buffers[0]);
    if (buffers == NULL) {
       _XEatData(dpy, rep.count * sizeof repBuffer);
       UnlockDisplay(dpy);
    if (buffers == NULL) {
       _XEatData(dpy, rep.count * sizeof repBuffer);
       UnlockDisplay(dpy);
@@ -490,7 +490,7 @@ DRI2GetBuffersWithFormat(Display * dpy, XID drawable,
    *height = rep.height;
    *outCount = rep.count;
 
    *height = rep.height;
    *outCount = rep.count;
 
-   buffers = Xmalloc(rep.count * sizeof buffers[0]);
+   buffers = malloc(rep.count * sizeof buffers[0]);
    if (buffers == NULL) {
       _XEatData(dpy, rep.count * sizeof repBuffer);
       UnlockDisplay(dpy);
    if (buffers == NULL) {
       _XEatData(dpy, rep.count * sizeof repBuffer);
       UnlockDisplay(dpy);
index 4e8b3516df47dd6fe690fbda22a8d9b280c44b95..7978bfd4633144b6ef0a5d927ee2dfd715ef6cfa 100644 (file)
@@ -127,11 +127,11 @@ dri2_destroy_context(struct glx_context *context)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
-      XFree((char *) context->extensions);
+      free((char *) context->extensions);
 
    (*psc->core->destroyContext) (pcp->driContext);
 
 
    (*psc->core->destroyContext) (pcp->driContext);
 
-   Xfree(pcp);
+   free(pcp);
 }
 
 static Bool
 }
 
 static Bool
@@ -199,13 +199,13 @@ dri2_create_context(struct glx_screen *base,
       shared = pcp_shared->driContext;
    }
 
       shared = pcp_shared->driContext;
    }
 
-   pcp = Xmalloc(sizeof *pcp);
+   pcp = malloc(sizeof *pcp);
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -214,7 +214,7 @@ dri2_create_context(struct glx_screen *base,
                                       config->driConfig, shared, pcp);
 
    if (pcp->driContext == NULL) {
                                       config->driConfig, shared, pcp);
 
    if (pcp->driContext == NULL) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -262,7 +262,7 @@ dri2_create_context_attribs(struct glx_screen *base,
       shared = pcp_shared->driContext;
    }
 
       shared = pcp_shared->driContext;
    }
 
-   pcp = Xmalloc(sizeof *pcp);
+   pcp = malloc(sizeof *pcp);
    if (pcp == NULL) {
       *error = __DRI_CTX_ERROR_NO_MEMORY;
       goto error_exit;
    if (pcp == NULL) {
       *error = __DRI_CTX_ERROR_NO_MEMORY;
       goto error_exit;
@@ -314,7 +314,7 @@ dri2_create_context_attribs(struct glx_screen *base,
 
 error_exit:
    if (pcp != NULL)
 
 error_exit:
    if (pcp != NULL)
-      Xfree(pcp);
+      free(pcp);
 
    return NULL;
 }
 
    return NULL;
 }
@@ -340,7 +340,7 @@ dri2DestroyDrawable(__GLXDRIdrawable *base)
    if (pdraw->base.xDrawable != pdraw->base.drawable)
       DRI2DestroyDrawable(psc->base.dpy, pdraw->base.xDrawable);
 
    if (pdraw->base.xDrawable != pdraw->base.drawable)
       DRI2DestroyDrawable(psc->base.dpy, pdraw->base.xDrawable);
 
-   Xfree(pdraw);
+   free(pdraw);
 }
 
 static __GLXDRIdrawable *
 }
 
 static __GLXDRIdrawable *
@@ -354,7 +354,7 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
    struct dri2_display *pdp;
    GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
 
    struct dri2_display *pdp;
    GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
 
-   pdraw = Xmalloc(sizeof(*pdraw));
+   pdraw = malloc(sizeof(*pdraw));
    if (!pdraw)
       return NULL;
 
    if (!pdraw)
       return NULL;
 
@@ -394,14 +394,14 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
 
    if (!pdraw->driDrawable) {
       DRI2DestroyDrawable(psc->base.dpy, xDrawable);
 
    if (!pdraw->driDrawable) {
       DRI2DestroyDrawable(psc->base.dpy, xDrawable);
-      Xfree(pdraw);
+      free(pdraw);
       return NULL;
    }
 
    if (__glxHashInsert(pdp->dri2Hash, xDrawable, pdraw)) {
       (*psc->core->destroyDrawable) (pdraw->driDrawable);
       DRI2DestroyDrawable(psc->base.dpy, xDrawable);
       return NULL;
    }
 
    if (__glxHashInsert(pdp->dri2Hash, xDrawable, pdraw)) {
       (*psc->core->destroyDrawable) (pdraw->driDrawable);
       DRI2DestroyDrawable(psc->base.dpy, xDrawable);
-      Xfree(pdraw);
+      free(pdraw);
       return None;
    }
 
       return None;
    }
 
@@ -633,7 +633,7 @@ dri2DestroyScreen(struct glx_screen *base)
    (*psc->core->destroyScreen) (psc->driScreen);
    driDestroyConfigs(psc->driver_configs);
    close(psc->fd);
    (*psc->core->destroyScreen) (psc->driScreen);
    driDestroyConfigs(psc->driver_configs);
    close(psc->fd);
-   Xfree(psc);
+   free(psc);
 }
 
 /**
 }
 
 /**
@@ -765,7 +765,7 @@ dri2GetBuffers(__DRIdrawable * driDrawable,
    pdraw->height = *height;
    process_buffers(pdraw, buffers, *out_count);
 
    pdraw->height = *height;
    process_buffers(pdraw, buffers, *out_count);
 
-   Xfree(buffers);
+   free(buffers);
 
    return pdraw->buffers;
 }
 
    return pdraw->buffers;
 }
@@ -790,7 +790,7 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
    pdraw->height = *height;
    process_buffers(pdraw, buffers, *out_count);
 
    pdraw->height = *height;
    process_buffers(pdraw, buffers, *out_count);
 
-   Xfree(buffers);
+   free(buffers);
 
    return pdraw->buffers;
 }
 
    return pdraw->buffers;
 }
@@ -1020,7 +1020,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
    drm_magic_t magic;
    int i;
 
    drm_magic_t magic;
    int i;
 
-   psc = Xmalloc(sizeof *psc);
+   psc = malloc(sizeof *psc);
    if (psc == NULL)
       return NULL;
 
    if (psc == NULL)
       return NULL;
 
@@ -1028,14 +1028,14 @@ dri2CreateScreen(int screen, struct glx_display * priv)
    psc->fd = -1;
 
    if (!glx_screen_init(&psc->base, screen, priv)) {
    psc->fd = -1;
 
    if (!glx_screen_init(&psc->base, screen, priv)) {
-      Xfree(psc);
+      free(psc);
       return NULL;
    }
 
    if (!DRI2Connect(priv->dpy, RootWindow(priv->dpy, screen),
                    &driverName, &deviceName)) {
       glx_screen_cleanup(&psc->base);
       return NULL;
    }
 
    if (!DRI2Connect(priv->dpy, RootWindow(priv->dpy, screen),
                    &driverName, &deviceName)) {
       glx_screen_cleanup(&psc->base);
-      XFree(psc);
+      free(psc);
       InfoMessageF("screen %d does not appear to be DRI2 capable\n", screen);
       return NULL;
    }
       InfoMessageF("screen %d does not appear to be DRI2 capable\n", screen);
       return NULL;
    }
@@ -1153,8 +1153,8 @@ dri2CreateScreen(int screen, struct glx_display * priv)
    psp->copySubBuffer = dri2CopySubBuffer;
    __glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
 
    psp->copySubBuffer = dri2CopySubBuffer;
    __glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
 
-   Xfree(driverName);
-   Xfree(deviceName);
+   free(driverName);
+   free(deviceName);
 
    tmp = getenv("LIBGL_SHOW_FPS");
    psc->show_fps = tmp && strcmp(tmp, "1") == 0;
 
    tmp = getenv("LIBGL_SHOW_FPS");
    psc->show_fps = tmp && strcmp(tmp, "1") == 0;
@@ -1176,10 +1176,10 @@ handle_error:
    if (psc->driver)
       dlclose(psc->driver);
 
    if (psc->driver)
       dlclose(psc->driver);
 
-   Xfree(driverName);
-   Xfree(deviceName);
+   free(driverName);
+   free(deviceName);
    glx_screen_cleanup(&psc->base);
    glx_screen_cleanup(&psc->base);
-   XFree(psc);
+   free(psc);
 
    return NULL;
 }
 
    return NULL;
 }
@@ -1192,7 +1192,7 @@ dri2DestroyDisplay(__GLXDRIdisplay * dpy)
    struct dri2_display *pdp = (struct dri2_display *) dpy;
 
    __glxHashDestroy(pdp->dri2Hash);
    struct dri2_display *pdp = (struct dri2_display *) dpy;
 
    __glxHashDestroy(pdp->dri2Hash);
-   Xfree(dpy);
+   free(dpy);
 }
 
 _X_HIDDEN __GLXDRIdrawable *
 }
 
 _X_HIDDEN __GLXDRIdrawable *
@@ -1222,12 +1222,12 @@ dri2CreateDisplay(Display * dpy)
    if (!DRI2QueryExtension(dpy, &eventBase, &errorBase))
       return NULL;
 
    if (!DRI2QueryExtension(dpy, &eventBase, &errorBase))
       return NULL;
 
-   pdp = Xmalloc(sizeof *pdp);
+   pdp = malloc(sizeof *pdp);
    if (pdp == NULL)
       return NULL;
 
    if (!DRI2QueryVersion(dpy, &pdp->driMajor, &pdp->driMinor)) {
    if (pdp == NULL)
       return NULL;
 
    if (!DRI2QueryVersion(dpy, &pdp->driMajor, &pdp->driMinor)) {
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -1253,7 +1253,7 @@ dri2CreateDisplay(Display * dpy)
 
    pdp->dri2Hash = __glxHashCreate();
    if (pdp->dri2Hash == NULL) {
 
    pdp->dri2Hash = __glxHashCreate();
    if (pdp->dri2Hash == NULL) {
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
index d170aa6f7e248923624a8324dc8c6b0bd17b2e1b..1bf20ec949d81e519e87540d28319e358177fa29 100644 (file)
@@ -340,7 +340,7 @@ createDriMode(const __DRIcoreExtension * core,
    if (driConfigs[i] == NULL)
       return NULL;
 
    if (driConfigs[i] == NULL)
       return NULL;
 
-   driConfig = Xmalloc(sizeof *driConfig);
+   driConfig = malloc(sizeof *driConfig);
    if (driConfig == NULL)
       return NULL;
 
    if (driConfig == NULL)
       return NULL;
 
index 9bfcb0c082a32869a58ab3c97d875397bd78e7ca..b2fced95222fe096e2c00725b1170e73f82268e8 100644 (file)
@@ -136,7 +136,7 @@ driGetDriverName(Display * dpy, int scrNum, char **driverName)
       Bool ret = DRI2Connect(dpy, RootWindow(dpy, scrNum), driverName, &dev);
 
       if (ret)
       Bool ret = DRI2Connect(dpy, RootWindow(dpy, scrNum), driverName, &dev);
 
       if (ret)
-         Xfree(dev);
+         free(dev);
 
       return ret;
    }
 
       return ret;
    }
@@ -163,7 +163,7 @@ glXGetScreenDriver(Display * dpy, int scrNum)
       if (len >= 31)
          return NULL;
       memcpy(ret, driverName, len + 1);
       if (len >= 31)
          return NULL;
       memcpy(ret, driverName, len + 1);
-      Xfree(driverName);
+      free(driverName);
       return ret;
    }
    return NULL;
       return ret;
    }
    return NULL;
@@ -354,7 +354,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
 
    fd = drmOpenOnce(NULL, BusID, &newlyopened);
 
 
    fd = drmOpenOnce(NULL, BusID, &newlyopened);
 
-   Xfree(BusID);                /* No longer needed */
+   free(BusID);                /* No longer needed */
 
    if (fd < 0) {
       ErrorMessageF("drmOpenOnce failed (%s)\n", strerror(-fd));
 
    if (fd < 0) {
       ErrorMessageF("drmOpenOnce failed (%s)\n", strerror(-fd));
@@ -395,7 +395,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
       goto handle_error;
    }
 
       goto handle_error;
    }
 
-   Xfree(driverName);           /* No longer needed. */
+   free(driverName);           /* No longer needed. */
 
    /*
     * Get device-specific info.  pDevPriv will point to a struct
 
    /*
     * Get device-specific info.  pDevPriv will point to a struct
@@ -477,7 +477,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
          if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn))
             visual->visualRating = GLX_NON_CONFORMANT_CONFIG;
 
          if (num_visuals > 0 && visuals->depth != DefaultDepth(dpy, scrn))
             visual->visualRating = GLX_NON_CONFORMANT_CONFIG;
 
-         XFree(visuals);
+         free(visuals);
       }
    }
 
       }
    }
 
@@ -496,7 +496,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
       drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
 
    if (framebuffer.dev_priv != NULL)
       drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
 
    if (framebuffer.dev_priv != NULL)
-      Xfree(framebuffer.dev_priv);
+      free(framebuffer.dev_priv);
 
    if (fd >= 0)
       drmCloseOnce(fd);
 
    if (fd >= 0)
       drmCloseOnce(fd);
@@ -517,12 +517,12 @@ dri_destroy_context(struct glx_context * context)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
-      XFree((char *) context->extensions);
+      free((char *) context->extensions);
 
    (*psc->core->destroyContext) (pcp->driContext);
 
    XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
 
    (*psc->core->destroyContext) (pcp->driContext);
 
    XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
-   Xfree(pcp);
+   free(pcp);
 }
 
 static int
 }
 
 static int
@@ -595,20 +595,20 @@ dri_create_context(struct glx_screen *base,
       shared = pcp_shared->driContext;
    }
 
       shared = pcp_shared->driContext;
    }
 
-   pcp = Xmalloc(sizeof *pcp);
+   pcp = malloc(sizeof *pcp);
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
    if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr,
                                        config->base.visualID,
                                        &pcp->hwContextID, &hwContext)) {
       return NULL;
    }
 
    if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr,
                                        config->base.visualID,
                                        &pcp->hwContextID, &hwContext)) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -618,7 +618,7 @@ dri_create_context(struct glx_screen *base,
                                         renderType, shared, hwContext, pcp);
    if (pcp->driContext == NULL) {
       XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
                                         renderType, shared, hwContext, pcp);
    if (pcp->driContext == NULL) {
       XF86DRIDestroyContext(psc->base.dpy, psc->base.scr, pcp->hwContextID);
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -635,7 +635,7 @@ driDestroyDrawable(__GLXDRIdrawable * pdraw)
 
    (*psc->core->destroyDrawable) (pdp->driDrawable);
    XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, pdraw->drawable);
 
    (*psc->core->destroyDrawable) (pdp->driDrawable);
    XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, pdraw->drawable);
-   Xfree(pdraw);
+   free(pdraw);
 }
 
 static __GLXDRIdrawable *
 }
 
 static __GLXDRIdrawable *
@@ -653,7 +653,7 @@ driCreateDrawable(struct glx_screen *base,
    if (xDrawable != drawable)
       return NULL;
 
    if (xDrawable != drawable)
       return NULL;
 
-   pdp = Xmalloc(sizeof *pdp);
+   pdp = malloc(sizeof *pdp);
    if (!pdp)
       return NULL;
 
    if (!pdp)
       return NULL;
 
@@ -663,7 +663,7 @@ driCreateDrawable(struct glx_screen *base,
 
    if (!XF86DRICreateDrawable(psc->base.dpy, psc->base.scr,
                              drawable, &hwDrawable)) {
 
    if (!XF86DRICreateDrawable(psc->base.dpy, psc->base.scr,
                              drawable, &hwDrawable)) {
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -677,7 +677,7 @@ driCreateDrawable(struct glx_screen *base,
 
    if (!pdp->driDrawable) {
       XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, drawable);
 
    if (!pdp->driDrawable) {
       XF86DRIDestroyDrawable(psc->base.dpy, psc->base.scr, drawable);
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -850,13 +850,13 @@ driCreateScreen(int screen, struct glx_display *priv)
    char *driverName;
    int i;
 
    char *driverName;
    int i;
 
-   psc = Xcalloc(1, sizeof *psc);
+   psc = calloc(1, sizeof *psc);
    if (psc == NULL)
       return NULL;
 
    memset(psc, 0, sizeof *psc);
    if (!glx_screen_init(&psc->base, screen, priv)) {
    if (psc == NULL)
       return NULL;
 
    memset(psc, 0, sizeof *psc);
    if (!glx_screen_init(&psc->base, screen, priv)) {
-      Xfree(psc);
+      free(psc);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -865,7 +865,7 @@ driCreateScreen(int screen, struct glx_display *priv)
    }
 
    psc->driver = driOpenDriver(driverName);
    }
 
    psc->driver = driOpenDriver(driverName);
-   Xfree(driverName);
+   free(driverName);
    if (psc->driver == NULL)
       goto cleanup;
 
    if (psc->driver == NULL)
       goto cleanup;
 
@@ -921,7 +921,7 @@ cleanup:
    if (psc->driver)
       dlclose(psc->driver);
    glx_screen_cleanup(&psc->base);
    if (psc->driver)
       dlclose(psc->driver);
    glx_screen_cleanup(&psc->base);
-   Xfree(psc);
+   free(psc);
 
    return NULL;
 }
 
    return NULL;
 }
@@ -931,7 +931,7 @@ cleanup:
 static void
 driDestroyDisplay(__GLXDRIdisplay * dpy)
 {
 static void
 driDestroyDisplay(__GLXDRIdisplay * dpy)
 {
-   Xfree(dpy);
+   free(dpy);
 }
 
 /*
 }
 
 /*
@@ -954,7 +954,7 @@ driCreateDisplay(Display * dpy)
       return NULL;
    }
 
       return NULL;
    }
 
-   pdpyp = Xmalloc(sizeof *pdpyp);
+   pdpyp = malloc(sizeof *pdpyp);
    if (!pdpyp) {
       return NULL;
    }
    if (!pdpyp) {
       return NULL;
    }
index 462be7d9f470a20ed7bdf49ea41c31a6523cd820..d98fdb903d0db3f925776a631c4572b667698cdc 100644 (file)
@@ -118,7 +118,7 @@ static void
 XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
 {
    XDestroyImage(pdp->ximage);
 XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
 {
    XDestroyImage(pdp->ximage);
-   XFree(pdp->visinfo);
+   free(pdp->visinfo);
 
    XFreeGC(dpy, pdp->gc);
    XFreeGC(dpy, pdp->swapgc);
 
    XFreeGC(dpy, pdp->gc);
    XFreeGC(dpy, pdp->swapgc);
@@ -256,11 +256,11 @@ drisw_destroy_context(struct glx_context *context)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
    driReleaseDrawables(&pcp->base);
 
    if (context->extensions)
-      XFree((char *) context->extensions);
+      free((char *) context->extensions);
 
    (*psc->core->destroyContext) (pcp->driContext);
 
 
    (*psc->core->destroyContext) (pcp->driContext);
 
-   Xfree(pcp);
+   free(pcp);
 }
 
 static int
 }
 
 static int
@@ -393,13 +393,13 @@ drisw_create_context(struct glx_screen *base,
       shared = pcp_shared->driContext;
    }
 
       shared = pcp_shared->driContext;
    }
 
-   pcp = Xmalloc(sizeof *pcp);
+   pcp = malloc(sizeof *pcp);
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -407,7 +407,7 @@ drisw_create_context(struct glx_screen *base,
       (*psc->core->createNewContext) (psc->driScreen,
                                      config->driConfig, shared, pcp);
    if (pcp->driContext == NULL) {
       (*psc->core->createNewContext) (psc->driScreen,
                                      config->driConfig, shared, pcp);
    if (pcp->driContext == NULL) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -458,13 +458,13 @@ drisw_create_context_attribs(struct glx_screen *base,
       shared = pcp_shared->driContext;
    }
 
       shared = pcp_shared->driContext;
    }
 
-   pcp = Xmalloc(sizeof *pcp);
+   pcp = malloc(sizeof *pcp);
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
    if (pcp == NULL)
       return NULL;
 
    memset(pcp, 0, sizeof *pcp);
    if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -492,7 +492,7 @@ drisw_create_context_attribs(struct glx_screen *base,
                                            error,
                                            pcp);
    if (pcp->driContext == NULL) {
                                            error,
                                            pcp);
    if (pcp->driContext == NULL) {
-      Xfree(pcp);
+      free(pcp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -510,7 +510,7 @@ driswDestroyDrawable(__GLXDRIdrawable * pdraw)
    (*psc->core->destroyDrawable) (pdp->driDrawable);
 
    XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable);
    (*psc->core->destroyDrawable) (pdp->driDrawable);
 
    XDestroyDrawable(pdp, pdraw->psc->dpy, pdraw->drawable);
-   Xfree(pdp);
+   free(pdp);
 }
 
 static __GLXDRIdrawable *
 }
 
 static __GLXDRIdrawable *
@@ -523,7 +523,7 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
    Bool ret;
    const __DRIswrastExtension *swrast = psc->swrast;
 
    Bool ret;
    const __DRIswrastExtension *swrast = psc->swrast;
 
-   pdp = Xmalloc(sizeof(*pdp));
+   pdp = malloc(sizeof(*pdp));
    if (!pdp)
       return NULL;
 
    if (!pdp)
       return NULL;
 
@@ -534,7 +534,7 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
 
    ret = XCreateDrawable(pdp, psc->base.dpy, xDrawable, modes->visualID);
    if (!ret) {
 
    ret = XCreateDrawable(pdp, psc->base.dpy, xDrawable, modes->visualID);
    if (!ret) {
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -544,7 +544,7 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
 
    if (!pdp->driDrawable) {
       XDestroyDrawable(pdp, psc->base.dpy, xDrawable);
 
    if (!pdp->driDrawable) {
       XDestroyDrawable(pdp, psc->base.dpy, xDrawable);
-      Xfree(pdp);
+      free(pdp);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -636,13 +636,13 @@ driswCreateScreen(int screen, struct glx_display *priv)
    struct glx_config *configs = NULL, *visuals = NULL;
    int i;
 
    struct glx_config *configs = NULL, *visuals = NULL;
    int i;
 
-   psc = Xcalloc(1, sizeof *psc);
+   psc = calloc(1, sizeof *psc);
    if (psc == NULL)
       return NULL;
 
    memset(psc, 0, sizeof *psc);
    if (!glx_screen_init(&psc->base, screen, priv)) {
    if (psc == NULL)
       return NULL;
 
    memset(psc, 0, sizeof *psc);
    if (!glx_screen_init(&psc->base, screen, priv)) {
-      Xfree(psc);
+      free(psc);
       return NULL;
    }
 
       return NULL;
    }
 
@@ -713,7 +713,7 @@ driswCreateScreen(int screen, struct glx_display *priv)
    if (psc->driver)
       dlclose(psc->driver);
    glx_screen_cleanup(&psc->base);
    if (psc->driver)
       dlclose(psc->driver);
    glx_screen_cleanup(&psc->base);
-   Xfree(psc);
+   free(psc);
 
    CriticalErrorMessageF("failed to load driver: %s\n", SWRAST_DRIVER_NAME);
 
 
    CriticalErrorMessageF("failed to load driver: %s\n", SWRAST_DRIVER_NAME);
 
@@ -725,7 +725,7 @@ driswCreateScreen(int screen, struct glx_display *priv)
 static void
 driswDestroyDisplay(__GLXDRIdisplay * dpy)
 {
 static void
 driswDestroyDisplay(__GLXDRIdisplay * dpy)
 {
-   Xfree(dpy);
+   free(dpy);
 }
 
 /*
 }
 
 /*
@@ -738,7 +738,7 @@ driswCreateDisplay(Display * dpy)
 {
    struct drisw_display *pdpyp;
 
 {
    struct drisw_display *pdpyp;
 
-   pdpyp = Xmalloc(sizeof *pdpyp);
+   pdpyp = malloc(sizeof *pdpyp);
    if (pdpyp == NULL)
       return NULL;
 
    if (pdpyp == NULL)
       return NULL;
 
index 6738252a31d724a072ca019c8d276ec509670be8..b5806d62e5ba30a7f82a7bb229a4c0e13014edba 100644 (file)
@@ -326,7 +326,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
    length = reply.length;
    if (length) {
       num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
    length = reply.length;
    if (length) {
       num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
-      data = (CARD32 *) Xmalloc(length * sizeof(CARD32));
+      data = (CARD32 *) malloc(length * sizeof(CARD32));
       if (data == NULL) {
          /* Throw data on the floor */
          _XEatData(dpy, length);
       if (data == NULL) {
          /* Throw data on the floor */
          _XEatData(dpy, length);
@@ -357,7 +357,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
          }
 #endif
 
          }
 #endif
 
-         Xfree(data);
+         free(data);
       }
    }
 
       }
    }
 
@@ -412,7 +412,7 @@ CreateDrawable(Display *dpy, struct glx_config *config,
    if (!opcode)
       return None;
 
    if (!opcode)
       return None;
 
-   glxDraw = Xmalloc(sizeof(*glxDraw));
+   glxDraw = malloc(sizeof(*glxDraw));
    if (!glxDraw)
       return None;
 
    if (!glxDraw)
       return None;
 
@@ -907,7 +907,7 @@ glXCreateWindow(Display * dpy, GLXFBConfig config, Window win,
       return None;
    }
 
       return None;
    }
 
-   XFree(visinfo);
+   free(visinfo);
 
    return win;
 #else
 
    return win;
 #else
index efad13d376e817e1f77b63954337561bdaedd200..bbc2b79d83d78a763e17c23405d699c6fb98017f 100644 (file)
@@ -56,7 +56,7 @@ __glXQueryServerString(Display * dpy, int opcode, CARD32 screen, CARD32 name)
    /* The spec doesn't mention this, but the Xorg server replies with
     * a string already terminated with '\0'. */
    uint32_t len = xcb_glx_query_server_string_string_length(reply);
    /* The spec doesn't mention this, but the Xorg server replies with
     * a string already terminated with '\0'. */
    uint32_t len = xcb_glx_query_server_string_string_length(reply);
-   char *buf = Xmalloc(len);
+   char *buf = malloc(len);
    memcpy(buf, xcb_glx_query_server_string_string(reply), len);
    free(reply);
 
    memcpy(buf, xcb_glx_query_server_string_string(reply), len);
    free(reply);
 
@@ -80,7 +80,7 @@ __glXGetString(Display * dpy, int opcode, CARD32 contextTag, CARD32 name)
    /* The spec doesn't mention this, but the Xorg server replies with
     * a string already terminated with '\0'. */
    uint32_t len = xcb_glx_get_string_string_length(reply);
    /* The spec doesn't mention this, but the Xorg server replies with
     * a string already terminated with '\0'. */
    uint32_t len = xcb_glx_get_string_string_length(reply);
-   char *buf = Xmalloc(len);
+   char *buf = malloc(len);
    memcpy(buf, xcb_glx_get_string_string(reply), len);
    free(reply);
 
    memcpy(buf, xcb_glx_get_string_string(reply), len);
    free(reply);
 
@@ -146,7 +146,7 @@ __glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode,
    length = reply.length * 4;
    numbytes = reply.size;
 
    length = reply.length * 4;
    numbytes = reply.size;
 
-   buf = (char *) Xmalloc(numbytes);
+   buf = (char *) malloc(numbytes);
    if (buf != NULL) {
       _XRead(dpy, buf, numbytes);
       length -= numbytes;
    if (buf != NULL) {
       _XRead(dpy, buf, numbytes);
       length -= numbytes;
index 37c09336749c1adfb27d9bb035a5723be534ef88..0b90b4255f94f2f795bef8262acfed3a0ea13b5b 100644 (file)
@@ -669,7 +669,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
       return None;
    }
 
       return None;
    }
 
-   glxDraw = Xmalloc(sizeof(*glxDraw));
+   glxDraw = malloc(sizeof(*glxDraw));
    if (!glxDraw)
       return None;
 
    if (!glxDraw)
       return None;
 
@@ -1267,7 +1267,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList)
                                   &visualTemplate, &i);
 
          if (newList) {
                                   &visualTemplate, &i);
 
          if (newList) {
-            Xfree(visualList);
+            free(visualList);
             visualList = newList;
             best_config = config;
          }
             visualList = newList;
             best_config = config;
          }
@@ -1392,7 +1392,7 @@ __glXClientInfo(Display * dpy, int opcode)
    SyncHandle();
 #endif /* USE_XCB */
 
    SyncHandle();
 #endif /* USE_XCB */
 
-   Xfree(ext_str);
+   free(ext_str);
 }
 
 
 }
 
 
@@ -1628,7 +1628,7 @@ glXChooseFBConfig(Display * dpy, int screen,
    if ((config_list != NULL) && (list_size > 0) && (attribList != NULL)) {
       list_size = choose_visual(config_list, list_size, attribList, GL_TRUE);
       if (list_size == 0) {
    if ((config_list != NULL) && (list_size > 0) && (attribList != NULL)) {
       list_size = choose_visual(config_list, list_size, attribList, GL_TRUE);
       if (list_size == 0) {
-         XFree(config_list);
+         free(config_list);
          config_list = NULL;
       }
    }
          config_list = NULL;
       }
    }
@@ -1682,7 +1682,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements)
          }
       }
 
          }
       }
 
-      config_list = Xmalloc(num_configs * sizeof *config_list);
+      config_list = malloc(num_configs * sizeof *config_list);
       if (config_list != NULL) {
          *nelements = num_configs;
          i = 0;
       if (config_list != NULL) {
          *nelements = num_configs;
          i = 0;
@@ -2454,7 +2454,7 @@ _X_HIDDEN char *
 __glXstrdup(const char *str)
 {
    char *copy;
 __glXstrdup(const char *str)
 {
    char *copy;
-   copy = (char *) Xmalloc(strlen(str) + 1);
+   copy = (char *) malloc(strlen(str) + 1);
    if (!copy)
       return NULL;
    strcpy(copy, str);
    if (!copy)
       return NULL;
    strcpy(copy, str);
index a4e76c1c3985105ae52b92c4fda5cf5cd63ddcf7..3827b583b7ad9a7b87f312b9d8ade86da7a4ea82 100644 (file)
@@ -208,13 +208,13 @@ FreeScreenConfigs(struct glx_display * priv)
       if (psc->driScreen) {
          psc->driScreen->destroyScreen(psc);
       } else {
       if (psc->driScreen) {
          psc->driScreen->destroyScreen(psc);
       } else {
-        Xfree(psc);
+        free(psc);
       }
 #else
       }
 #else
-      Xfree(psc);
+      free(psc);
 #endif
    }
 #endif
    }
-   XFree((char *) priv->screens);
+   free((char *) priv->screens);
    priv->screens = NULL;
 }
 
    priv->screens = NULL;
 }
 
@@ -231,9 +231,9 @@ glx_display_free(struct glx_display *priv)
 
    FreeScreenConfigs(priv);
    if (priv->serverGLXvendor)
 
    FreeScreenConfigs(priv);
    if (priv->serverGLXvendor)
-      Xfree((char *) priv->serverGLXvendor);
+      free((char *) priv->serverGLXvendor);
    if (priv->serverGLXversion)
    if (priv->serverGLXversion)
-      Xfree((char *) priv->serverGLXversion);
+      free((char *) priv->serverGLXversion);
 
    __glxHashDestroy(priv->glXDrawHash);
 
 
    __glxHashDestroy(priv->glXDrawHash);
 
@@ -254,7 +254,7 @@ glx_display_free(struct glx_display *priv)
    priv->dri2Display = NULL;
 #endif
 
    priv->dri2Display = NULL;
 #endif
 
-   Xfree((char *) priv);
+   free((char *) priv);
 }
 
 static int
 }
 
 static int
@@ -614,7 +614,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
    if (prop_size <= sizeof(buf))
       props = buf;
    else
    if (prop_size <= sizeof(buf))
       props = buf;
    else
-      props = Xmalloc(prop_size);
+      props = malloc(prop_size);
 
    /* Read each config structure and convert it into our format */
    m = modes;
 
    /* Read each config structure and convert it into our format */
    m = modes;
@@ -638,7 +638,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
    }
 
    if (props != buf)
    }
 
    if (props != buf)
-      Xfree(props);
+      free(props);
 
    return modes;
 }
 
    return modes;
 }
@@ -741,14 +741,14 @@ glx_screen_cleanup(struct glx_screen *psc)
    if (psc->configs) {
       glx_config_destroy_list(psc->configs);
       if (psc->effectiveGLXexts)
    if (psc->configs) {
       glx_config_destroy_list(psc->configs);
       if (psc->effectiveGLXexts)
-          Xfree(psc->effectiveGLXexts);
+          free(psc->effectiveGLXexts);
       psc->configs = NULL;   /* NOTE: just for paranoia */
    }
    if (psc->visuals) {
       glx_config_destroy_list(psc->visuals);
       psc->visuals = NULL;   /* NOTE: just for paranoia */
    }
       psc->configs = NULL;   /* NOTE: just for paranoia */
    }
    if (psc->visuals) {
       glx_config_destroy_list(psc->visuals);
       psc->visuals = NULL;   /* NOTE: just for paranoia */
    }
-   Xfree((char *) psc->serverGLXexts);
+   free((char *) psc->serverGLXexts);
 }
 
 /*
 }
 
 /*
@@ -765,7 +765,7 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
     ** First allocate memory for the array of per screen configs.
     */
    screens = ScreenCount(dpy);
     ** First allocate memory for the array of per screen configs.
     */
    screens = ScreenCount(dpy);
-   priv->screens = Xmalloc(screens * sizeof *priv->screens);
+   priv->screens = malloc(screens * sizeof *priv->screens);
    if (!priv->screens)
       return GL_FALSE;
 
    if (!priv->screens)
       return GL_FALSE;
 
@@ -823,13 +823,13 @@ __glXInitialize(Display * dpy)
    /* Drop the lock while we create the display private. */
    _XUnlockMutex(_Xglobal_lock);
 
    /* Drop the lock while we create the display private. */
    _XUnlockMutex(_Xglobal_lock);
 
-   dpyPriv = Xcalloc(1, sizeof *dpyPriv);
+   dpyPriv = calloc(1, sizeof *dpyPriv);
    if (!dpyPriv)
       return NULL;
 
    dpyPriv->codes = XInitExtension(dpy, __glXExtensionName);
    if (!dpyPriv->codes) {
    if (!dpyPriv)
       return NULL;
 
    dpyPriv->codes = XInitExtension(dpy, __glXExtensionName);
    if (!dpyPriv->codes) {
-      Xfree(dpyPriv);
+      free(dpyPriv);
       _XUnlockMutex(_Xglobal_lock);
       return NULL;
    }
       _XUnlockMutex(_Xglobal_lock);
       return NULL;
    }
@@ -845,7 +845,7 @@ __glXInitialize(Display * dpy)
    if (!QueryVersion(dpy, dpyPriv->majorOpcode,
                     &dpyPriv->majorVersion, &dpyPriv->minorVersion)
        || (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
    if (!QueryVersion(dpy, dpyPriv->majorOpcode,
                     &dpyPriv->majorVersion, &dpyPriv->minorVersion)
        || (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion < 1)) {
-      Xfree(dpyPriv);
+      free(dpyPriv);
       _XUnlockMutex(_Xglobal_lock);
       return NULL;
    }
       _XUnlockMutex(_Xglobal_lock);
       return NULL;
    }
@@ -881,12 +881,12 @@ __glXInitialize(Display * dpy)
 
 #ifdef GLX_USE_APPLEGL
    if (!applegl_create_display(dpyPriv)) {
 
 #ifdef GLX_USE_APPLEGL
    if (!applegl_create_display(dpyPriv)) {
-      Xfree(dpyPriv);
+      free(dpyPriv);
       return NULL;
    }
 #endif
    if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
       return NULL;
    }
 #endif
    if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
-      Xfree(dpyPriv);
+      free(dpyPriv);
       return NULL;
    }
 
       return NULL;
    }
 
index eb0890e23f15b54ce8be2d159be2b0b568447b4c..9332e61b427dff948b257f579179d4812854a0cb 100644 (file)
@@ -509,7 +509,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
       }
    }
 
       }
    }
 
-   ext_str = Xmalloc(ext_str_len + 1);
+   ext_str = malloc(ext_str_len + 1);
    if (ext_str != NULL) {
       point = ext_str;
 
    if (ext_str != NULL) {
       point = ext_str;
 
index 2399375a9bc2569bda92aa0bff7cea23502576b7..4f23fed3b080c1bb24fa167117d210fdb379fb5e 100644 (file)
@@ -46,17 +46,17 @@ indirect_destroy_context(struct glx_context *gc)
    __glXFreeVertexArrayState(gc);
 
    if (gc->vendor)
    __glXFreeVertexArrayState(gc);
 
    if (gc->vendor)
-      XFree((char *) gc->vendor);
+      free((char *) gc->vendor);
    if (gc->renderer)
    if (gc->renderer)
-      XFree((char *) gc->renderer);
+      free((char *) gc->renderer);
    if (gc->version)
    if (gc->version)
-      XFree((char *) gc->version);
+      free((char *) gc->version);
    if (gc->extensions)
    if (gc->extensions)
-      XFree((char *) gc->extensions);
+      free((char *) gc->extensions);
    __glFreeAttributeState(gc);
    __glFreeAttributeState(gc);
-   XFree((char *) gc->buf);
-   Xfree((char *) gc->client_state_private);
-   XFree((char *) gc);
+   free((char *) gc->buf);
+   free((char *) gc->client_state_private);
+   free((char *) gc);
 }
 
 static Bool
 }
 
 static Bool
@@ -356,7 +356,7 @@ indirect_create_context(struct glx_screen *psc,
    }
 
    /* Allocate our context record */
    }
 
    /* Allocate our context record */
-   gc = Xmalloc(sizeof *gc);
+   gc = malloc(sizeof *gc);
    if (!gc) {
       /* Out of memory */
       return NULL;
    if (!gc) {
       /* Out of memory */
       return NULL;
@@ -366,10 +366,10 @@ indirect_create_context(struct glx_screen *psc,
    glx_context_init(gc, psc, mode);
    gc->isDirect = GL_FALSE;
    gc->vtable = &indirect_context_vtable;
    glx_context_init(gc, psc, mode);
    gc->isDirect = GL_FALSE;
    gc->vtable = &indirect_context_vtable;
-   state = Xmalloc(sizeof(struct __GLXattributeRec));
+   state = malloc(sizeof(struct __GLXattributeRec));
    if (state == NULL) {
       /* Out of memory */
    if (state == NULL) {
       /* Out of memory */
-      Xfree(gc);
+      free(gc);
       return NULL;
    }
    gc->client_state_private = state;
       return NULL;
    }
    gc->client_state_private = state;
@@ -384,10 +384,10 @@ indirect_create_context(struct glx_screen *psc,
     */
 
    bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq;
     */
 
    bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq;
-   gc->buf = (GLubyte *) Xmalloc(bufSize);
+   gc->buf = (GLubyte *) malloc(bufSize);
    if (!gc->buf) {
    if (!gc->buf) {
-      Xfree(gc->client_state_private);
-      Xfree(gc);
+      free(gc->client_state_private);
+      free(gc);
       return NULL;
    }
    gc->bufSize = bufSize;
       return NULL;
    }
    gc->bufSize = bufSize;
@@ -468,7 +468,7 @@ indirect_create_screen(int screen, struct glx_display * priv)
 {
    struct glx_screen *psc;
 
 {
    struct glx_screen *psc;
 
-   psc = Xmalloc(sizeof *psc);
+   psc = malloc(sizeof *psc);
    if (psc == NULL)
       return NULL;
 
    if (psc == NULL)
       return NULL;
 
index 762950f4ac4027a452c9664b71e1d09fdd0d5aee..870f0611186c9a433b6494b2613834f1c5a4f272 100644 (file)
@@ -89,14 +89,14 @@ __indirect_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
       if (stride != k) {
          GLubyte *buf;
 
       if (stride != k) {
          GLubyte *buf;
 
-         buf = (GLubyte *) Xmalloc(compsize);
+         buf = (GLubyte *) malloc(compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          }
          __glFillMap1d(k, order, stride, pnts, buf);
          __glXSendLargeCommand(gc, pc, 32, buf, compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          }
          __glFillMap1d(k, order, stride, pnts, buf);
          __glXSendLargeCommand(gc, pc, 32, buf, compsize);
-         Xfree((char *) buf);
+         free((char *) buf);
       }
       else {
          /* Data is already packed.  Just send it out */
       }
       else {
          /* Data is already packed.  Just send it out */
@@ -152,14 +152,14 @@ __indirect_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
       if (stride != k) {
          GLubyte *buf;
 
       if (stride != k) {
          GLubyte *buf;
 
-         buf = (GLubyte *) Xmalloc(compsize);
+         buf = (GLubyte *) malloc(compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          }
          __glFillMap1f(k, order, stride, pnts, buf);
          __glXSendLargeCommand(gc, pc, 24, buf, compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          }
          __glFillMap1f(k, order, stride, pnts, buf);
          __glXSendLargeCommand(gc, pc, 24, buf, compsize);
-         Xfree((char *) buf);
+         free((char *) buf);
       }
       else {
          /* Data is already packed.  Just send it out */
       }
       else {
          /* Data is already packed.  Just send it out */
@@ -227,7 +227,7 @@ __indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr,
       if ((vstr != k) || (ustr != k * vord)) {
          GLdouble *buf;
 
       if ((vstr != k) || (ustr != k * vord)) {
          GLdouble *buf;
 
-         buf = (GLdouble *) Xmalloc(compsize);
+         buf = (GLdouble *) malloc(compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
@@ -237,7 +237,7 @@ __indirect_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustr,
           */
          __glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf);
          __glXSendLargeCommand(gc, pc, 52, buf, compsize);
           */
          __glFillMap2d(k, uord, vord, ustr, vstr, pnts, buf);
          __glXSendLargeCommand(gc, pc, 52, buf, compsize);
-         Xfree((char *) buf);
+         free((char *) buf);
       }
       else {
          /* Data is already packed.  Just send it out */
       }
       else {
          /* Data is already packed.  Just send it out */
@@ -303,7 +303,7 @@ __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr,
       if ((vstr != k) || (ustr != k * vord)) {
          GLfloat *buf;
 
       if ((vstr != k) || (ustr != k * vord)) {
          GLfloat *buf;
 
-         buf = (GLfloat *) Xmalloc(compsize);
+         buf = (GLfloat *) malloc(compsize);
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
          if (!buf) {
             __glXSetError(gc, GL_OUT_OF_MEMORY);
             return;
@@ -313,7 +313,7 @@ __indirect_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustr,
           */
          __glFillMap2f(k, uord, vord, ustr, vstr, pnts, buf);
          __glXSendLargeCommand(gc, pc, 36, buf, compsize);
           */
          __glFillMap2f(k, uord, vord, ustr, vstr, pnts, buf);
          __glXSendLargeCommand(gc, pc, 36, buf, compsize);
-         Xfree((char *) buf);
+         free((char *) buf);
       }
       else {
          /* Data is already packed.  Just send it out */
       }
       else {
          /* Data is already packed.  Just send it out */
index b54f115595967ef455faa333da6a17bab609a79f..508a1e10459e84e21e54e8bec97958a5f22e6bd4 100644 (file)
@@ -84,7 +84,7 @@ __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim,
                     GLubyte * pc, GLubyte * modes)
 {
     /* Allocate a temporary holding buffer */
                     GLubyte * pc, GLubyte * modes)
 {
     /* Allocate a temporary holding buffer */
-    GLubyte *buf = (GLubyte *) Xmalloc(compsize);
+    GLubyte *buf = (GLubyte *) malloc(compsize);
     if (!buf) {
        __glXSetError(gc, GL_OUT_OF_MEMORY);
        return;
     if (!buf) {
        __glXSetError(gc, GL_OUT_OF_MEMORY);
        return;
@@ -108,7 +108,7 @@ __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim,
     __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, buf, compsize);
 
     /* Free buffer */
     __glXSendLargeCommand(gc, gc->pc, pc - gc->pc, buf, compsize);
 
     /* Free buffer */
-    Xfree((char *) buf);
+    free((char *) buf);
 }
 
 /************************************************************************/
 }
 
 /************************************************************************/
@@ -178,7 +178,7 @@ __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat,
       pc += hdrlen;
 
       /* Allocate a temporary holding buffer */
       pc += hdrlen;
 
       /* Allocate a temporary holding buffer */
-      buf = (GLubyte *) Xmalloc(bufsize);
+      buf = (GLubyte *) malloc(bufsize);
       if (!buf) {
          __glXSetError(gc, GL_OUT_OF_MEMORY);
          return;
       if (!buf) {
          __glXSetError(gc, GL_OUT_OF_MEMORY);
          return;
@@ -193,6 +193,6 @@ __indirect_glSeparableFilter2D(GLenum target, GLenum internalformat,
       __glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), buf,
                             bufsize);
       /* Free buffer */
       __glXSendLargeCommand(gc, gc->pc, (GLint) (pc - gc->pc), buf,
                             bufsize);
       /* Free buffer */
-      Xfree((char *) buf);
+      free((char *) buf);
    }
 }
    }
 }
index d422d9dcf1a841f21d4d2ef2075ff226e385d932..993ad3647f9ad3c0c7c12037e48c053e62db0f2a 100644 (file)
@@ -721,7 +721,7 @@ __indirect_glGetString(GLenum name)
                 */
                const size_t size = 7 + strlen((char *) s) + 4;
 
                 */
                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
                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
@@ -737,7 +737,7 @@ __indirect_glGetString(GLenum name)
                else {
                   snprintf((char *) gc->version, size, "%u.%u (%s)",
                            client_major, client_minor, s);
                else {
                   snprintf((char *) gc->version, size, "%u.%u (%s)",
                            client_major, client_minor, s);
-                  Xfree(s);
+                  free(s);
                   s = gc->version;
                }
             }
                   s = gc->version;
                }
             }
@@ -782,7 +782,7 @@ __indirect_glGetString(GLenum name)
 #endif
 
             __glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
 #endif
 
             __glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
-            XFree(s);
+            free(s);
             s = gc->extensions;
             break;
          }
             s = gc->extensions;
             break;
          }
index 3c06f8d2150c7a48d6638c63b8e57753a75a18a4..6348f8285806fc91620c2c2e01bc696afbb4c1bf 100644 (file)
@@ -68,7 +68,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       heightsize = __glImageSize(height, 1, 1, format, type, 0);
 
       /* Allocate a holding buffer to transform the data from */
       heightsize = __glImageSize(height, 1, 1, format, type, 0);
 
       /* Allocate a holding buffer to transform the data from */
-      rowBuf = (GLubyte *) Xmalloc(widthsize);
+      rowBuf = (GLubyte *) malloc(widthsize);
       if (!rowBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize);
       if (!rowBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize);
@@ -80,9 +80,9 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize);
          __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row);
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize);
          __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row);
-         Xfree((char *) rowBuf);
+         free((char *) rowBuf);
       }
       }
-      colBuf = (GLubyte *) Xmalloc(heightsize);
+      colBuf = (GLubyte *) malloc(heightsize);
       if (!colBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize - __GLX_PAD(widthsize));
       if (!colBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize - __GLX_PAD(widthsize));
@@ -94,7 +94,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize);
          __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column);
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize);
          __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column);
-         Xfree((char *) colBuf);
+         free((char *) colBuf);
       }
    }
    else {
       }
    }
    else {
@@ -155,8 +155,7 @@ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
             const GLint heightsize =
                __glImageSize(height, 1, 1, format, type, 0);
             GLubyte *const buf =
             const GLint heightsize =
                __glImageSize(height, 1, 1, format, type, 0);
             GLubyte *const buf =
-               (GLubyte *) Xmalloc((widthsize > heightsize) ? widthsize :
-                                   heightsize);
+               (GLubyte *) malloc((widthsize > heightsize) ? widthsize : heightsize);
 
             if (buf == NULL) {
                /* Throw data away */
 
             if (buf == NULL) {
                /* Throw data away */
@@ -186,7 +185,7 @@ void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
 
                __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
 
 
                __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
 
-               Xfree((char *) buf);
+               free((char *) buf);
             }
          }
       }
             }
          }
       }
index 4ca2c8f868f4afe43ee84d2fd055c9105bbffc2d..065938f05049335f54ee83fb12c9509e872eca0e 100644 (file)
@@ -245,7 +245,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
    max_bm_width = (max_width + 7) / 8;
    max_bm_height = max_height;
 
    max_bm_width = (max_width + 7) / 8;
    max_bm_height = max_height;
 
-   bm = (GLubyte *) Xmalloc((max_bm_width * max_bm_height) * sizeof(GLubyte));
+   bm = (GLubyte *) malloc((max_bm_width * max_bm_height) * sizeof(GLubyte));
    if (!bm) {
       XFreeFontInfo(NULL, fs, 1);
       __glXSetError(CC, GL_OUT_OF_MEMORY);
    if (!bm) {
       XFreeFontInfo(NULL, fs, 1);
       __glXSetError(CC, GL_OUT_OF_MEMORY);
@@ -359,7 +359,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
       glEndList();
    }
 
       glEndList();
    }
 
-   Xfree(bm);
+   free(bm);
    XFreeFontInfo(NULL, fs, 1);
    XFreeGC(dpy, gc);
 
    XFreeFontInfo(NULL, fs, 1);
    XFreeGC(dpy, gc);
 
index c30ba04a01ce36b3430b2f7c74e1950eb7a24005..d5a59b4566c7ef5bda95766492e163e0bfff98db 100644 (file)
@@ -201,7 +201,7 @@ GetOverlayInfo(Display *dpy, int screen, int *numOverlays)
    if (status != Success || actualType != overlayVisualsAtom ||
        actualFormat != 32 || sizeData < 4) {
       /* something went wrong */
    if (status != Success || actualType != overlayVisualsAtom ||
        actualFormat != 32 || sizeData < 4) {
       /* something went wrong */
-      XFree((void *) ovInfo);
+      free((void *) ovInfo);
       *numOverlays = 0;
       return NULL;
    }
       *numOverlays = 0;
       return NULL;
    }
@@ -239,18 +239,18 @@ level_of_visual( Display *dpy, XVisualInfo *vinfo )
          /* found the visual */
          if (/*ov->transparent_type==1 &&*/ ov->layer!=0) {
             int level = ov->layer;
          /* found the visual */
          if (/*ov->transparent_type==1 &&*/ ov->layer!=0) {
             int level = ov->layer;
-            XFree((void *) overlay_info);
+            free((void *) overlay_info);
             return level;
          }
          else {
             return level;
          }
          else {
-            XFree((void *) overlay_info);
+            free((void *) overlay_info);
             return 0;
          }
       }
    }
 
    /* The visual ID was not found in the overlay list. */
             return 0;
          }
       }
    }
 
    /* The visual ID was not found in the overlay list. */
-   XFree((void *) overlay_info);
+   free((void *) overlay_info);
    return 0;
 }
 
    return 0;
 }
 
@@ -497,19 +497,19 @@ transparent_pixel( XMesaVisual glxvis )
          /* found it! */
          if (ov->transparent_type == 0) {
             /* type 0 indicates no transparency */
          /* found it! */
          if (ov->transparent_type == 0) {
             /* type 0 indicates no transparency */
-            XFree((void *) overlay_info);
+            free((void *) overlay_info);
             return -1;
          }
          else {
             /* ov->value is the transparent pixel */
             return -1;
          }
          else {
             /* ov->value is the transparent pixel */
-            XFree((void *) overlay_info);
+            free((void *) overlay_info);
             return ov->value;
          }
       }
    }
 
    /* The visual ID was not found in the overlay list. */
             return ov->value;
          }
       }
    }
 
    /* The visual ID was not found in the overlay list. */
-   XFree((void *) overlay_info);
+   free((void *) overlay_info);
    return -1;
 }
 
    return -1;
 }
 
@@ -554,7 +554,7 @@ get_visual( Display *dpy, int scr, unsigned int depth, int xclass )
          return vis;
       }
       else {
          return vis;
       }
       else {
-         XFree((void *) vis);
+         free((void *) vis);
          return NULL;
       }
    }
          return NULL;
       }
    }
@@ -780,7 +780,7 @@ choose_x_overlay_visual( Display *dpy, int scr,
       if (deepvis==NULL || vislist->depth > deepest) {
          /* YES!  found a satisfactory visual */
          if (deepvis) {
       if (deepvis==NULL || vislist->depth > deepest) {
          /* YES!  found a satisfactory visual */
          if (deepvis) {
-            XFree( deepvis );
+            free(deepvis);
          }
          deepest = vislist->depth;
          deepvis = vislist;
          }
          deepest = vislist->depth;
          deepvis = vislist;