diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:14:04 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:34:45 +0000 |
commit | ca75261beedc3e00767b3812a81b7dac4437f4a1 (patch) | |
tree | 39e66fdde5253d6b3826f4149c9618ee29bbf2ea /cfb | |
parent | 914922fd6100a409a3dfd1c64511ed6bdc344bef (diff) |
cfb: Remove usage of alloca
Replace with xalloc/xfree.
Diffstat (limited to 'cfb')
-rw-r--r-- | cfb/cfbbitblt.c | 8 | ||||
-rw-r--r-- | cfb/cfbblt.c | 26 | ||||
-rw-r--r-- | cfb/cfbfillrct.c | 4 | ||||
-rw-r--r-- | cfb/cfbfillsp.c | 60 | ||||
-rw-r--r-- | cfb/cfbglblt8.c | 4 | ||||
-rw-r--r-- | cfb/cfbpixmap.c | 8 | ||||
-rw-r--r-- | cfb/cfbsolid.c | 12 | ||||
-rw-r--r-- | cfb/cfbtile32.c | 12 | ||||
-rw-r--r-- | cfb/cfbwindow.c | 4 |
9 files changed, 69 insertions, 69 deletions
diff --git a/cfb/cfbbitblt.c b/cfb/cfbbitblt.c index d86f9df11..00bf41367 100644 --- a/cfb/cfbbitblt.c +++ b/cfb/cfbbitblt.c @@ -296,7 +296,7 @@ cfbBitBlt ( numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -313,7 +313,7 @@ cfbBitBlt ( } (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; @@ -559,7 +559,7 @@ cfbCopyPlaneReduce ( numRects = REGION_NUM_RECTS(&rgnDst); if (numRects && width && height) { - if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects * + if(!(pptSrc = (DDXPointPtr)xalloc(numRects * sizeof(DDXPointRec)))) { REGION_UNINIT(pGC->pScreen, &rgnDst); @@ -576,7 +576,7 @@ cfbCopyPlaneReduce ( } (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); } prgnExposed = NULL; diff --git a/cfb/cfbblt.c b/cfb/cfbblt.c index 1e577f526..ff34589ff 100644 --- a/cfb/cfbblt.c +++ b/cfb/cfbblt.c @@ -207,13 +207,13 @@ MROP_NAME(cfbDoBitblt)( if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); + pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); if(!pboxNew1) return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); + xfree(pboxNew1); return; } pboxBase = pboxNext = pbox+nbox-1; @@ -251,16 +251,16 @@ MROP_NAME(cfbDoBitblt)( if (nbox > 1) { /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec) * nbox); + pptNew2 = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * nbox); if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); + if (pptNew2) xfree(pptNew2); + if (pboxNew2) xfree(pboxNew2); if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } return; } @@ -922,12 +922,12 @@ bits1 = *--psrc; --pdst; \ } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); + xfree(pptNew2); + xfree(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); + xfree(pptNew1); + xfree(pboxNew1); } } diff --git a/cfb/cfbfillrct.c b/cfb/cfbfillrct.c index 4c78c24b3..fc2d31bdc 100644 --- a/cfb/cfbfillrct.c +++ b/cfb/cfbfillrct.c @@ -196,7 +196,7 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) numRects = REGION_NUM_RECTS(prgnClip) * nrectFill; if (numRects > NUM_STACK_RECTS) { - pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec)); + pboxClippedBase = (BoxPtr)xalloc(numRects * sizeof(BoxRec)); if (!pboxClippedBase) return; } @@ -301,5 +301,5 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) (*BoxFill) (pDrawable, pGC, pboxClipped-pboxClippedBase, pboxClippedBase); if (pboxClippedBase != stackRects) - DEALLOCATE_LOCAL(pboxClippedBase); + xfree(pboxClippedBase); } diff --git a/cfb/cfbfillsp.c b/cfb/cfbfillsp.c index ddd4f1421..36710b612 100644 --- a/cfb/cfbfillsp.c +++ b/cfb/cfbfillsp.c @@ -186,12 +186,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidth = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - ppt = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidth = (int *)xalloc(n * sizeof(int)); + ppt = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!ppt || !pwidth) { - if (ppt) DEALLOCATE_LOCAL(ppt); - if (pwidth) DEALLOCATE_LOCAL(pwidth); + if (ppt) xfree(ppt); + if (pwidth) xfree(pwidth); return; } n = miClipSpans( cfbGetCompositeClip(pGC), @@ -203,8 +203,8 @@ int fSorted; (*fill) (pDrawable, n, ppt, pwidth, pGC->tile.pixmap, xrot, yrot, pGC->alu, pGC->planemask); - DEALLOCATE_LOCAL(ppt); - DEALLOCATE_LOCAL(pwidth); + xfree(ppt); + xfree(pwidth); } #if PSZ == 8 @@ -251,12 +251,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } @@ -392,8 +392,8 @@ int fSorted; } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #else /* PSZ != 8 */ @@ -434,12 +434,12 @@ int fSorted; n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -599,8 +599,8 @@ int fSorted; ppt++; pwidth++; } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #endif /* PSZ == 8 */ @@ -648,12 +648,12 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) n = nInit * miFindMaxBand(pGC->pCompositeClip); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -816,8 +816,8 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } void @@ -862,12 +862,12 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) n = nInit * miFindMaxBand(pGC->pCompositeClip); if ( n == 0 ) return; - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -997,8 +997,8 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } #endif /* PSZ == 8 */ diff --git a/cfb/cfbglblt8.c b/cfb/cfbglblt8.c index c4cba0e15..4d964b35d 100644 --- a/cfb/cfbglblt8.c +++ b/cfb/cfbglblt8.c @@ -355,7 +355,7 @@ cfbPolyGlyphBlt8Clipped( } if (!numRects) return; - clips = (CARD32 *)ALLOCATE_LOCAL ((maxAscent + maxDescent) * + clips = (CARD32 *)xalloc ((maxAscent + maxDescent) * sizeof (CARD32)); while (nglyph--) { @@ -471,7 +471,7 @@ cfbPolyGlyphBlt8Clipped( } } } - DEALLOCATE_LOCAL (clips); + xfree (clips); } #endif /* FOUR_BIT_CODE */ diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c index 36ed5724d..a7be7cc1b 100644 --- a/cfb/cfbpixmap.c +++ b/cfb/cfbpixmap.c @@ -270,7 +270,7 @@ cfbXRotatePixmap(pPix, rw) int size, tsize; tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth); - pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); + pwTmp = (CfbBits *) xalloc(pPix->drawable.height * tsize); if (!pwTmp) return; /* divide pw (the pixmap) in two vertically at (w - rot) and swap */ @@ -288,7 +288,7 @@ cfbXRotatePixmap(pPix, rw) 0, 0, rot, 0, (int)pPix->drawable.width - rot, (int)pPix->drawable.height, tsize, size); - DEALLOCATE_LOCAL(pwTmp); + xfree(pwTmp); #endif } } @@ -328,13 +328,13 @@ cfbYRotatePixmap(pPix, rh) nbyDown = rot * pPix->devKind; nbyUp = (pPix->devKind * pPix->drawable.height) - nbyDown; - if(!(ptmp = (char *)ALLOCATE_LOCAL(nbyUp))) + if(!(ptmp = (char *)xalloc(nbyUp))) return; memmove(ptmp, pbase, nbyUp); /* save the low rows */ memmove(pbase, pbase+nbyUp, nbyDown); /* slide the top rows down */ memmove(pbase+nbyDown, ptmp, nbyUp); /* move lower rows up to row rot */ - DEALLOCATE_LOCAL(ptmp); + xfree(ptmp); } void diff --git a/cfb/cfbsolid.c b/cfb/cfbsolid.c index f0da05ef0..6b8238dd9 100644 --- a/cfb/cfbsolid.c +++ b/cfb/cfbsolid.c @@ -811,12 +811,12 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) devPriv = cfbGetGCPrivate(pGC); RROP_FETCH_GCPRIV(devPriv) n = nInit * miFindMaxBand(pGC->pCompositeClip); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -1359,7 +1359,7 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } #endif } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); RROP_UNDECLARE } diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c index 90439adc3..be016a70a 100644 --- a/cfb/cfbtile32.c +++ b/cfb/cfbtile32.c @@ -367,12 +367,12 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) #endif n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); - pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int)); - pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec)); + pwidthFree = (int *)xalloc(n * sizeof(int)); + pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec)); if(!pptFree || !pwidthFree) { - if (pptFree) DEALLOCATE_LOCAL(pptFree); - if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree); + if (pptFree) xfree(pptFree); + if (pwidthFree) xfree(pwidthFree); return; } pwidth = pwidthFree; @@ -512,6 +512,6 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) } } } - DEALLOCATE_LOCAL(pptFree); - DEALLOCATE_LOCAL(pwidthFree); + xfree(pptFree); + xfree(pwidthFree); } diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c index c4f027b08..234501212 100644 --- a/cfb/cfbwindow.c +++ b/cfb/cfbwindow.c @@ -133,7 +133,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) pbox = REGION_RECTS(&rgnDst); nbox = REGION_NUM_RECTS(&rgnDst); - if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) + if(!nbox || !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) { REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); return; @@ -148,7 +148,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, GXcopy, &rgnDst, pptSrc, ~0L); - DEALLOCATE_LOCAL(pptSrc); + xfree(pptSrc); REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } |