Commit 75ef3e66 authored by Zhenyu Wang's avatar Zhenyu Wang

Replace ALLOCATE_LOCAL/DEALLOCATE_LOCAL with xalloc/xfree

parent 7f9cefff
...@@ -1208,7 +1208,7 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1208,7 +1208,7 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I810Ptr pI810 = I810PTR(pScrn); I810Ptr pI810 = I810PTR(pScrn);
BoxPtr pboxTmp, pboxNext, pboxBase; BoxPtr pboxTmp, pboxNext, pboxBase;
DDXPointPtr pptTmp, pptNew2; DDXPointPtr pptTmp, pptNew2 = NULL;
int xdir, ydir; int xdir, ydir;
int screenwidth = pScrn->virtualX; int screenwidth = pScrn->virtualX;
...@@ -1231,12 +1231,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1231,12 +1231,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox > 1) { if (nbox > 1) {
/* Keep ordering in each band, reverse order of bands */ /* Keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew1 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
if (!pboxNew1) if (!pboxNew1)
return; return;
pptNew1 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew1 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
if (!pptNew1) { if (!pptNew1) {
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
return; return;
} }
pboxBase = pboxNext = pbox + nbox - 1; pboxBase = pboxNext = pbox + nbox - 1;
...@@ -1267,16 +1267,16 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1267,16 +1267,16 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox > 1) { if (nbox > 1) {
/*reverse orderof rects in each band */ /*reverse orderof rects in each band */
pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew2 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew2 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
if (!pboxNew2 || !pptNew2) { if (!pboxNew2 || !pptNew2) {
if (pptNew2) if (pptNew2)
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
if (pboxNew2) if (pboxNew2)
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
return; return;
} }
...@@ -1341,12 +1341,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1341,12 +1341,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
I810EmitFlush(pScrn); I810EmitFlush(pScrn);
if (pboxNew2) { if (pboxNew2) {
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
} }
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
if (pI810->AccelInfoRec) if (pI810->AccelInfoRec)
......
...@@ -1249,7 +1249,7 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1249,7 +1249,7 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn); I830Ptr pI830 = I830PTR(pScrn);
BoxPtr pboxTmp, pboxNext, pboxBase; BoxPtr pboxTmp, pboxNext, pboxBase;
DDXPointPtr pptTmp, pptNew2; DDXPointPtr pptTmp, pptNew2 = NULL;
int xdir, ydir; int xdir, ydir;
#if 0 #if 0
...@@ -1277,12 +1277,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1277,12 +1277,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox > 1) { if (nbox > 1) {
/* Keep ordering in each band, reverse order of bands */ /* Keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew1 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
if (!pboxNew1) if (!pboxNew1)
return; return;
pptNew1 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew1 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
if (!pptNew1) { if (!pptNew1) {
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
return; return;
} }
pboxBase = pboxNext = pbox + nbox - 1; pboxBase = pboxNext = pbox + nbox - 1;
...@@ -1313,16 +1313,16 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1313,16 +1313,16 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
if (nbox > 1) { if (nbox > 1) {
/*reverse orderof rects in each band */ /*reverse orderof rects in each band */
pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); pboxNew2 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
pptNew2 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); pptNew2 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
if (!pboxNew2 || !pptNew2) { if (!pboxNew2 || !pptNew2) {
if (pptNew2) if (pptNew2)
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
if (pboxNew2) if (pboxNew2)
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
return; return;
} }
...@@ -1393,12 +1393,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, ...@@ -1393,12 +1393,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
I830EmitFlush(pScrn); I830EmitFlush(pScrn);
if (pboxNew2) { if (pboxNew2) {
DEALLOCATE_LOCAL(pptNew2); xfree(pptNew2);
DEALLOCATE_LOCAL(pboxNew2); xfree(pboxNew2);
} }
if (pboxNew1) { if (pboxNew1) {
DEALLOCATE_LOCAL(pptNew1); xfree(pptNew1);
DEALLOCATE_LOCAL(pboxNew1); xfree(pboxNew1);
} }
i830MarkSync(pScrn); i830MarkSync(pScrn);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment