diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-03-02 15:38:08 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2017-03-03 18:58:43 +0100 |
commit | 09ef99919c010801bd4220d482a867035b6f4f25 (patch) | |
tree | 78bbb0c52085036b2a3ff82b29f242173bf39eda /nx-X11/programs/Xserver/mi/mibitblt.c | |
parent | 89ccf26d65a3f205e54d9f6240b672f970e7b9c1 (diff) | |
download | nx-libs-09ef99919c010801bd4220d482a867035b6f4f25.tar.gz nx-libs-09ef99919c010801bd4220d482a867035b6f4f25.tar.bz2 nx-libs-09ef99919c010801bd4220d482a867035b6f4f25.zip |
replace (DE)ALLOCATE_LOCAL by malloc/free
This is basically a backport of the following commits + replacing
xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358.
commit 2761c103311a1160bc483fd0367d654733df8598
Author: Daniel Stone <daniel@fooishbar.org>
Date: Mon Nov 5 14:03:26 2007 +0000
OS: Remove usage of alloca
Replace with heap allocations.
commit 5e363500c86042c394595e1a6633581eb8fcd1bb
Author: Daniel Stone <daniel@fooishbar.org>
Date: Mon Nov 5 14:38:28 2007 +0000
OS: Remove ALLOCATE_LOCAL from os.h
Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and
remove the include of Xalloca.h as well.
Diffstat (limited to 'nx-X11/programs/Xserver/mi/mibitblt.c')
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibitblt.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index 143f18043..2fdc32500 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -143,21 +143,21 @@ miCopyArea(pSrcDrawable, pDstDrawable, } pptFirst = ppt = (DDXPointPtr) - ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec)); + malloc(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = (unsigned int *) - ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int)); + malloc(heightSrc * sizeof(unsigned int)); numRects = RegionNumRects(prgnSrcClip); boxes = RegionRects(prgnSrcClip); ordering = (unsigned int *) - ALLOCATE_LOCAL(numRects * sizeof(unsigned int)); + malloc(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) { if (ordering) - DEALLOCATE_LOCAL(ordering); + free(ordering); if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + free(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + free(pptFirst); return (RegionPtr)NULL; } @@ -264,9 +264,9 @@ miCopyArea(pSrcDrawable, pDstDrawable, if(realSrcClip) RegionDestroy(prgnSrcClip); - DEALLOCATE_LOCAL(ordering); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + free(ordering); + free(pwidthFirst); + free(pptFirst); return prgnExposed; } @@ -436,12 +436,12 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty) dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv); ValidateGC((DrawablePtr)pPixmap, pGCT); miClearDrawable((DrawablePtr)pPixmap, pGCT); - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)malloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)malloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { - if (pwidthFirst) DEALLOCATE_LOCAL(pwidthFirst); - if (pptFirst) DEALLOCATE_LOCAL(pptFirst); + if (pwidthFirst) free(pwidthFirst); + if (pptFirst) free(pptFirst); FreeScratchGC(pGCT); return; } @@ -467,8 +467,8 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty) (*pGCT->ops->SetSpans)((DrawablePtr)pPixmap, pGCT, (char *)pbits, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + free(pwidthFirst); + free(pptFirst); /* Save current values from the client GC */ @@ -810,14 +810,14 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) break; case ZPixmap: - ppt = pptFirst = (DDXPointPtr)ALLOCATE_LOCAL(h * sizeof(DDXPointRec)); - pwidth = pwidthFirst = (int *)ALLOCATE_LOCAL(h * sizeof(int)); + ppt = pptFirst = (DDXPointPtr)malloc(h * sizeof(DDXPointRec)); + pwidth = pwidthFirst = (int *)malloc(h * sizeof(int)); if(!pptFirst || !pwidthFirst) { if (pwidthFirst) - DEALLOCATE_LOCAL(pwidthFirst); + free(pwidthFirst); if (pptFirst) - DEALLOCATE_LOCAL(pptFirst); + free(pptFirst); return; } if (pGC->miTranslate) @@ -836,8 +836,8 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) (*pGC->ops->SetSpans)(pDraw, pGC, (char *)pImage, pptFirst, pwidthFirst, h, TRUE); - DEALLOCATE_LOCAL(pwidthFirst); - DEALLOCATE_LOCAL(pptFirst); + free(pwidthFirst); + free(pptFirst); break; } } |