summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-10-11 10:43:51 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-10-11 10:43:51 -0700
commitc3cf7e328d7e9c276a3e237dbf9d1772b57a370e (patch)
tree70e1d8634993d3e991de5b9061797198c4f70842
parenta9d69f6d0ab4f66b954949cca016ee7b5b6f7adf (diff)
Use malloc/calloc/realloc/free directly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--src/neo_dga.c4
-rw-r--r--src/neo_driver.c18
-rw-r--r--src/neo_video.c26
3 files changed, 24 insertions, 24 deletions
diff --git a/src/neo_dga.c b/src/neo_dga.c
index 4227da6..3e2a02e 100644
--- a/src/neo_dga.c
+++ b/src/neo_dga.c
@@ -86,10 +86,10 @@ NEODGAInit(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/neo_driver.c b/src/neo_driver.c
index b12c125..c51dad4 100644
--- a/src/neo_driver.c
+++ b/src/neo_driver.c
@@ -475,7 +475,7 @@ NEOFreeRec(ScrnInfoPtr pScrn)
{
if (pScrn->driverPrivate == NULL)
return;
- xfree(pScrn->driverPrivate);
+ free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -551,7 +551,7 @@ NEOProbe(DriverPtr drv, int flags)
foundScreen = TRUE;
}
}
- xfree(usedChips);
+ free(usedChips);
}
}
@@ -584,11 +584,11 @@ NEOProbe(DriverPtr drv, int flags)
foundScreen = TRUE;
}
}
- xfree(usedChips);
+ free(usedChips);
}
#endif
- xfree(devSections);
+ free(devSections);
return foundScreen;
}
@@ -940,11 +940,11 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
xf86CollectOptions(pScrn, NULL);
/* Process the options */
if (nPtr->NeoChipset == NM2070) {
- if (!(nPtr->Options = xalloc(sizeof(NEO_2070_Options))))
+ if (!(nPtr->Options = malloc(sizeof(NEO_2070_Options))))
return FALSE;
memcpy(nPtr->Options, NEO_2070_Options, sizeof(NEO_2070_Options));
} else {
- if (!(nPtr->Options = xalloc(sizeof(NEOOptions))))
+ if (!(nPtr->Options = malloc(sizeof(NEOOptions))))
return FALSE;
memcpy(nPtr->Options, NEOOptions, sizeof(NEOOptions));
}
@@ -1476,7 +1476,7 @@ NEOScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if(nPtr->shadowFB) {
nPtr->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
- nPtr->ShadowPtr = xalloc(nPtr->ShadowPitch * height);
+ nPtr->ShadowPtr = malloc(nPtr->ShadowPitch * height);
displayWidth = nPtr->ShadowPitch / (pScrn->bitsPerPixel >> 3);
FBStart = nPtr->ShadowPtr;
} else {
@@ -1789,7 +1789,7 @@ NEOCloseScreen(int scrnIndex, ScreenPtr pScreen)
if (nPtr->CursorInfo)
xf86DestroyCursorInfoRec(nPtr->CursorInfo);
if (nPtr->ShadowPtr)
- xfree(nPtr->ShadowPtr);
+ free(nPtr->ShadowPtr);
pScrn->vtSema = FALSE;
pScreen->CloseScreen = nPtr->CloseScreen;
@@ -2860,7 +2860,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (NeoNew->reg) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Non-NULL reg in NeoInit: reg=%p\n", (void *)NeoNew->reg);
- xfree(NeoNew->reg);
+ free(NeoNew->reg);
NeoNew->reg = NULL;
}
diff --git a/src/neo_video.c b/src/neo_video.c
index a9e1e25..0edae30 100644
--- a/src/neo_video.c
+++ b/src/neo_video.c
@@ -99,7 +99,7 @@ NEOInitVideo(ScreenPtr pScreen)
numAdaptors = 1;
overlayAdaptors = &newAdaptor;
} else {
- newAdaptors = xalloc((numAdaptors + 1)
+ newAdaptors = malloc((numAdaptors + 1)
* sizeof(XF86VideoAdaptorPtr*));
if (newAdaptors){
memcpy(newAdaptors, overlayAdaptors,
@@ -114,7 +114,7 @@ NEOInitVideo(ScreenPtr pScreen)
xf86XVScreenInit(pScreen, overlayAdaptors, numAdaptors);
if (newAdaptors)
- xfree(newAdaptors);
+ free(newAdaptors);
}
static XF86VideoEncodingRec NEOVideoEncodings[] =
@@ -211,7 +211,7 @@ NEOSetupVideo(ScreenPtr pScreen)
#ifdef DEBUG
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"NEOSetupVideo\n");
#endif
- if ((overlayAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+ if ((overlayAdaptor = calloc(1, sizeof(XF86VideoAdaptorRec) +
sizeof(DevUnion) +
sizeof(NEOPortRec))) == NULL){
return (NULL);
@@ -918,7 +918,7 @@ NEOInitOffscreenImages(ScreenPtr pScreen)
#ifdef DEBUG
xf86DrvMsg(xf86Screens[pScreen->myNum]->scrnIndex,X_INFO,"NEOInitOffscreenImages\n");
#endif
- if ((offscreenImages = xalloc(sizeof(XF86OffscreenImageRec))) == NULL){
+ if ((offscreenImages = malloc(sizeof(XF86OffscreenImageRec))) == NULL){
return;
}
@@ -1017,19 +1017,19 @@ NEOAllocSurface(ScrnInfoPtr pScrn, int id,
surface->width = width;
surface->height = height;
- if ((surface->pitches = xalloc(sizeof(int))) == NULL){
+ if ((surface->pitches = malloc(sizeof(int))) == NULL){
xf86FreeOffscreenLinear(linear);
return (BadAlloc);
}
- if ((surface->offsets = xalloc(sizeof(int))) == NULL){
- xfree(surface->pitches);
+ if ((surface->offsets = malloc(sizeof(int))) == NULL){
+ free(surface->pitches);
xf86FreeOffscreenLinear(linear);
return (BadAlloc);
}
- if ((pPriv = xalloc(sizeof(NEOOffscreenRec))) == NULL){
- xfree(surface->pitches);
- xfree(surface->offsets);
+ if ((pPriv = malloc(sizeof(NEOOffscreenRec))) == NULL){
+ free(surface->pitches);
+ free(surface->offsets);
xf86FreeOffscreenLinear(linear);
return (BadAlloc);
}
@@ -1057,9 +1057,9 @@ NEOFreeSurface(XF86SurfacePtr surface)
NEOStopSurface(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);
}