From be9ee17f960cc3d8a8f999cab1579e83d9aea520 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Nov 2007 14:08:51 +0000 Subject: mi: Remove usage of alloca Replace with heap allocations. --- mi/mifillarc.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'mi/mifillarc.c') diff --git a/mi/mifillarc.c b/mi/mifillarc.c index c561b1f5b..f68ddf468 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -551,13 +551,13 @@ miFillEllipseI( int *widths; int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)xalloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } miFillArcSetup(arc, &info); @@ -575,8 +575,8 @@ miFillEllipseI( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } static void @@ -594,13 +594,13 @@ miFillEllipseD( int *widths; int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)xalloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } miFillArcDSetup(arc, &info); @@ -618,8 +618,8 @@ miFillEllipseD( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } #define ADDSPAN(l,r) \ @@ -666,13 +666,13 @@ miFillArcSliceI( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)xalloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } if (pGC->miTranslate) @@ -703,8 +703,8 @@ miFillArcSliceI( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } static void @@ -730,13 +730,13 @@ miFillArcSliceD( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)xalloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + xfree(points); return; } if (pGC->miTranslate) @@ -767,8 +767,8 @@ miFillArcSliceD( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + xfree(widths); + xfree(points); } /* MIPOLYFILLARC -- The public entry for the PolyFillArc request. -- cgit v1.2.3