diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:08:51 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 14:34:41 +0000 |
commit | be9ee17f960cc3d8a8f999cab1579e83d9aea520 (patch) | |
tree | f563ce4405d197063ed262da3f5355d334335e43 /mi/mibitblt.c | |
parent | 3633ae6efb57c5405c26e8ae132b9371e5f920de (diff) |
mi: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'mi/mibitblt.c')
-rw-r--r-- | mi/mibitblt.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 1ddccdda1..14d68e2e1 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -143,21 +143,21 @@ miCopyArea(pSrcDrawable, pDstDrawable, } pptFirst = ppt = (DDXPointPtr) - ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec)); + xalloc(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = (unsigned int *) - ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int)); + xalloc(heightSrc * sizeof(unsigned int)); numRects = REGION_NUM_RECTS(prgnSrcClip); boxes = REGION_RECTS(prgnSrcClip); ordering = (unsigned int *) - ALLOCATE_LOCAL(numRects * sizeof(unsigned int)); + xalloc(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) { if (ordering) - DEALLOCATE_LOCAL(ordering); + xfree(ordering); if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + xfree(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + xfree(pptFirst); return (RegionPtr)NULL; } @@ -264,9 +264,9 @@ miCopyArea(pSrcDrawable, pDstDrawable, if(realSrcClip) REGION_DESTROY(pGC->pScreen, prgnSrcClip); - DEALLOCATE_LOCAL(ordering); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(ordering); + xfree(pwidthFirst); + xfree(pptFirst); return prgnExposed; } @@ -433,12 +433,12 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv); ValidateGC((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT); - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { - if (pwidthFirst) DEALLOCATE_LOCAL(pwidthFirst); - if (pptFirst) DEALLOCATE_LOCAL(pptFirst); + if (pwidthFirst) xfree(pwidthFirst); + if (pptFirst) xfree(pptFirst); FreeScratchGC(pGCT); return; } @@ -464,8 +464,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(pwidthFirst); + xfree(pptFirst); /* Save current values from the client GC */ @@ -808,14 +808,14 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) break; case ZPixmap: - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + xfree(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + xfree(pptFirst); return; } if (pGC->miTranslate) @@ -834,8 +834,8 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + xfree(pwidthFirst); + xfree(pptFirst); break; } } |