st/xorg: Don't use deprecated x*alloc / xfree functions
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 19 Oct 2010 08:39:24 +0000 (10:39 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 19 Oct 2010 09:28:18 +0000 (11:28 +0200)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_output.c

index c65da71cdba6f6b4bba68be7ae234ac80c3397d5..80af82d97b23eaf62ed24db23e9096492d774f6f 100644 (file)
@@ -361,7 +361,7 @@ crtc_destroy(xf86CrtcPtr crtc)
 
     drmModeFreeCrtc(crtcp->drm_crtc);
 
-    xfree(crtcp);
+    free(crtcp);
     crtc->driver_private = NULL;
 }
 
@@ -409,7 +409,7 @@ xorg_crtc_init(ScrnInfoPtr pScrn)
        if (crtc == NULL)
            goto out;
 
-       crtcp = xcalloc(1, sizeof(struct crtc_private));
+       crtcp = calloc(1, sizeof(struct crtc_private));
        if (!crtcp) {
            xf86CrtcDestroy(crtc);
            goto out;
index 704aed6a82cd294ba2c4166e2500b2ca56f6b95a..b723a8e9cb0cdcc5d917b121f6e7ac89031dedea 100644 (file)
@@ -201,11 +201,11 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
     DRI2Buffer2Ptr buffer;
     BufferPrivatePtr private;
 
-    buffer = xcalloc(1, sizeof *buffer);
+    buffer = calloc(1, sizeof *buffer);
     if (!buffer)
        return NULL;
 
-    private = xcalloc(1, sizeof *private);
+    private = calloc(1, sizeof *private);
     if (!private) {
        goto fail;
     }
@@ -217,9 +217,9 @@ dri2_create_buffer(DrawablePtr pDraw, unsigned int attachment, unsigned int form
     if (dri2_do_create_buffer(pDraw, (DRI2BufferPtr)buffer, format))
        return buffer;
 
-    xfree(private);
+    free(private);
 fail:
-    xfree(buffer);
+    free(buffer);
     return NULL;
 }
 
@@ -229,8 +229,8 @@ dri2_destroy_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
     /* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */
     dri2_do_destroy_buffer(pDraw, (DRI2BufferPtr)buffer);
 
-    xfree(buffer->driverPrivate);
-    xfree(buffer);
+    free(buffer->driverPrivate);
+    free(buffer);
 }
 
 #endif /* DRI2INFOREC_VERSION >= 2 */
@@ -244,11 +244,11 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
     DRI2BufferPtr buffers;
     int i;
 
-    buffers = xcalloc(count, sizeof *buffers);
+    buffers = calloc(count, sizeof *buffers);
     if (!buffers)
        goto fail_buffers;
 
-    privates = xcalloc(count, sizeof *privates);
+    privates = calloc(count, sizeof *privates);
     if (!privates)
        goto fail_privates;
 
@@ -263,9 +263,9 @@ dri2_create_buffers(DrawablePtr pDraw, unsigned int *attachments, int count)
     return buffers;
 
 fail:
-    xfree(privates);
+    free(privates);
 fail_privates:
-    xfree(buffers);
+    free(buffers);
 fail_buffers:
     return NULL;
 }
@@ -280,8 +280,8 @@ dri2_destroy_buffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
     }
 
     if (buffers) {
-       xfree(buffers[0].driverPrivate);
-       xfree(buffers);
+       free(buffers[0].driverPrivate);
+       free(buffers);
     }
 }
 
index 3a5db9856d48f9d5d8703aa6f39d9cfb0c73c783..2d71a5e792f27239a1c866e47ffba0fce0a0d6ae 100644 (file)
@@ -122,7 +122,7 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
 Bool
 xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
 {
-    char *BusID = xalloc(64);
+    char *BusID = malloc(64);
     sprintf(BusID, "pci:%04x:%02x:%02x.%d",
            device->domain, device->bus,
            device->dev, device->func);
@@ -130,14 +130,14 @@ xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
     if (drmCheckModesettingSupported(BusID)) {
        xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
                       "Drm modesetting not supported %s\n", BusID);
-       xfree(BusID);
+       free(BusID);
        return FALSE;
     }
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
                   "Drm modesetting supported on %s\n", BusID);
 
