summaryrefslogtreecommitdiff
path: root/afb/afbfillsp.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-11-05 14:14:25 +0000
committerDaniel Stone <daniel@fooishbar.org>2007-11-05 14:34:45 +0000
commit683ee1776d172035c465aa8fc84ccd53bb8ba7fd (patch)
treeab506d9ed2b8e43c35935c0ee3f17d74dddd89c7 /afb/afbfillsp.c
parentca75261beedc3e00767b3812a81b7dac4437f4a1 (diff)
afb: Remove usage of alloca
Replace with heap allocations.
Diffstat (limited to 'afb/afbfillsp.c')
-rw-r--r--afb/afbfillsp.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/afb/afbfillsp.c b/afb/afbfillsp.c
index 539c3457c..b00185922 100644
--- a/afb/afbfillsp.c
+++ b/afb/afbfillsp.c
@@ -109,11 +109,11 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -183,8 +183,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++;
ppt++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -219,11 +219,11 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
unsigned char *rrops;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -297,8 +297,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
pwidth++;
ppt++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -333,11 +333,11 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -428,8 +428,8 @@ afbTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break;
}
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
void
@@ -465,11 +465,11 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -587,8 +587,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
break;
}
} /* switch (rop) */
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with tiles that aren't PPW bits wide */
@@ -626,11 +626,11 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
register int d;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -732,8 +732,8 @@ afbUnnaturalTileFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with stipples that aren't PPW bits wide */
@@ -772,11 +772,11 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -877,8 +877,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}
/* Fill spans with OpaqueStipples that aren't PPW bits wide */
@@ -918,11 +918,11 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
int depthDst;
n = nInit * miFindMaxBand(pGC->pCompositeClip);
- pwidthFree = (int *)ALLOCATE_LOCAL(n * sizeof(int));
- pptFree = (DDXPointRec *)ALLOCATE_LOCAL(n * sizeof(DDXPointRec));
+ pwidthFree = (int *)xalloc(n * sizeof(int));
+ pptFree = (DDXPointRec *)xalloc(n * sizeof(DDXPointRec));
if(!pptFree || !pwidthFree) {
- if (pptFree) DEALLOCATE_LOCAL(pptFree);
- if (pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ if (pptFree) xfree(pptFree);
+ if (pwidthFree) xfree(pwidthFree);
return;
}
pwidth = pwidthFree;
@@ -1124,6 +1124,6 @@ afbUnnaturalOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
ppt++;
pwidth++;
}
- DEALLOCATE_LOCAL(pptFree);
- DEALLOCATE_LOCAL(pwidthFree);
+ xfree(pptFree);
+ xfree(pwidthFree);
}