diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /hw/xfree86/xaa | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xfree86/xaa')
-rw-r--r-- | hw/xfree86/xaa/xaaBitBlt.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaCpyArea.c | 26 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaCpyPlane.c | 8 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaCpyWin.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaGC.c | 6 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaImage.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInit.c | 30 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInitAccel.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaLineMisc.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaNonTEText.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOffscreen.c | 8 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOverlay.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOverlayDF.c | 10 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPCache.c | 54 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPict.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaStateChange.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaTEGlyph.c | 8 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaTEText.c | 4 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaWrapper.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaalocal.h | 2 |
20 files changed, 95 insertions, 95 deletions
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index ebba74e55..75033bcca 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -186,7 +186,7 @@ XAABitBlt( /* Do bit blitting */ numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)xalloc(numRects * + if(!(pptSrc = (DDXPointPtr)malloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); if (freeSrcClip) @@ -201,7 +201,7 @@ XAABitBlt( } (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); } prgnExposed = NULL; diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c index 6a898cd5f..1a03bfdb2 100644 --- a/hw/xfree86/xaa/xaaCpyArea.c +++ b/hw/xfree86/xaa/xaaCpyArea.c @@ -108,12 +108,12 @@ XAADoBitBlt( 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; @@ -145,14 +145,14 @@ XAADoBitBlt( if (nbox > 1) { /* reverse order of 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; } @@ -183,12 +183,12 @@ XAADoBitBlt( xdir, ydir, pGC->alu, pGC->planemask); if (pboxNew2) { - xfree(pptNew2); - xfree(pboxNew2); + free(pptNew2); + free(pboxNew2); } if (pboxNew1) { - xfree(pptNew1); - xfree(pboxNew1); + free(pptNew1); + free(pboxNew1); } } diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c index aa4c0407c..e3010eafb 100644 --- a/hw/xfree86/xaa/xaaCpyPlane.c +++ b/hw/xfree86/xaa/xaaCpyPlane.c @@ -131,7 +131,7 @@ XAACopyPlaneNtoNColorExpand( h = height = pbox->y2 - pbox->y1; pitch = BitmapBytePad(width); - if(!(data = xcalloc(height, pitch))) + if(!(data = calloc(height, pitch))) goto ALLOC_FAILED; dataPtr = data; @@ -151,7 +151,7 @@ XAACopyPlaneNtoNColorExpand( pbox->x1, pbox->y1, width, height, data, pitch, 0, pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask); - xfree(data); + free(data); ALLOC_FAILED: @@ -184,7 +184,7 @@ XAAPushPixelsSolidColorExpansion( TheRect.height = dy; if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) { - pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec)); + pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; @@ -203,6 +203,6 @@ XAAPushPixelsSolidColorExpansion( } if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem) - xfree(pClipBoxes); + free(pClipBoxes); } diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index 31c421e65..d37c8ec1e 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -59,7 +59,7 @@ XAACopyWindow( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -77,6 +77,6 @@ XAACopyWindow( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, &rgnDst); } diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index e6083d529..8c9d0ede7 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -158,7 +158,7 @@ XAAValidateGC( /* If our Ops are still the default ones we need to allocate new ones */ if(pGC->ops == &XAAFallbackOps) { - if(!(pGCPriv->XAAOps = xalloc(sizeof(GCOps)))) { + if(!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) { pGCPriv->XAAOps = &XAAFallbackOps; return; } @@ -241,10 +241,10 @@ XAADestroyGC(GCPtr pGC) XAA_GC_FUNC_PROLOGUE (pGC); if(pGCPriv->XAAOps != &XAAFallbackOps) - xfree(pGCPriv->XAAOps); + free(pGCPriv->XAAOps); if(pGCPriv->DashPattern) - xfree(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); (*pGC->funcs->DestroyGC)(pGC); XAA_GC_FUNC_EPILOGUE (pGC); diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c index 4933beea3..30caa2a9a 100644 --- a/hw/xfree86/xaa/xaaImage.c +++ b/hw/xfree86/xaa/xaaImage.c @@ -442,7 +442,7 @@ XAAPutImage( TheRect.height = h; if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) { - pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec)); + pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; @@ -514,7 +514,7 @@ XAAPutImage( } if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem) - xfree(pClipBoxes); + free(pClipBoxes); } else XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage); diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 7d4583dc2..0ccdae59d 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -69,7 +69,7 @@ XAACreateInfoRec(void) { XAAInfoRecPtr infoRec; - infoRec = xcalloc(1, sizeof(XAAInfoRec)); + infoRec = calloc(1, sizeof(XAAInfoRec)); if(infoRec) infoRec->CachePixelGranularity = -1; @@ -85,12 +85,12 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec) (*infoRec->ClosePixmapCache)(infoRec->pScrn->pScreen); if(infoRec->PreAllocMem) - xfree(infoRec->PreAllocMem); + free(infoRec->PreAllocMem); if(infoRec->PixmapCachePrivate) - xfree(infoRec->PixmapCachePrivate); + free(infoRec->PixmapCachePrivate); - xfree(infoRec); + free(infoRec); } @@ -112,7 +112,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) if (!dixRequestPrivate(XAAPixmapKey, sizeof(XAAPixmapRec))) return FALSE; - if (!(pScreenPriv = xalloc(sizeof(XAAScreenRec)))) + if (!(pScreenPriv = malloc(sizeof(XAAScreenRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAScreenKey, pScreenPriv); @@ -181,7 +181,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR) XAASetupOverlay8_32Planar(pScreen); - infoRec->PreAllocMem = xalloc(MAX_PREALLOC_MEM); + infoRec->PreAllocMem = malloc(MAX_PREALLOC_MEM); if(infoRec->PreAllocMem) infoRec->PreAllocSize = MAX_PREALLOC_MEM; @@ -228,7 +228,7 @@ XAACloseScreen (int i, ScreenPtr pScreen) /* We leave it up to the client to free the XAAInfoRec */ - xfree ((pointer) pScreenPriv); + free((pointer) pScreenPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -372,7 +372,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) goto BAILOUT; } - if(!(pLink = xalloc(sizeof(PixmapLink)))) { + if(!(pLink = malloc(sizeof(PixmapLink)))) { xf86FreeOffscreenArea(area); goto BAILOUT; } @@ -382,7 +382,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); if (!pPix) { - xfree (pLink); + free(pLink); xf86FreeOffscreenArea(area); goto BAILOUT; } @@ -436,7 +436,7 @@ XAADestroyPixmap(PixmapPtr pPix) if(pPix->refcnt == 1) { if(pPriv->flags & OFFSCREEN) { if(pPriv->flags & DGA_PIXMAP) - xfree(pPriv->offscreenArea); + free(pPriv->offscreenArea); else { FBAreaPtr area = pPriv->offscreenArea; PixmapLinkPtr pLink = infoRec->OffscreenPixmaps; @@ -454,12 +454,12 @@ XAADestroyPixmap(PixmapPtr pPix) xf86FreeOffscreenArea(area); pPriv->offscreenArea = NULL; - xfree(pLink); + free(pLink); } } if(pPriv->freeData) { /* pixmaps that were once in video ram */ - xfree(pPix->devPrivate.ptr); + free(pPix->devPrivate.ptr); pPix->devPrivate.ptr = NULL; } } @@ -551,7 +551,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) infoRec->UsingPixmapCache = state->UsingPixmapCache; infoRec->CanDoColor8x8 = state->CanDoColor8x8; infoRec->CanDoMono8x8 = state->CanDoMono8x8; - xfree(infoRec->dgaSaves); + free(infoRec->dgaSaves); infoRec->dgaSaves = NULL; } @@ -562,7 +562,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix); FBAreaPtr area; - if((area = xalloc(sizeof(FBArea)))) { + if((area = malloc(sizeof(FBArea)))) { area->pScreen = pScreen; area->box.x1 = 0; area->box.x2 = 0; @@ -577,7 +577,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) pixPriv->offscreenArea = area; if(!infoRec->dgaSaves) { /* save pixmap cache state */ - SavedCacheStatePtr state = xalloc(sizeof(SavedCacheState)); + SavedCacheStatePtr state = malloc(sizeof(SavedCacheState)); state->UsingPixmapCache = infoRec->UsingPixmapCache; state->CanDoColor8x8 = infoRec->CanDoColor8x8; diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c index 6f3d622e1..2f40c81a2 100644 --- a/hw/xfree86/xaa/xaaInitAccel.c +++ b/hw/xfree86/xaa/xaaInitAccel.c @@ -1476,7 +1476,7 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) infoRec->CachePixelGranularity *= 2; } - xfree(options); + free(options); if(!infoRec->CacheTile && infoRec->WritePixmapToCache) infoRec->CacheTile = XAACacheTile; diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c index 6cef4bcd5..e017c22f8 100644 --- a/hw/xfree86/xaa/xaaLineMisc.c +++ b/hw/xfree86/xaa/xaaLineMisc.c @@ -75,7 +75,7 @@ XAAComputeDash(GCPtr pGC) Bool set; if(pGCPriv->DashPattern) - xfree(pGCPriv->DashPattern); + free(pGCPriv->DashPattern); pGCPriv->DashPattern = NULL; pGCPriv->DashLength = 0; @@ -93,7 +93,7 @@ XAAComputeDash(GCPtr pGC) (PatternLength & (PatternLength - 1))) return; - pGCPriv->DashPattern = xcalloc((PatternLength + 31) >> 5, 4); + pGCPriv->DashPattern = calloc((PatternLength + 31) >> 5, 4); if(!pGCPriv->DashPattern) return; pGCPriv->DashLength = PatternLength; diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c index d32c0bbc5..072fe1925 100644 --- a/hw/xfree86/xaa/xaaNonTEText.c +++ b/hw/xfree86/xaa/xaaNonTEText.c @@ -291,7 +291,7 @@ PolyGlyphBltAsSingleBitmap ( pitch = (Right - Left + 31) >> 5; size = (pitch << 2) * (Bottom - Top); - block = xcalloc(1, size); + block = calloc(1, size); topLine = 10000; botLine = -10000; @@ -349,7 +349,7 @@ PolyGlyphBltAsSingleBitmap ( nbox--; pbox++; } - xfree(block); + free(block); } static void diff --git a/hw/xfree86/xaa/xaaOffscreen.c b/hw/xfree86/xaa/xaaOffscreen.c index 7c9d53270..cd0d9a900 100644 --- a/hw/xfree86/xaa/xaaOffscreen.c +++ b/hw/xfree86/xaa/xaaOffscreen.c @@ -79,7 +79,7 @@ XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) if(!tmpPix) { pPriv->offscreenArea = area; - xfree(data); + free(data); pLink = pLink->next; continue; } @@ -90,7 +90,7 @@ XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC, 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0); - xfree(data); + free(data); tmpPix->devPrivate.ptr = NULL; FreeScratchGC(pGC); @@ -132,13 +132,13 @@ XAAMoveOutOffscreenPixmap(PixmapPtr pPix) bitsPerPixel = pPix->drawable.bitsPerPixel; devKind = BitmapBytePad(width * bitsPerPixel); - if(!(data = xalloc(devKind * height))) + if(!(data = malloc(devKind * height))) FatalError("Out of memory\n"); tmpPix = GetScratchPixmapHeader(pScreen, width, height, pPix->drawable.depth, bitsPerPixel, devKind, data); if(!tmpPix) { - xfree(data); + free(data); FatalError("Out of memory\n"); } diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 2956a3dbf..2af808396 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -69,7 +69,7 @@ XAACopyWindow8_32( pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); if(!nbox || - !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pScreen, &rgnDst); return; } @@ -87,7 +87,7 @@ XAACopyWindow8_32( XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, &rgnDst); if(freeReg) REGION_DESTROY(pScreen, borderClip); diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 8db816e1e..3b848ac84 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -173,7 +173,7 @@ XAAInitDualFramebufferOverlay( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAAOverlayPtr pOverPriv; - if(!(pOverPriv = xalloc(sizeof(XAAOverlayRec)))) + if(!(pOverPriv = malloc(sizeof(XAAOverlayRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAOverlayKey, pOverPriv); @@ -350,7 +350,7 @@ XAAOverCopyWindow( nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { + (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -368,7 +368,7 @@ XAAOverCopyWindow( &(infoRec->ScratchGC), &rgnDst, pptSrc); } - xfree(pptSrc); + free(pptSrc); } REGION_UNINIT(pScreen, &rgnDst); @@ -380,7 +380,7 @@ XAAOverCopyWindow( REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); nbox = REGION_NUM_RECTS(&rgnDst); if(nbox && - (pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))){ + (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))){ pbox = REGION_RECTS(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { @@ -391,7 +391,7 @@ XAAOverCopyWindow( SWITCH_DEPTH(pScrn->depth); XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot, &(infoRec->ScratchGC), &rgnDst, pptSrc); - xfree(pptSrc); + free(pptSrc); } } REGION_UNINIT(pScreen, &rgnDst); diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 7e3011bd5..e78a6f82f 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -65,7 +65,7 @@ Enlist(CacheLinkPtr link, int x, int y, int w, int h) { CacheLinkPtr newLink; - newLink = xalloc(sizeof(CacheLink)); + newLink = malloc(sizeof(CacheLink)); newLink->next = link; newLink->x = x; newLink->y = y; newLink->w = w; newLink->h = h; @@ -80,7 +80,7 @@ Delist(CacheLinkPtr link) { if(link) { ret = link->next; - xfree(link); + free(link); } return ret; } @@ -94,7 +94,7 @@ FreeList(CacheLinkPtr link) { while(link) { tmp = link; link = link->next; - xfree(tmp); + free(tmp); } } @@ -145,19 +145,19 @@ FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv) if(!pPriv) return; if(pPriv->Info512) - xfree(pPriv->Info512); + free(pPriv->Info512); if(pPriv->Info256) - xfree(pPriv->Info256); + free(pPriv->Info256); if(pPriv->Info128) - xfree(pPriv->Info128); + free(pPriv->Info128); if(pPriv->InfoColor) - xfree(pPriv->InfoColor); + free(pPriv->InfoColor); if(pPriv->InfoMono) - xfree(pPriv->InfoMono); + free(pPriv->InfoMono); if(pPriv->InfoPartial) - xfree(pPriv->InfoPartial); + free(pPriv->InfoPartial); - xfree(pPriv); + free(pPriv); } void @@ -212,7 +212,7 @@ ThinOutPartials( pCur->next = List8; List8 = pCur; Num8++; } else { - xfree(pCur); + free(pCur); } pCur = next; @@ -477,7 +477,7 @@ ConvertSomePartialsTo8x8( } } } - xfree(pCur); + free(pCur); } pCur = next; @@ -955,7 +955,7 @@ XAAInitPixmapCache( } - pCachePriv = xcalloc(1,sizeof(XAAPixmapCachePrivate)); + pCachePriv = calloc(1,sizeof(XAAPixmapCachePrivate)); if(!pCachePriv) { if(Num512) FreeList(List512); if(Num256) FreeList(List256); @@ -969,21 +969,21 @@ XAAInitPixmapCache( infoRec->PixmapCachePrivate = (char*)pCachePriv; if(Num512) { - pCachePriv->Info512 = xcalloc(Num512,sizeof(XAACacheInfoRec)); + pCachePriv->Info512 = calloc(Num512,sizeof(XAACacheInfoRec)); if(!pCachePriv->Info512) Num512 = 0; if(Num512) TransferList(List512, pCachePriv->Info512, Num512); FreeList(List512); pCachePriv->Num512x512 = Num512; } if(Num256) { - pCachePriv->Info256 = xcalloc(Num256, sizeof(XAACacheInfoRec)); + pCachePriv->Info256 = calloc(Num256, sizeof(XAACacheInfoRec)); if(!pCachePriv->Info256) Num256 = 0; if(Num256) TransferList(List256, pCachePriv->Info256, Num256); FreeList(List256); pCachePriv->Num256x256 = Num256; } if(Num128) { - pCachePriv->Info128 = xcalloc(Num128, sizeof(XAACacheInfoRec)); + pCachePriv->Info128 = calloc(Num128, sizeof(XAACacheInfoRec)); if(!pCachePriv->Info128) Num128 = 0; if(Num128) TransferList(List128, pCachePriv->Info128, Num128); FreeList(List128); @@ -991,7 +991,7 @@ XAAInitPixmapCache( } if(NumPartial) { - pCachePriv->InfoPartial = xcalloc(NumPartial, sizeof(XAACacheInfoRec)); + pCachePriv->InfoPartial = calloc(NumPartial, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoPartial) NumPartial = 0; if(NumPartial) TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial); @@ -1000,7 +1000,7 @@ XAAInitPixmapCache( } if(NumColor) { - pCachePriv->InfoColor = xcalloc(NumColor, sizeof(XAACacheInfoRec)); + pCachePriv->InfoColor = calloc(NumColor, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoColor) NumColor = 0; if(NumColor) TransferList(ListColor, pCachePriv->InfoColor, NumColor); FreeList(ListColor); @@ -1008,7 +1008,7 @@ XAAInitPixmapCache( } if(NumMono) { - pCachePriv->InfoMono = xcalloc(NumMono, sizeof(XAACacheInfoRec)); + pCachePriv->InfoMono = calloc(NumMono, sizeof(XAACacheInfoRec)); if(!pCachePriv->InfoMono) NumMono = 0; if(NumMono) TransferList(ListMono, pCachePriv->InfoMono, NumMono); FreeList(ListMono); @@ -1557,7 +1557,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pad = BitmapBytePad(pCache->w * bpp); dwords = bytes_to_int32(pad); - dstPtr = data = (unsigned char*)xalloc(pad * pCache->h); + dstPtr = data = (unsigned char*)malloc(pad * pCache->h); srcPtr = (unsigned char*)pPix->devPrivate.ptr; if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) @@ -1588,7 +1588,7 @@ XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, bpp, pScrn->depth); - xfree(data); + free(data); return pCache; } @@ -1970,7 +1970,7 @@ XAAWriteMono8x8PatternToCache( pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { @@ -1994,7 +1994,7 @@ XAAWriteMono8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - xfree(data); + free(data); } void @@ -2015,7 +2015,7 @@ XAAWriteColor8x8PatternToCache( if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) { CARD32* ptr; pad = BitmapBytePad(pCache->w); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; if(infoRec->Color8x8PatternFillFlags & @@ -2040,7 +2040,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg); - xfree(data); + free(data); return; } @@ -2049,7 +2049,7 @@ XAAWriteColor8x8PatternToCache( w = min(8,pPix->drawable.width); pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - data = (unsigned char*)xalloc(pad * pCache->h); + data = (unsigned char*)malloc(pad * pCache->h); if(!data) return; /* Write and expand horizontally. */ @@ -2088,7 +2088,7 @@ XAAWriteColor8x8PatternToCache( (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth); - xfree(data); + free(data); } diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index e059d3d65..38ef21e85 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -483,7 +483,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, REGION_UNINIT(pScreen, ®ion); return; } - pptSrc = xalloc(sizeof(DDXPointRec) * nbox); + pptSrc = malloc(sizeof(DDXPointRec) * nbox); if (!pptSrc) { REGION_UNINIT(pScreen, ®ion); return; @@ -501,7 +501,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, ®ion, pptSrc); - xfree(pptSrc); + free(pptSrc); REGION_UNINIT(pScreen, ®ion); return; } diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c index f33261453..0e86e67e4 100644 --- a/hw/xfree86/xaa/xaaStateChange.c +++ b/hw/xfree86/xaa/xaaStateChange.c @@ -1500,7 +1500,7 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) XAAStateWrapPtr pStatePriv; int i = 0; - if(!(pStatePriv = xalloc(sizeof(XAAStateWrapRec)))) return FALSE; + if(!(pStatePriv = malloc(sizeof(XAAStateWrapRec)))) return FALSE; dixSetPrivate(&pScreen->devPrivates, XAAStateKey, pStatePriv); pStatePriv->RestoreAccelState = infoRec->RestoreAccelState; pStatePriv->pScrn = pScrn; diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c index 41e638e5c..510c387b7 100644 --- a/hw/xfree86/xaa/xaaTEGlyph.c +++ b/hw/xfree86/xaa/xaaTEGlyph.c @@ -301,7 +301,7 @@ EXPNAME(XAATEGlyphRenderer3)( } dwords = ((3 * w + 31) >> 5) * h; - mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)malloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0); @@ -321,7 +321,7 @@ EXPNAME(XAATEGlyphRenderer3)( DrawTextScanline3(base, mem, w); } - xfree(mem); + free(mem); if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && (dwords & 1)) { @@ -478,7 +478,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( w += skipleft; x -= skipleft; - mem = (CARD32*)xalloc(((w + 31) >> 3) * sizeof(char)); + mem = (CARD32*)malloc(((w + 31) >> 3) * sizeof(char)); if (!mem) return; (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)( @@ -495,7 +495,7 @@ EXPNAME(XAATEGlyphRendererScanline3)( bufferNo = 0; } - xfree(mem); + free(mem); THE_END: diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c index fc445726f..b18228310 100644 --- a/hw/xfree86/xaa/xaaTEText.c +++ b/hw/xfree86/xaa/xaaTEText.c @@ -273,7 +273,7 @@ XAAGlyphBltTEColorExpansion( if (!fallbackBits) { int fontHeight = Bottom - Top + 1; - fallbackBits = xcalloc (glyphWidth * fontHeight, 1); + fallbackBits = calloc(glyphWidth * fontHeight, 1); if (!fallbackBits) return; } @@ -300,7 +300,7 @@ XAAGlyphBltTEColorExpansion( fg, bg, rop, planemask); if (fallbackBits) - xfree (fallbackBits); + free(fallbackBits); } nbox--; pbox++; diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c index d6409887c..2491492f5 100644 --- a/hw/xfree86/xaa/xaaWrapper.c +++ b/hw/xfree86/xaa/xaaWrapper.c @@ -271,7 +271,7 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f if (!dixRequestPrivate(xaaWrapperGCPrivateKey, sizeof(xaaWrapperGCPrivRec))) return FALSE; - pScrPriv = (xaaWrapperScrPrivPtr) xalloc (sizeof (xaaWrapperScrPrivRec)); + pScrPriv = (xaaWrapperScrPrivPtr) malloc(sizeof (xaaWrapperScrPrivRec)); if (!pScrPriv) return FALSE; diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 129c1d6c4..a9a70da08 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -1709,7 +1709,7 @@ extern _X_EXPORT CARD32 XAAReverseBitOrder(CARD32 data); if(_pLink->pPix == pPix) { \ if(_prev) _prev->next = _pLink->next; \ else infoRec->OffscreenPixmaps = _pLink->next; \ - xfree(_pLink); \ + free(_pLink); \ break; \ } \ _prev = _pLink; \ |