-    xfree(BusID);
+    free(BusID);
     return TRUE;
 }
 
@@ -174,7 +174,7 @@ drv_free_rec(ScrnInfoPtr pScrn)
     if (!pScrn->driverPrivate)
        return;
 
-    xfree(pScrn->driverPrivate);
+    free(pScrn->driverPrivate);
 
     pScrn->driverPrivate = NULL;
 }
@@ -274,7 +274,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
     if (ms->fd < 0) {
        char *BusID;
 
-       BusID = xalloc(64);
+       BusID = malloc(64);
        sprintf(BusID, "PCI:%d:%d:%d",
                ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
                ms->PciInfo->dev, ms->PciInfo->func
@@ -283,7 +283,7 @@ drv_init_drm(ScrnInfoPtr pScrn)
 
        ms->fd = drmOpen(driver_descriptor.driver_name, BusID);
        ms->isMaster = TRUE;
-       xfree(BusID);
+       free(BusID);
 
        if (ms->fd >= 0)
            return TRUE;
@@ -432,7 +432,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
 
     /* Process the options */
     xf86CollectOptions(pScrn, NULL);
-    if (!(ms->Options = xalloc(sizeof(drv_options))))
+    if (!(ms->Options = malloc(sizeof(drv_options))))
        return FALSE;
     memcpy(ms->Options, drv_options, sizeof(drv_options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
index 6b2c80fbca60a1607d1098e62786b248d56e037b..0e5693dc786129a5d11af92bcbe390fc49cd0dc7 100644 (file)
@@ -720,7 +720,7 @@ ExaCreatePixmap(ScreenPtr pScreen, int size, int align)
 {
     struct exa_pixmap_priv *priv;
 
-    priv = xcalloc(1, sizeof(struct exa_pixmap_priv));
+    priv = calloc(1, sizeof(struct exa_pixmap_priv));
     if (!priv)
        return NULL;
 
@@ -737,7 +737,7 @@ ExaDestroyPixmap(ScreenPtr pScreen, void *dPriv)
 
     pipe_resource_reference(&priv->tex, NULL);
 
-    xfree(priv);
+    free(priv);
 }
 
 static Bool
@@ -975,7 +975,7 @@ xorg_exa_close(ScrnInfoPtr pScrn)
    ms->ctx = NULL;
 
    exaDriverFini(pScrn->pScreen);
-   xfree(exa);
+   free(exa);
    ms->exa = NULL;
 }
 
@@ -987,7 +987,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel)
    ExaDriverPtr pExa;
    CustomizerPtr cust = ms->cust;
 
-   exa = xcalloc(1, sizeof(struct exa_context));
+   exa = calloc(1, sizeof(struct exa_context));
    if (!exa)
       return NULL;
 
index 61206ed751ca9385c6d23e34c82b031c3f86f57c..5555b51131cdb1f30847ecc1dc5ab0c6473d87db 100644 (file)
@@ -128,7 +128,7 @@ output_get_modes(xf86OutputPtr output)
     for (i = 0; i < drm_connector->count_modes; i++) {
        drm_mode = &drm_connector->modes[i];
        if (drm_mode) {
-           mode = xcalloc(1, sizeof(DisplayModeRec));
+           mode = calloc(1, sizeof(DisplayModeRec));
            if (!mode)
                continue;
            mode->Clock = drm_mode->clock;
@@ -195,7 +195,7 @@ output_destroy(xf86OutputPtr output)
 {
     struct output_private *priv = output->driver_private;
     drmModeFreeConnector(priv->drm_connector);
-    xfree(priv);
+    free(priv);
     output->driver_private = NULL;
 }
 
@@ -262,14 +262,14 @@ xorg_output_init(ScrnInfoPtr pScrn)
                 drm_connector->connector_type_id);
 
 
-       priv = xcalloc(sizeof(*priv), 1);
+       priv = calloc(sizeof(*priv), 1);
        if (!priv) {
            continue;
        }
 
        output = xf86OutputCreate(pScrn, &output_funcs, name);
        if (!output) {
-           xfree(priv);
+           free(priv);
            continue;
        }