mi: Remove usage of alloca

Replace with heap allocations.
This commit is contained in:
Daniel Stone
2007-11-05 14:08:51 +00:00
parent 3633ae6efb
commit be9ee17f96
16 changed files with 128 additions and 128 deletions

View File

@@ -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.