summaryrefslogtreecommitdiff
path: root/mi/mipolycon.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-11-05 14:08:51 +0000
committerDaniel Stone <daniel@fooishbar.org>2007-11-05 14:34:41 +0000
commitbe9ee17f960cc3d8a8f999cab1579e83d9aea520 (patch)
treef563ce4405d197063ed262da3f5355d334335e43 /mi/mipolycon.c
parent3633ae6efb57c5405c26e8ae132b9371e5f920de (diff)
mi: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'mi/mipolycon.c')
-rw-r--r--mi/mipolycon.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
index e2d666e51..6aabad675 100644
--- a/mi/mipolycon.c
+++ b/mi/mipolycon.c
@@ -104,12 +104,12 @@ miFillConvexPoly(dst, pgc, count, ptsIn)
dy = ymax - ymin + 1;
if ((count < 3) || (dy < 0))
return(TRUE);
- ptsOut = FirstPoint = (DDXPointPtr )ALLOCATE_LOCAL(sizeof(DDXPointRec)*dy);
- width = FirstWidth = (int *)ALLOCATE_LOCAL(sizeof(int) * dy);
+ ptsOut = FirstPoint = (DDXPointPtr )xalloc(sizeof(DDXPointRec)*dy);
+ width = FirstWidth = (int *)xalloc(sizeof(int) * dy);
if(!FirstPoint || !FirstWidth)
{
- if (FirstWidth) DEALLOCATE_LOCAL(FirstWidth);
- if (FirstPoint) DEALLOCATE_LOCAL(FirstPoint);
+ if (FirstWidth) xfree(FirstWidth);
+ if (FirstPoint) xfree(FirstPoint);
return(FALSE);
}
@@ -174,8 +174,8 @@ miFillConvexPoly(dst, pgc, count, ptsIn)
/* in case we're called with non-convex polygon */
if(i < 0)
{
- DEALLOCATE_LOCAL(FirstWidth);
- DEALLOCATE_LOCAL(FirstPoint);
+ xfree(FirstWidth);
+ xfree(FirstPoint);
return(TRUE);
}
while (i-- > 0)
@@ -209,8 +209,8 @@ miFillConvexPoly(dst, pgc, count, ptsIn)
(*pgc->ops->FillSpans)(dst, pgc,
ptsOut-FirstPoint,FirstPoint,FirstWidth,
1);
- DEALLOCATE_LOCAL(FirstWidth);
- DEALLOCATE_LOCAL(FirstPoint);
+ xfree(FirstWidth);
+ xfree(FirstPoint);
return(TRUE);
}