diff options
author | Matt Turner <mattst88@gmail.com> | 2011-09-26 22:22:09 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-09-27 22:47:29 -0400 |
commit | ee09a9a340f8946f2d4a71a431b64189dbb5c256 (patch) | |
tree | 77a01d037b6d0f9a37b3729e00d587201d2e995e /src | |
parent | 94bbeb132c7eda912d1b402a1a91ca7cbbf5e6a1 (diff) |
Remove xalloc/xcalloc/xrealloc/xfree
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mga_dga.c | 2 | ||||
-rw-r--r-- | src/mga_dri.c | 70 | ||||
-rw-r--r-- | src/mga_driver.c | 28 | ||||
-rw-r--r-- | src/mga_merge.c | 22 | ||||
-rw-r--r-- | src/mga_storm.c | 2 | ||||
-rw-r--r-- | src/mga_vga.c | 6 | ||||
-rw-r--r-- | src/mga_video.c | 30 |
7 files changed, 80 insertions, 80 deletions
diff --git a/src/mga_dga.c b/src/mga_dga.c index d43b96d..224e4ba 100644 --- a/src/mga_dga.c +++ b/src/mga_dga.c @@ -111,7 +111,7 @@ SECOND_PASS: if(secondPitch) pitch = secondPitch; - if(!(newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec)))) + if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec)))) break; modes = newmodes; diff --git a/src/mga_dri.c b/src/mga_dri.c index 14f342f..957c6df 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -91,24 +91,24 @@ static Bool MGAInitVisualConfigs( ScreenPtr pScreen ) case 16: numConfigs = 8; - pConfigs = (__GLXvisualConfig*)xcalloc( sizeof(__GLXvisualConfig), + pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), numConfigs ); if ( !pConfigs ) { return FALSE; } - pMGAConfigs = (MGAConfigPrivPtr)xcalloc( sizeof(MGAConfigPrivRec), + pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), numConfigs ); if ( !pMGAConfigs ) { - xfree( pConfigs ); + free(pConfigs); return FALSE; } - pMGAConfigPtrs = (MGAConfigPrivPtr*)xcalloc( sizeof(MGAConfigPrivPtr), + pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), numConfigs ); if ( !pMGAConfigPtrs ) { - xfree( pConfigs ); - xfree( pMGAConfigs ); + free(pConfigs); + free(pMGAConfigs); return FALSE; } @@ -182,24 +182,24 @@ static Bool MGAInitVisualConfigs( ScreenPtr pScreen ) case 32: numConfigs = 8; - pConfigs = (__GLXvisualConfig*)xcalloc( sizeof(__GLXvisualConfig), + pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig), numConfigs ); if ( !pConfigs ) { return FALSE; } - pMGAConfigs = (MGAConfigPrivPtr)xcalloc( sizeof(MGAConfigPrivRec), + pMGAConfigs = (MGAConfigPrivPtr)calloc( sizeof(MGAConfigPrivRec), numConfigs ); if ( !pMGAConfigs ) { - xfree( pConfigs ); + free(pConfigs); return FALSE; } - pMGAConfigPtrs = (MGAConfigPrivPtr*)xcalloc( sizeof(MGAConfigPrivPtr), + pMGAConfigPtrs = (MGAConfigPrivPtr*)calloc( sizeof(MGAConfigPrivPtr), numConfigs ); if ( !pMGAConfigPtrs ) { - xfree( pConfigs ); - xfree( pMGAConfigs ); + free(pConfigs); + free(pMGAConfigs); return FALSE; } @@ -973,11 +973,11 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg, if (nbox>1) { /* Keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox); + pboxNew1 = (BoxPtr)malloc(sizeof(BoxRec)*nbox); if (!pboxNew1) return; - pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox); + pptNew1 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox); if (!pptNew1) { - xfree(pboxNew1); + free(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -1008,14 +1008,14 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg, if (nbox > 1) { /*reverse orderof rects in each band */ - pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox); - pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox); + pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec)*nbox); + pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox); if (!pboxNew2 || !pptNew2) { - if (pptNew2) xfree(pptNew2); - if (pboxNew2) xfree(pboxNew2); + if (pptNew2) free(pptNew2); + if (pboxNew2) free(pboxNew2); if (pboxNew1) { - xfree(pptNew1); - xfree(pboxNew1); + free(pptNew1); + free(pboxNew1); } return; } @@ -1066,12 +1066,12 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg, MGASelectBuffer(pScrn, MGA_FRONT); if (pboxNew2) { - xfree(pptNew2); - xfree(pboxNew2); + free(pptNew2); + free(pboxNew2); } if (pboxNew1) { - xfree(pptNew1); - xfree(pboxNew1); + free(pptNew1); + free(pboxNew1); } pMga->AccelInfoRec->NeedToSync = TRUE; @@ -1150,7 +1150,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { pDRIInfo->busIdString = DRICreatePCIBusID(pMga->PciInfo); } else { - pDRIInfo->busIdString = xalloc(64); + pDRIInfo->busIdString = malloc(64); sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d", #ifdef XSERVER_LIBPCIACCESS ((pMga->PciInfo->domain << 8) | pMga->PciInfo->bus), @@ -1198,7 +1198,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) pDRIInfo->SAREASize = SAREA_MAX; - pMGADRI = (MGADRIPtr)xcalloc( sizeof(MGADRIRec), 1 ); + pMGADRI = (MGADRIPtr)calloc( sizeof(MGADRIRec), 1 ); if ( !pMGADRI ) { DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; @@ -1208,9 +1208,9 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) } pMGADRIServer = (MGADRIServerPrivatePtr) - xcalloc( sizeof(MGADRIServerPrivateRec), 1 ); + calloc( sizeof(MGADRIServerPrivateRec), 1 ); if ( !pMGADRIServer ) { - xfree( pMGADRI ); + free( pMGADRI ); DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; xf86DrvMsg( pScrn->scrnIndex, X_ERROR, @@ -1249,9 +1249,9 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; if ( !DRIScreenInit( pScreen, pDRIInfo, &pMga->drmFD ) ) { - xfree( pMGADRIServer ); + free( pMGADRIServer ); pMga->DRIServerInfo = 0; - xfree( pDRIInfo->devPrivate ); + free( pDRIInfo->devPrivate ); pDRIInfo->devPrivate = 0; DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; @@ -1495,20 +1495,20 @@ void MGADRICloseScreen( ScreenPtr pScreen ) if ( pMga->pDRIInfo ) { if ( pMga->pDRIInfo->devPrivate ) { - xfree( pMga->pDRIInfo->devPrivate ); + free( pMga->pDRIInfo->devPrivate ); pMga->pDRIInfo->devPrivate = 0; } DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; } if ( pMga->DRIServerInfo ) { - xfree( pMga->DRIServerInfo ); + free(pMga->DRIServerInfo); pMga->DRIServerInfo = 0; } if ( pMga->pVisualConfigs ) { - xfree( pMga->pVisualConfigs ); + free(pMga->pVisualConfigs); } if ( pMga->pVisualConfigsPriv ) { - xfree( pMga->pVisualConfigsPriv ); + free( pMga->pVisualConfigsPriv ); } } diff --git a/src/mga_driver.c b/src/mga_driver.c index d770031..d4ae346 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -646,7 +646,7 @@ MGAFreeRec(ScrnInfoPtr pScrn) { if (pScrn->driverPrivate == NULL) return; - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } @@ -813,7 +813,7 @@ MGAProbe(DriverPtr drv, int flags) MGAChipsets, MGAPciChipsets, devSections, numDevSections, drv, &usedChips); /* Free it since we don't need that list after this */ - xfree(devSections); + free(devSections); if (numUsed <= 0) return FALSE; @@ -971,7 +971,7 @@ MGAProbe(DriverPtr drv, int flags) } } } - xfree(usedChips); + free(usedChips); return foundScreen; } @@ -1715,7 +1715,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) #endif } - if (!(pMga->Options = xalloc(sizeof(MGAOptions)))) + if (!(pMga->Options = malloc(sizeof(MGAOptions)))) return FALSE; memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions)); @@ -2384,7 +2384,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) switch(pMga->Chipset) { case PCI_CHIP_MGA2064: if (!pMga->NoAccel) { - linePitches = xalloc(sizeof(Pitches1)); + linePitches = malloc(sizeof(Pitches1)); memcpy(linePitches, Pitches1, sizeof(Pitches1)); minPitch = maxPitch = 0; } @@ -2393,7 +2393,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) case PCI_CHIP_MGA2164_AGP: case PCI_CHIP_MGA1064: if (!pMga->NoAccel) { - linePitches = xalloc(sizeof(Pitches2)); + linePitches = malloc(sizeof(Pitches2)); memcpy(linePitches, Pitches2, sizeof(Pitches2)); minPitch = maxPitch = 0; } @@ -2431,7 +2431,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) LOOKUP_BEST_REFRESH); if (linePitches) - xfree(linePitches); + free(linePitches); } if (i < 1 && pMga->FBDev) { @@ -3294,7 +3294,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if(pMga->ShadowFB) { pMga->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pMga->ShadowPtr = xalloc(pMga->ShadowPitch * height); + pMga->ShadowPtr = malloc(pMga->ShadowPitch * height); displayWidth = pMga->ShadowPitch / (pScrn->bitsPerPixel >> 3); FBStart = pMga->ShadowPtr; } else { @@ -3745,21 +3745,21 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen) #ifdef USE_EXA if (pMga->ExaDriver) { exaDriverFini(pScreen); - xfree(pMga->ExaDriver); + free(pMga->ExaDriver); } #endif if (pMga->CursorInfoRec) xf86DestroyCursorInfoRec(pMga->CursorInfoRec); if (pMga->ShadowPtr) - xfree(pMga->ShadowPtr); + free(pMga->ShadowPtr); if (pMga->DGAModes) - xfree(pMga->DGAModes); + free(pMga->DGAModes); if (pMga->adaptor) - xfree(pMga->adaptor); + free(pMga->adaptor); if (pMga->portPrivate) - xfree(pMga->portPrivate); + free(pMga->portPrivate); if (pMga->ScratchBuffer) - xfree(pMga->ScratchBuffer); + free(pMga->ScratchBuffer); pScrn->vtSema = FALSE; diff --git a/src/mga_merge.c b/src/mga_merge.c index 2affe3b..e3216c9 100644 --- a/src/mga_merge.c +++ b/src/mga_merge.c @@ -70,9 +70,9 @@ CopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest, DisplayModePtr i, DisplayM DisplayModePtr mode; int dx = 0,dy = 0; /* start with first node */ - mode = xalloc(sizeof(DisplayModeRec)); + mode = malloc(sizeof(DisplayModeRec)); memcpy(mode,i, sizeof(DisplayModeRec)); - mode->Private = xalloc(sizeof(MergedDisplayModeRec)); + mode->Private = malloc(sizeof(MergedDisplayModeRec)); ((MergedDisplayModePtr)mode->Private)->Monitor1 = i; ((MergedDisplayModePtr)mode->Private)->Monitor2 = j; ((MergedDisplayModePtr)mode->Private)->Monitor2Pos = srel; @@ -239,7 +239,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) MgaScrn2Rel Monitor2Pos; xf86DrvMsg(pScrn1->scrnIndex, X_INFO, "==== Start of second screen initialization ====\n"); - pScrn = xalloc(sizeof(ScrnInfoRec)); + pScrn = malloc(sizeof(ScrnInfoRec)); memcpy(pScrn,pScrn1,sizeof(ScrnInfoRec)); pScrn->driverPrivate = NULL; @@ -270,7 +270,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) /* Set pScrn->monitor */ { - pScrn->monitor = xalloc(sizeof(MonRec)); + pScrn->monitor = malloc(sizeof(MonRec)); /* copy everything we don't care about */ memcpy(pScrn->monitor,pScrn1->monitor,sizeof(MonRec)); pScrn->monitor->DDC = NULL; /*FIXME:have to try this */ @@ -484,7 +484,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) switch(pMga->Chipset) { case PCI_CHIP_MGA2064: if (!pMga->NoAccel) { - linePitches = xalloc(sizeof(Pitches1)); + linePitches = malloc(sizeof(Pitches1)); memcpy(linePitches, Pitches1, sizeof(Pitches1)); minPitch = maxPitch = 0; } @@ -493,7 +493,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) case PCI_CHIP_MGA2164_AGP: case PCI_CHIP_MGA1064: if (!pMga->NoAccel) { - linePitches = xalloc(sizeof(Pitches2)); + linePitches = malloc(sizeof(Pitches2)); memcpy(linePitches, Pitches2, sizeof(Pitches2)); minPitch = maxPitch = 0; } @@ -529,7 +529,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) LOOKUP_BEST_REFRESH); if (linePitches) - xfree(linePitches); + free(linePitches); } @@ -881,10 +881,10 @@ MGACloseScreenMerged(int scrnIndex, ScreenPtr pScreen) { ScrnInfoPtr pScrn2 = pMga->pScrn2; if(pScrn2) { - xfree(pScrn2->monitor); + free(pScrn2->monitor); pScrn2->monitor = NULL; - xfree(pScrn2); + free(pScrn2); pMga->pScrn2 = NULL; } @@ -893,8 +893,8 @@ MGACloseScreenMerged(int scrnIndex, ScreenPtr pScreen) { do { DisplayModePtr p = pScrn1->currentMode->next; if(pScrn1->currentMode->Private) - xfree(pScrn1->currentMode->Private); - xfree(pScrn1->currentMode); + free(pScrn1->currentMode->Private); + free(pScrn1->currentMode); pScrn1->currentMode = p; }while( pScrn1->currentMode != pScrn1->modes); } diff --git a/src/mga_storm.c b/src/mga_storm.c index db7fae7..f0e6194 100644 --- a/src/mga_storm.c +++ b/src/mga_storm.c @@ -583,7 +583,7 @@ Bool mgaAccelInit( ScreenPtr pScreen ) BoxRec AvailFBArea; int i; - pMga->ScratchBuffer = xalloc(((pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel) + 127) >> 3); + pMga->ScratchBuffer = malloc(((pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel) + 127) >> 3); if(!pMga->ScratchBuffer) return FALSE; pMga->AccelInfoRec = infoPtr = XAACreateInfoRec(); diff --git a/src/mga_vga.c b/src/mga_vga.c index 9f00b3d..0ac8bf7 100644 --- a/src/mga_vga.c +++ b/src/mga_vga.c @@ -197,17 +197,17 @@ MGAG200SESaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save) hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */ - if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) { + if (hwp->FontInfo1 || (hwp->FontInfo1 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT); } - if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) { + if (hwp->FontInfo2 || (hwp->FontInfo2 = malloc(FONT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */ slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT); } - if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) { + if (hwp->TextInfo || (hwp->TextInfo = malloc(2 * TEXT_AMOUNT))) { hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */ slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT); diff --git a/src/mga_video.c b/src/mga_video.c index a69c973..beb5a3c 100644 --- a/src/mga_video.c +++ b/src/mga_video.c @@ -131,8 +131,8 @@ void MGAInitVideo(ScreenPtr pScreen) num_adaptors = 1; adaptors = &newAdaptor; } else { - newAdaptors = /* need to free this someplace */ - xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + /* need to free this someplace */ + newAdaptors = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr *)); if(newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); @@ -147,7 +147,7 @@ void MGAInitVideo(ScreenPtr pScreen) xf86XVScreenInit(pScreen, adaptors, num_adaptors); if(newAdaptors) - xfree(newAdaptors); + free(newAdaptors); } /* client libraries expect an encoding */ @@ -231,10 +231,10 @@ MGAAllocAdaptor(ScrnInfoPtr pScrn, Bool doublebuffer) if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) return NULL; - if(!(pPriv = xcalloc(1, sizeof(MGAPortPrivRec) + + if(!(pPriv = calloc(1, sizeof(MGAPortPrivRec) + (sizeof(DevUnion) * MGA_MAX_PORTS)))) { - xfree(adapt); + free(adapt); return NULL; } @@ -1082,18 +1082,18 @@ MGAAllocateSurface( surface->width = w; surface->height = h; - if(!(surface->pitches = xalloc(sizeof(int)))) { + if(!(surface->pitches = malloc(sizeof(int)))) { MGAFreeMemory(pScrn, surface_memory); return BadAlloc; } - if(!(surface->offsets = xalloc(sizeof(int)))) { - xfree(surface->pitches); + if(!(surface->offsets = malloc(sizeof(int)))) { + free(surface->pitches); MGAFreeMemory(pScrn, surface_memory); return BadAlloc; } - if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) { - xfree(surface->pitches); - xfree(surface->offsets); + if(!(pPriv = malloc(sizeof(OffscreenPrivRec)))) { + free(surface->pitches); + free(surface->offsets); MGAFreeMemory(pScrn, surface_memory); return BadAlloc; } @@ -1137,9 +1137,9 @@ MGAFreeSurface( if(pPriv->isOn) MGAStopSurface(surface); MGAFreeMemory(pScrn, pPriv->surface_memory); - xfree(surface->pitches); - xfree(surface->offsets); - xfree(surface->devPrivate.ptr); + free(surface->pitches); + free(surface->offsets); + free(surface->devPrivate.ptr); return Success; } @@ -1231,7 +1231,7 @@ MGAInitOffscreenImages(ScreenPtr pScreen) XF86OffscreenImagePtr offscreenImages; /* need to free this someplace */ - if(!(offscreenImages = xalloc(num * sizeof(XF86OffscreenImageRec)))) + if(!(offscreenImages = malloc(num * sizeof(XF86OffscreenImageRec)))) return; offscreenImages[0].image = &Images[0]; |