Replace ALLOCATE_LOCAL/DEALLOCATE_LOCAL with xalloc/xfree
This commit is contained in:
parent
7f9cefffbf
commit
75ef3e669d
|
|
@ -1208,7 +1208,7 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
I810Ptr pI810 = I810PTR(pScrn);
|
||||
BoxPtr pboxTmp, pboxNext, pboxBase;
|
||||
DDXPointPtr pptTmp, pptNew2;
|
||||
DDXPointPtr pptTmp, pptNew2 = NULL;
|
||||
int xdir, ydir;
|
||||
|
||||
int screenwidth = pScrn->virtualX;
|
||||
|
|
@ -1231,12 +1231,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
|
||||
if (nbox > 1) {
|
||||
/* Keep ordering in each band, reverse order of bands */
|
||||
pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
|
||||
pboxNew1 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
|
||||
if (!pboxNew1)
|
||||
return;
|
||||
pptNew1 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
|
||||
pptNew1 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
|
||||
if (!pptNew1) {
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pboxNew1);
|
||||
return;
|
||||
}
|
||||
pboxBase = pboxNext = pbox + nbox - 1;
|
||||
|
|
@ -1267,16 +1267,16 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
|
||||
if (nbox > 1) {
|
||||
/*reverse orderof rects in each band */
|
||||
pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
|
||||
pptNew2 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
|
||||
pboxNew2 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
|
||||
pptNew2 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
|
||||
if (!pboxNew2 || !pptNew2) {
|
||||
if (pptNew2)
|
||||
DEALLOCATE_LOCAL(pptNew2);
|
||||
xfree(pptNew2);
|
||||
if (pboxNew2)
|
||||
DEALLOCATE_LOCAL(pboxNew2);
|
||||
xfree(pboxNew2);
|
||||
if (pboxNew1) {
|
||||
DEALLOCATE_LOCAL(pptNew1);
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -1341,12 +1341,12 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
I810EmitFlush(pScrn);
|
||||
|
||||
if (pboxNew2) {
|
||||
DEALLOCATE_LOCAL(pptNew2);
|
||||
DEALLOCATE_LOCAL(pboxNew2);
|
||||
xfree(pptNew2);
|
||||
xfree(pboxNew2);
|
||||
}
|
||||
if (pboxNew1) {
|
||||
DEALLOCATE_LOCAL(pptNew1);
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
}
|
||||
|
||||
if (pI810->AccelInfoRec)
|
||||
|
|
|
|||
|
|
@ -1249,7 +1249,7 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
BoxPtr pboxTmp, pboxNext, pboxBase;
|
||||
DDXPointPtr pptTmp, pptNew2;
|
||||
DDXPointPtr pptTmp, pptNew2 = NULL;
|
||||
int xdir, ydir;
|
||||
|
||||
#if 0
|
||||
|
|
@ -1277,12 +1277,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
|
||||
if (nbox > 1) {
|
||||
/* Keep ordering in each band, reverse order of bands */
|
||||
pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
|
||||
pboxNew1 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
|
||||
if (!pboxNew1)
|
||||
return;
|
||||
pptNew1 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
|
||||
pptNew1 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
|
||||
if (!pptNew1) {
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pboxNew1);
|
||||
return;
|
||||
}
|
||||
pboxBase = pboxNext = pbox + nbox - 1;
|
||||
|
|
@ -1313,16 +1313,16 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
|
||||
if (nbox > 1) {
|
||||
/*reverse orderof rects in each band */
|
||||
pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
|
||||
pptNew2 = (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
|
||||
pboxNew2 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
|
||||
pptNew2 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
|
||||
if (!pboxNew2 || !pptNew2) {
|
||||
if (pptNew2)
|
||||
DEALLOCATE_LOCAL(pptNew2);
|
||||
xfree(pptNew2);
|
||||
if (pboxNew2)
|
||||
DEALLOCATE_LOCAL(pboxNew2);
|
||||
xfree(pboxNew2);
|
||||
if (pboxNew1) {
|
||||
DEALLOCATE_LOCAL(pptNew1);
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -1393,12 +1393,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
I830EmitFlush(pScrn);
|
||||
|
||||
if (pboxNew2) {
|
||||
DEALLOCATE_LOCAL(pptNew2);
|
||||
DEALLOCATE_LOCAL(pboxNew2);
|
||||
xfree(pptNew2);
|
||||
xfree(pboxNew2);
|
||||
}
|
||||
if (pboxNew1) {
|
||||
DEALLOCATE_LOCAL(pptNew1);
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
xfree(pptNew1);
|
||||
xfree(pboxNew1);
|
||||
}
|
||||
i830MarkSync(pScrn);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue