diff options
author | Julien Cristau <jcristau@debian.org> | 2012-05-12 13:16:16 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2012-05-12 13:16:16 +0200 |
commit | 8dd5542ba4dd8f51b4a87142b8e61af8b88e7957 (patch) | |
tree | 8c952571947766408f44be6b496e59411d3d00e6 | |
parent | 421f4e721938515fe93f8e81fe6d18be50e5ffee (diff) |
Replace deprecated xalloc/xrealloc/xcalloc/xfree with the standard functions
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | src/i740_dga.c | 4 | ||||
-rw-r--r-- | src/i740_driver.c | 9 | ||||
-rw-r--r-- | src/i740_video.c | 26 |
3 files changed, 19 insertions, 20 deletions
diff --git a/src/i740_dga.c b/src/i740_dga.c index 19a6d0d..8fac946 100644 --- a/src/i740_dga.c +++ b/src/i740_dga.c @@ -78,10 +78,10 @@ Bool I740DGAInit(ScreenPtr pScreen) while(pMode) { - newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec)); + newmodes = realloc(modes, (num + 1) * sizeof(DGAModeRec)); if(!newmodes) { - xfree(modes); + free(modes); return FALSE; } modes = newmodes; diff --git a/src/i740_driver.c b/src/i740_driver.c index 2eb8d98..7a57431 100644 --- a/src/i740_driver.c +++ b/src/i740_driver.c @@ -256,8 +256,7 @@ I740GetRec(ScrnInfoPtr pScrn) { static void I740FreeRec(ScrnInfoPtr pScrn) { if (!pScrn) return; - if (!pScrn->driverPrivate) return; - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate=0; } @@ -371,8 +370,8 @@ I740Probe(DriverPtr drv, int flags) { } } - xfree(devSections); - xfree(usedChips); + free(devSections); + free(usedChips); return foundScreen; } @@ -488,7 +487,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { /* Process the options */ xf86CollectOptions(pScrn, NULL); - if (!(pI740->Options = xalloc(sizeof(I740Options)))) + if (!(pI740->Options = malloc(sizeof(I740Options)))) return FALSE; memcpy(pI740->Options, I740Options, sizeof(I740Options)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI740->Options); diff --git a/src/i740_video.c b/src/i740_video.c index 8cfe09a..2a26f21 100644 --- a/src/i740_video.c +++ b/src/i740_video.c @@ -912,18 +912,18 @@ static int I740AllocateSurface( surface->width = w; surface->height = h; - if(!(surface->pitches = xalloc(sizeof(int)))) { + if(!(surface->pitches = malloc(sizeof(int)))) { xf86FreeOffscreenLinear(linear); return BadAlloc; } - if(!(surface->offsets = xalloc(sizeof(int)))) { - xfree(surface->pitches); + if(!(surface->offsets = malloc(sizeof(int)))) { + free(surface->pitches); xf86FreeOffscreenLinear(linear); return BadAlloc; } - if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) { - xfree(surface->pitches); - xfree(surface->offsets); + if(!(pPriv = malloc(sizeof(OffscreenPrivRec)))) { + free(surface->pitches); + free(surface->offsets); xf86FreeOffscreenLinear(linear); return BadAlloc; } @@ -967,9 +967,9 @@ static int I740FreeSurface(XF86SurfacePtr surface) } xf86FreeOffscreenLinear(pPriv->linear); - xfree(surface->pitches); - xfree(surface->offsets); - xfree(surface->devPrivate.ptr); + free(surface->pitches); + free(surface->offsets); + free(surface->devPrivate.ptr); return Success; } @@ -1128,7 +1128,7 @@ static void I740InitOffscreenImages(ScreenPtr pScreen) } /* need to free this someplace */ - if(!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)))) + if(!(offscreenImages = malloc(sizeof(XF86OffscreenImageRec)))) { return; } @@ -1179,7 +1179,7 @@ static XF86VideoAdaptorPtr I740SetupImageVideo(ScreenPtr pScreen) { const int n=sizeof(XF86VideoAdaptorRec)+sizeof(I740PortPrivRec)+sizeof(DevUnion); - if(!(adapt = xcalloc(1, n))) + if(!(adapt = calloc(1, n))) return NULL; /*//memset(adapt,0,n);*/ @@ -1276,7 +1276,7 @@ void I740InitVideo(ScreenPtr pScreen) } else { - if((adaptors_newptrs = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr)))) + if((adaptors_newptrs = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr)))) { memcpy(adaptors_newptrs, adaptors_oldptrs, num_adaptors * sizeof(XF86VideoAdaptorPtr)); adaptors_newptrs[num_adaptors] = newAdaptor; @@ -1286,7 +1286,7 @@ void I740InitVideo(ScreenPtr pScreen) xf86XVScreenInit(pScreen, adaptors_newptrs, num_adaptors+1); - xfree(adaptors_newptrs); + free(adaptors_newptrs); } } } |