diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-29 19:07:38 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-29 19:07:38 -0700 |
commit | 1ccae1f9d9b1f62a86c58837c6a737f2aea9c119 (patch) | |
tree | b2bc0271144255c2285778762beb930c613d2e2e | |
parent | 86258a6fd8fc8bb09a52ee446b37abe6bd0843ef (diff) |
Use malloc/calloc/realloc/free directly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | src/xg47_cmdlist.c | 2 | ||||
-rw-r--r-- | src/xg47_display.c | 6 | ||||
-rw-r--r-- | src/xg47_video.c | 26 | ||||
-rw-r--r-- | src/xgi_dga.c | 6 | ||||
-rw-r--r-- | src/xgi_dri.c | 4 | ||||
-rw-r--r-- | src/xgi_driver.c | 14 | ||||
-rw-r--r-- | src/xgi_hwmc.c | 8 | ||||
-rw-r--r-- | src/xgi_option.c | 2 |
8 files changed, 34 insertions, 34 deletions
diff --git a/src/xg47_cmdlist.c b/src/xg47_cmdlist.c index 4c119df..1f8374c 100644 --- a/src/xg47_cmdlist.c +++ b/src/xg47_cmdlist.c @@ -138,7 +138,7 @@ void xg47_Cleanup(ScrnInfoPtr pScrn, struct xg47_CmdList *s_pCmdList) s_pCmdList->command.ptr); } - xfree(s_pCmdList); + free(s_pCmdList); } } diff --git a/src/xg47_display.c b/src/xg47_display.c index 42c98e2..6c2b265 100644 --- a/src/xg47_display.c +++ b/src/xg47_display.c @@ -181,7 +181,7 @@ void xg47_crtc_destroy(xf86CrtcPtr crtc) { if (crtc->driver_private) { - xfree (crtc->driver_private); + free (crtc->driver_private); } } @@ -193,14 +193,14 @@ xg47_CrtcInit(ScrnInfoPtr pScrn, unsigned dev_type) struct xg47_crtc_data *data; - data = xcalloc(sizeof(*data), 1); + data = calloc(sizeof(*data), 1); if (data == NULL) { return FALSE; } crtc = xf86CrtcCreate(pScrn, & xg47_crtc_funcs); if (crtc == NULL) { - xfree(data); + free(data); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to create CRTC structure.\n"); return; diff --git a/src/xg47_video.c b/src/xg47_video.c index 8d66061..c2deb95 100644 --- a/src/xg47_video.c +++ b/src/xg47_video.c @@ -203,7 +203,7 @@ void XG47InitVideo(ScreenPtr pScreen) else { /* need to free this someplace */ - newAdaptors = xalloc((numAdaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + newAdaptors = malloc((numAdaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); if(newAdaptors) { memcpy(newAdaptors, adaptors, numAdaptors * sizeof(XF86VideoAdaptorPtr)); @@ -218,7 +218,7 @@ void XG47InitVideo(ScreenPtr pScreen) xf86XVScreenInit(pScreen, adaptors, numAdaptors); if(newAdaptors) - xfree(newAdaptors); + free(newAdaptors); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "XGI Video Init Successfully \n"); } @@ -230,7 +230,7 @@ static XF86VideoAdaptorPtr XG47SetupImageVideo(ScreenPtr pScreen) XGIPtr pXGI = XGIPTR(pScrn); XGIPortPtr pXGIPort = NULL; - pAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) + pAdaptor = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(XGIPortRec) + sizeof(DevUnion)); if(!pAdaptor) @@ -363,7 +363,7 @@ static void XG47InitOffscreenImages(ScreenPtr pScreen) XF86OffscreenImagePtr pOffscreenImages; /* need to free this someplace */ - if(!(pOffscreenImages = xalloc(sizeof(XF86OffscreenImageRec)))) + if(!(pOffscreenImages = malloc(sizeof(XF86OffscreenImageRec)))) return; pOffscreenImages[0].image = &XG47Images[0]; @@ -1366,21 +1366,21 @@ static int XG47AllocateSurface(ScrnInfoPtr pScrn, pSurface->width = w; pSurface->height = h; - if(!(pSurface->pitches = xalloc(sizeof(int)))) + if(!(pSurface->pitches = malloc(sizeof(int)))) { xf86FreeOffscreenLinear((FBLinearPtr)pSurface); return BadAlloc; } - if(!(pSurface->offsets = xalloc(sizeof(int)))) + if(!(pSurface->offsets = malloc(sizeof(int)))) { - xfree(pSurface->pitches); + free(pSurface->pitches); xf86FreeOffscreenLinear(pFBLinear); return BadAlloc; } - if(!(pOffscreenPriv = xalloc(sizeof(OffscreenPrivRec)))) + if(!(pOffscreenPriv = malloc(sizeof(OffscreenPrivRec)))) { - xfree(pSurface->pitches); - xfree(pSurface->offsets); + free(pSurface->pitches); + free(pSurface->offsets); xf86FreeOffscreenLinear(pFBLinear); return BadAlloc; } @@ -1424,9 +1424,9 @@ static int XG47FreeSurface(XF86SurfacePtr pSurface) XG47StopSurface(pSurface); } xf86FreeOffscreenLinear(pOffscreenPriv->pFBLinear); - xfree(pSurface->pitches); - xfree(pSurface->offsets); - xfree(pSurface->devPrivate.ptr); + free(pSurface->pitches); + free(pSurface->offsets); + free(pSurface->devPrivate.ptr); return Success; } diff --git a/src/xgi_dga.c b/src/xgi_dga.c index e53d227..ac43850 100644 --- a/src/xgi_dga.c +++ b/src/xgi_dga.c @@ -76,18 +76,18 @@ Bool XGIDGAInit(ScreenPtr pScreen) { if(0 /*pScrn->displayWidth != pMode->HDisplay*/) { - pNewDgaModes = xrealloc(pDgaModes, (num + 2) * sizeof(DGAModeRec)); + pNewDgaModes = realloc(pDgaModes, (num + 2) * sizeof(DGAModeRec)); oneMore = TRUE; } else { - pNewDgaModes = xrealloc(pDgaModes, (num + 1) * sizeof(DGAModeRec)); + pNewDgaModes = realloc(pDgaModes, (num + 1) * sizeof(DGAModeRec)); oneMore = FALSE; } if(!pNewDgaModes) { - xfree(pDgaModes); + free(pDgaModes); return FALSE; } pDgaModes = pNewDgaModes; diff --git a/src/xgi_dri.c b/src/xgi_dri.c index 66b7274..0e73212 100644 --- a/src/xgi_dri.c +++ b/src/xgi_dri.c @@ -130,7 +130,7 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen) } dri_info->SAREASize = SAREA_MAX; - dri_priv = xcalloc(sizeof(struct xgi_dri_private), 1); + dri_priv = calloc(sizeof(struct xgi_dri_private), 1); dri_info->devPrivate = dri_priv; if (dri_priv == NULL) { @@ -264,7 +264,7 @@ void XGIDRICloseScreen(ScreenPtr pScreen) /* De-allocate all DRI data structures */ if (pXGI->dri_info) { if (pXGI->dri_info->devPrivate) { - xfree(pXGI->dri_info->devPrivate); + free(pXGI->dri_info->devPrivate); pXGI->dri_info->devPrivate = NULL; } diff --git a/src/xgi_driver.c b/src/xgi_driver.c index 189b84a..f846e6b 100644 --- a/src/xgi_driver.c +++ b/src/xgi_driver.c @@ -643,10 +643,10 @@ static Bool XGIProbe(DriverPtr drv, int flags) #endif /* XGIDUALVIEW */ } } - xfree(usedChips); + free(usedChips); } - xfree(devSections); + free(devSections); return foundScreen; } #endif @@ -679,7 +679,7 @@ static void XGIFreeRec(ScrnInfoPtr pScrn) { return; } - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; #if DBG_FLOW @@ -1993,7 +1993,7 @@ Bool XGIScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (pXGI->isShadowFB) { pXGI->shadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pXGI->pShadow = xalloc(pXGI->shadowPitch * height); + pXGI->pShadow = malloc(pXGI->shadowPitch * height); displayWidth = pXGI->shadowPitch / (pScrn->bitsPerPixel >> 3); pFBStart = pXGI->pShadow; } @@ -2434,19 +2434,19 @@ static Bool XGICloseScreen(int scrnIndex, ScreenPtr pScreen) if (pXGI->pShadow) { - xfree(pXGI->pShadow); + free(pXGI->pShadow); pXGI->pShadow = NULL; } if (pXGI->pDgaModes) { - xfree(pXGI->pDgaModes); + free(pXGI->pDgaModes); pXGI->pDgaModes = NULL; } if (pXGI->pAdaptor) { - /* xfree(pXGI->pAdaptor->pPortPrivates[0].ptr); */ + /* free(pXGI->pAdaptor->pPortPrivates[0].ptr); */ xf86XVFreeVideoAdaptorRec(pXGI->pAdaptor); pXGI->pAdaptor = NULL; } diff --git a/src/xgi_hwmc.c b/src/xgi_hwmc.c index 8606ac9..b0d2f58 100644 --- a/src/xgi_hwmc.c +++ b/src/xgi_hwmc.c @@ -204,7 +204,7 @@ Bool XGIInitMC(ScreenPtr pScreen) * Set *numPriv to the number of 32bit words that make up the size of * of the data that priv will point to. * - * *priv = (long *) xcalloc (elements, sizeof(element)) + * *priv = (long *) calloc (elements, sizeof(element)) * *numPriv = (elements * sizeof(element)) >> 2; * **************************************************************************/ @@ -226,7 +226,7 @@ int XGIXvMCCreateContext(ScrnInfoPtr pScrn, XvMCContextPtr pContext, return BadAlloc; } - *priv = xcalloc(1, sizeof(XGIXvMCCreateContextRec)); + *priv = calloc(1, sizeof(XGIXvMCCreateContextRec)); if (!*priv) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -269,7 +269,7 @@ int XGIXvMCCreateSurface(ScrnInfoPtr pScrn, xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"surface_type_id = %x width = %d, height = %d\n", pContext->surface_type_id, pContext->width, pContext->height); - *priv = (long *)xcalloc(1, sizeof(XGIXvMCCreateSurfaceRec)); + *priv = (long *)calloc(1, sizeof(XGIXvMCCreateSurfaceRec)); if (!*priv) { xf86DrvMsg(X_ERROR, pScrn->scrnIndex, @@ -343,7 +343,7 @@ int XGIXvMCCreateSubpicture(ScrnInfoPtr pScrn, xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "subpicture_id = %x xvimage_id = %x width = %d, height = %d\n", pSubpicture->subpicture_id, pSubpicture->xvimage_id, pSubpicture->width, pSubpicture->height); - *priv = (long *)xcalloc(1, sizeof(XGIXvMCSubpictureRec)); + *priv = (long *)calloc(1, sizeof(XGIXvMCSubpictureRec)); if (!*priv) { xf86DrvMsg(X_ERROR, pScrn->scrnIndex, diff --git a/src/xgi_option.c b/src/xgi_option.c index b078e90..280692e 100644 --- a/src/xgi_option.c +++ b/src/xgi_option.c @@ -90,7 +90,7 @@ Bool XGIProcessOptions(ScrnInfoPtr pScrn) xf86CollectOptions(pScrn, NULL); - if (!(pXGI->pOptionInfo = xalloc(XGIOptionSize))) + if (!(pXGI->pOptionInfo = malloc(XGIOptionSize))) return FALSE; memcpy(pXGI->pOptionInfo, XGIOptions, XGIOptionSize); |