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/miarc.c | |
parent | 3633ae6efb57c5405c26e8ae132b9371e5f920de (diff) |
mi: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'mi/miarc.c')
-rw-r--r-- | mi/miarc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mi/miarc.c b/mi/miarc.c index 70888155e..5ccd11127 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -925,14 +925,14 @@ miFillWideEllipse( yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; - widths = (int *)ALLOCATE_LOCAL(n + (sizeof(DDXPointRec) * 2) * yorgu); + widths = (int *)xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu); if (!widths) return; points = (DDXPointPtr)((char *)widths + n); spdata = miComputeWideEllipse((int)pGC->lineWidth, parc, &mustFree); if (!spdata) { - DEALLOCATE_LOCAL(widths); + xfree(widths); return; } pts = points; @@ -1025,7 +1025,7 @@ miFillWideEllipse( xfree(spdata); (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); + xfree(widths); } /* @@ -1899,13 +1899,13 @@ miComputeArcs ( isDoubleDash = (pGC->lineStyle == LineDoubleDash); dashOffset = pGC->dashOffset; - data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData)); + data = (struct arcData *) xalloc (narcs * sizeof (struct arcData)); if (!data) return (miPolyArcPtr)NULL; arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { - DEALLOCATE_LOCAL(data); + xfree(data); return (miPolyArcPtr)NULL; } for (i = 0; i < narcs; i++) { @@ -2254,11 +2254,11 @@ miComputeArcs ( arcs[iphase].arcs[arcs[iphase].narcs-1].cap = arcs[iphase].ncaps; } - DEALLOCATE_LOCAL(data); + xfree(data); return arcs; arcfail: miFreeArcs(arcs, pGC); - DEALLOCATE_LOCAL(data); + xfree(data); return (miPolyArcPtr)NULL; } @@ -3162,8 +3162,8 @@ fillSpans ( if (nspans == 0) return; - xSpan = xSpans = (DDXPointPtr) ALLOCATE_LOCAL (nspans * sizeof (DDXPointRec)); - xWidth = xWidths = (int *) ALLOCATE_LOCAL (nspans * sizeof (int)); + xSpan = xSpans = (DDXPointPtr) xalloc (nspans * sizeof (DDXPointRec)); + xWidth = xWidths = (int *) xalloc (nspans * sizeof (int)); if (xSpans && xWidths) { i = 0; @@ -3183,9 +3183,9 @@ fillSpans ( } disposeFinalSpans (); if (xSpans) - DEALLOCATE_LOCAL (xSpans); + xfree (xSpans); if (xWidths) - DEALLOCATE_LOCAL (xWidths); + xfree (xWidths); finalMiny = 0; finalMaxy = -1; finalSize = 0; |