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 | |
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')
-rw-r--r-- | nx-X11/programs/Xserver/mi/miarc.c | 22 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibitblt.c | 42 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibstore.c | 68 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miexpose.c | 16 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mifillarc.c | 40 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mifillrct.c | 12 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mifpolycon.c | 18 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miglblt.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mipolycon.c | 16 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mipolygen.c | 6 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mipolypnt.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mipolyrect.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mispans.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miwideline.c | 20 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mizerarc.c | 10 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mizerline.c | 8 |
16 files changed, 146 insertions, 146 deletions
diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c index ee493bc2c..bd46a243a 100644 --- a/nx-X11/programs/Xserver/mi/miarc.c +++ b/nx-X11/programs/Xserver/mi/miarc.c @@ -954,14 +954,14 @@ miFillWideEllipse( yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; - widths = (int *)ALLOCATE_LOCAL(n + (sizeof(DDXPointRec) * 2) * yorgu); + widths = (int *)malloc(n + (sizeof(DDXPointRec) * 2) * yorgu); if (!widths) return; points = (DDXPointPtr)((char *)widths + n); spdata = miComputeWideEllipse((int)pGC->lineWidth, parc, &mustFree); if (!spdata) { - DEALLOCATE_LOCAL(widths); + free(widths); return; } pts = points; @@ -1054,7 +1054,7 @@ miFillWideEllipse( free(spdata); (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); + free(widths); } /* @@ -1927,13 +1927,13 @@ miComputeArcs ( isDoubleDash = (pGC->lineStyle == LineDoubleDash); dashOffset = pGC->dashOffset; - data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData)); + data = (struct arcData *) malloc (narcs * sizeof (struct arcData)); if (!data) return (miPolyArcPtr)NULL; arcs = (miPolyArcPtr) malloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1)); if (!arcs) { - DEALLOCATE_LOCAL(data); + free(data); return (miPolyArcPtr)NULL; } for (i = 0; i < narcs; i++) { @@ -2282,11 +2282,11 @@ miComputeArcs ( arcs[iphase].arcs[arcs[iphase].narcs-1].cap = arcs[iphase].ncaps; } - DEALLOCATE_LOCAL(data); + free(data); return arcs; arcfail: miFreeArcs(arcs, pGC); - DEALLOCATE_LOCAL(data); + free(data); return (miPolyArcPtr)NULL; } @@ -3190,8 +3190,8 @@ fillSpans ( if (nspans == 0) return; - xSpan = xSpans = (DDXPointPtr) ALLOCATE_LOCAL (nspans * sizeof (DDXPointRec)); - xWidth = xWidths = (int *) ALLOCATE_LOCAL (nspans * sizeof (int)); + xSpan = xSpans = (DDXPointPtr) malloc (nspans * sizeof (DDXPointRec)); + xWidth = xWidths = (int *) malloc (nspans * sizeof (int)); if (xSpans && xWidths) { i = 0; @@ -3211,9 +3211,9 @@ fillSpans ( } disposeFinalSpans (); if (xSpans) - DEALLOCATE_LOCAL (xSpans); + free (xSpans); if (xWidths) - DEALLOCATE_LOCAL (xWidths); + free (xWidths); finalMiny = 0; finalMaxy = -1; finalSize = 0; 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; } } diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 79791057c..5fddc8573 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -963,8 +963,8 @@ miBSFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) PROLOGUE(pGC); - pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(nInit*sizeof(DDXPointRec)); - pwidthCopy=(int *)ALLOCATE_LOCAL(nInit*sizeof(int)); + pptCopy = (DDXPointPtr)malloc(nInit*sizeof(DDXPointRec)); + pwidthCopy=(int *)malloc(nInit*sizeof(int)); if (pptCopy && pwidthCopy) { copyData(pptInit, pptCopy, nInit, MoreCopy0); @@ -992,8 +992,8 @@ miBSFillSpans(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) pBackingGC, nInit, pptCopy, pwidthCopy, fSorted); } - if (pwidthCopy) DEALLOCATE_LOCAL(pwidthCopy); - if (pptCopy) DEALLOCATE_LOCAL(pptCopy); + if (pwidthCopy) free(pwidthCopy); + if (pptCopy) free(pptCopy); EPILOGUE (pGC); } @@ -1026,8 +1026,8 @@ miBSSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted) PROLOGUE(pGC); - pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(nspans*sizeof(DDXPointRec)); - pwidthCopy=(int *)ALLOCATE_LOCAL(nspans*sizeof(int)); + pptCopy = (DDXPointPtr)malloc(nspans*sizeof(DDXPointRec)); + pwidthCopy=(int *)malloc(nspans*sizeof(int)); if (pptCopy && pwidthCopy) { copyData(ppt, pptCopy, nspans, MoreCopy0); @@ -1054,8 +1054,8 @@ miBSSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted) (* pBackingGC->ops->SetSpans)(pBackingDrawable, pBackingGC, psrc, pptCopy, pwidthCopy, nspans, fSorted); } - if (pwidthCopy) DEALLOCATE_LOCAL(pwidthCopy); - if (pptCopy) DEALLOCATE_LOCAL(pptCopy); + if (pwidthCopy) free(pwidthCopy); + if (pptCopy) free(pptCopy); EPILOGUE (pGC); } @@ -1209,14 +1209,14 @@ miBSDoCopy( numRectsObs = RegionNumRects(pRgnObs); nrects = numRectsExp + numRectsObs; - boxes = (struct BoxDraw *)ALLOCATE_LOCAL(nrects * sizeof(struct BoxDraw)); - sequence = (int *) ALLOCATE_LOCAL(nrects * sizeof(int)); + boxes = (struct BoxDraw *)malloc(nrects * sizeof(struct BoxDraw)); + sequence = (int *) malloc(nrects * sizeof(int)); *ppRgn = NULL; if (!boxes || !sequence) { - if (sequence) DEALLOCATE_LOCAL(sequence); - if (boxes) DEALLOCATE_LOCAL(boxes); + if (sequence) free(sequence); + if (boxes) free(boxes); RegionDestroy(pRgnExp); RegionDestroy(pRgnObs); @@ -1424,8 +1424,8 @@ miBSDoCopy( pBox->x1 + dx, pBox->y1 + dy, plane); } } - DEALLOCATE_LOCAL(sequence); - DEALLOCATE_LOCAL(boxes); + free(sequence); + free(boxes); pGC->graphicsExposures = graphicsExposures; /* @@ -1720,7 +1720,7 @@ miBSPolyPoint (pDrawable, pGC, mode, npt, pptInit) PROLOGUE(pGC); - pptCopy = (xPoint *)ALLOCATE_LOCAL(npt*sizeof(xPoint)); + pptCopy = (xPoint *)malloc(npt*sizeof(xPoint)); if (pptCopy) { copyPoints(pptInit, pptCopy, npt, mode); @@ -1730,7 +1730,7 @@ miBSPolyPoint (pDrawable, pGC, mode, npt, pptInit) (* pBackingGC->ops->PolyPoint) (pBackingDrawable, pBackingGC, mode, npt, pptCopy); - DEALLOCATE_LOCAL(pptCopy); + free(pptCopy); } EPILOGUE (pGC); @@ -1760,7 +1760,7 @@ miBSPolylines (pDrawable, pGC, mode, npt, pptInit) PROLOGUE(pGC); - pptCopy = (DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec)); + pptCopy = (DDXPointPtr)malloc(npt*sizeof(DDXPointRec)); if (pptCopy) { copyPoints(pptInit, pptCopy, npt, mode); @@ -1768,7 +1768,7 @@ miBSPolylines (pDrawable, pGC, mode, npt, pptInit) (* pGC->ops->Polylines)(pDrawable, pGC, mode, npt, pptInit); (* pBackingGC->ops->Polylines)(pBackingDrawable, pBackingGC, mode, npt, pptCopy); - DEALLOCATE_LOCAL(pptCopy); + free(pptCopy); } EPILOGUE (pGC); @@ -1799,7 +1799,7 @@ miBSPolySegment(pDrawable, pGC, nseg, pSegs) PROLOGUE(pGC); - pSegsCopy = (xSegment *)ALLOCATE_LOCAL(nseg*sizeof(xSegment)); + pSegsCopy = (xSegment *)malloc(nseg*sizeof(xSegment)); if (pSegsCopy) { copyData(pSegs, pSegsCopy, nseg << 1, MoreCopy0); @@ -1808,7 +1808,7 @@ miBSPolySegment(pDrawable, pGC, nseg, pSegs) (* pBackingGC->ops->PolySegment)(pBackingDrawable, pBackingGC, nseg, pSegsCopy); - DEALLOCATE_LOCAL(pSegsCopy); + free(pSegsCopy); } EPILOGUE (pGC); @@ -1838,7 +1838,7 @@ miBSPolyRectangle(pDrawable, pGC, nrects, pRects) PROLOGUE(pGC); - pRectsCopy =(xRectangle *)ALLOCATE_LOCAL(nrects*sizeof(xRectangle)); + pRectsCopy =(xRectangle *)malloc(nrects*sizeof(xRectangle)); if (pRectsCopy) { copyData(pRects, pRectsCopy, nrects, MoreCopy2); @@ -1847,7 +1847,7 @@ miBSPolyRectangle(pDrawable, pGC, nrects, pRects) (* pBackingGC->ops->PolyRectangle)(pBackingDrawable, pBackingGC, nrects, pRectsCopy); - DEALLOCATE_LOCAL(pRectsCopy); + free(pRectsCopy); } EPILOGUE (pGC); @@ -1876,7 +1876,7 @@ miBSPolyArc(pDrawable, pGC, narcs, parcs) PROLOGUE(pGC); - pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc)); + pArcsCopy = (xArc *)malloc(narcs*sizeof(xArc)); if (pArcsCopy) { copyData(parcs, pArcsCopy, narcs, MoreCopy4); @@ -1885,7 +1885,7 @@ miBSPolyArc(pDrawable, pGC, narcs, parcs) (* pBackingGC->ops->PolyArc)(pBackingDrawable, pBackingGC, narcs, pArcsCopy); - DEALLOCATE_LOCAL(pArcsCopy); + free(pArcsCopy); } EPILOGUE (pGC); @@ -1916,7 +1916,7 @@ miBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts) PROLOGUE(pGC); - pPtsCopy = (DDXPointPtr)ALLOCATE_LOCAL(count*sizeof(DDXPointRec)); + pPtsCopy = (DDXPointPtr)malloc(count*sizeof(DDXPointRec)); if (pPtsCopy) { copyPoints(pPts, pPtsCopy, count, mode); @@ -1925,7 +1925,7 @@ miBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts) pBackingGC, shape, mode, count, pPtsCopy); - DEALLOCATE_LOCAL(pPtsCopy); + free(pPtsCopy); } EPILOGUE (pGC); @@ -1956,7 +1956,7 @@ miBSPolyFillRect(pDrawable, pGC, nrectFill, prectInit) PROLOGUE(pGC); pRectCopy = - (xRectangle *)ALLOCATE_LOCAL(nrectFill*sizeof(xRectangle)); + (xRectangle *)malloc(nrectFill*sizeof(xRectangle)); if (pRectCopy) { copyData(prectInit, pRectCopy, nrectFill, MoreCopy2); @@ -1965,7 +1965,7 @@ miBSPolyFillRect(pDrawable, pGC, nrectFill, prectInit) (* pBackingGC->ops->PolyFillRect)(pBackingDrawable, pBackingGC, nrectFill, pRectCopy); - DEALLOCATE_LOCAL(pRectCopy); + free(pRectCopy); } EPILOGUE (pGC); @@ -1995,14 +1995,14 @@ miBSPolyFillArc(pDrawable, pGC, narcs, parcs) PROLOGUE(pGC); - pArcsCopy = (xArc *)ALLOCATE_LOCAL(narcs*sizeof(xArc)); + pArcsCopy = (xArc *)malloc(narcs*sizeof(xArc)); if (pArcsCopy) { copyData(parcs, pArcsCopy, narcs, MoreCopy4); (* pGC->ops->PolyFillArc)(pDrawable, pGC, narcs, parcs); (* pBackingGC->ops->PolyFillArc)(pBackingDrawable, pBackingGC, narcs, pArcsCopy); - DEALLOCATE_LOCAL(pArcsCopy); + free(pArcsCopy); } EPILOGUE (pGC); @@ -2391,7 +2391,7 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) * PolyFillRect in the proper mode, as set in the GC above. */ numRects = RegionNumRects(pRgn); - rects = (xRectangle *)ALLOCATE_LOCAL(numRects*sizeof(xRectangle)); + rects = (xRectangle *)malloc(numRects*sizeof(xRectangle)); if (rects) { @@ -2407,7 +2407,7 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) (* pGC->ops->PolyFillRect) ( (DrawablePtr)pBackingStore->pBackingPixmap, pGC, numRects, rects); - DEALLOCATE_LOCAL(rects); + free(rects); } FreeScratchGC(pGC); } @@ -2483,7 +2483,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) if (state == None) return; numRects = RegionNumRects(pRgn); - pRect = (xRectangle *)ALLOCATE_LOCAL(numRects * sizeof(xRectangle)); + pRect = (xRectangle *)malloc(numRects * sizeof(xRectangle)); if (!pRect) return; pWin = 0; @@ -2554,7 +2554,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) (*pGC->ops->PolyFillRect) (pDrawable, pGC, numRects, pRect); if (pWin) (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); - DEALLOCATE_LOCAL (pRect); + free (pRect); } /*- diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index e16ebf4f8..c39221000 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -395,7 +395,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) numRects = RegionNumRects(pRgn); pBox = RegionRects(pRgn); - if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) + if(!(pEvent = (xEvent *)malloc(numRects * sizeof(xEvent)))) return; pe = pEvent; @@ -413,7 +413,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) } TryClientEvents(client, pEvent, numRects, (Mask)0, NoEventMask, NullGrab); - DEALLOCATE_LOCAL(pEvent); + free(pEvent); } else { @@ -442,7 +442,7 @@ miSendExposures(pWin, pRgn, dx, dy) pBox = RegionRects(pRgn); numRects = RegionNumRects(pRgn); - if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) + if(!(pEvent = (xEvent *) malloc(numRects * sizeof(xEvent)))) return; memset(pEvent, 0, numRects * sizeof(xEvent)); @@ -473,7 +473,7 @@ miSendExposures(pWin, pRgn, dx, dy) win = PanoramiXFindIDByScrnum(XRT_WINDOW, pWin->drawable.id, scrnum); if(!win) { - DEALLOCATE_LOCAL(pEvent); + free(pEvent); return; } realWin = win->info[0].id; @@ -490,7 +490,7 @@ miSendExposures(pWin, pRgn, dx, dy) DeliverEvents(pWin, pEvent, numRects, NullWindow); - DEALLOCATE_LOCAL(pEvent); + free(pEvent); } #ifndef NXAGENT_SERVER @@ -705,7 +705,7 @@ int what; } } - prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) * + prect = (xRectangle *)malloc(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -730,7 +730,7 @@ int what; pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); if (!pGC) { - DEALLOCATE_LOCAL(prect); + free(prect); return; } /* @@ -862,7 +862,7 @@ int what; } prect -= numRects; (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); + free(prect); if (pWin->backStorage) (*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeNothing); diff --git a/nx-X11/programs/Xserver/mi/mifillarc.c b/nx-X11/programs/Xserver/mi/mifillarc.c index befed1301..c967f3ab2 100644 --- a/nx-X11/programs/Xserver/mi/mifillarc.c +++ b/nx-X11/programs/Xserver/mi/mifillarc.c @@ -559,13 +559,13 @@ miFillEllipseI( int *widths; register int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)malloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + free(points); return; } miFillArcSetup(arc, &info); @@ -583,8 +583,8 @@ miFillEllipseI( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + free(widths); + free(points); } static void @@ -602,13 +602,13 @@ miFillEllipseD( int *widths; register int *wids; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * arc->height); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * arc->height); + widths = (int *)malloc(sizeof(int) * arc->height); if (!widths) { - DEALLOCATE_LOCAL(points); + free(points); return; } miFillArcDSetup(arc, &info); @@ -626,8 +626,8 @@ miFillEllipseD( ADDSPANS(); } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + free(widths); + free(points); } #define ADDSPAN(l,r) \ @@ -674,13 +674,13 @@ miFillArcSliceI( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)malloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + free(points); return; } if (pGC->miTranslate) @@ -711,8 +711,8 @@ miFillArcSliceI( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + free(widths); + free(points); } static void @@ -738,13 +738,13 @@ miFillArcSliceD( slw = arc->height; if (slice.flip_top || slice.flip_bot) slw += (arc->height >> 1) + 1; - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * slw); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * slw); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * slw); + widths = (int *)malloc(sizeof(int) * slw); if (!widths) { - DEALLOCATE_LOCAL(points); + free(points); return; } if (pGC->miTranslate) @@ -775,8 +775,8 @@ miFillArcSliceD( } } (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + free(widths); + free(points); } /* MIPOLYFILLARC -- The public entry for the PolyFillArc request. diff --git a/nx-X11/programs/Xserver/mi/mifillrct.c b/nx-X11/programs/Xserver/mi/mifillrct.c index 197c2bf6a..ba1d29141 100644 --- a/nx-X11/programs/Xserver/mi/mifillrct.c +++ b/nx-X11/programs/Xserver/mi/mifillrct.c @@ -106,12 +106,12 @@ miPolyFillRect(pDrawable, pGC, nrectFill, prectInit) maxheight = max(maxheight, prect->height); } - pptFirst = (DDXPointPtr) ALLOCATE_LOCAL(maxheight * sizeof(DDXPointRec)); - pwFirst = (int *) ALLOCATE_LOCAL(maxheight * sizeof(int)); + pptFirst = (DDXPointPtr) malloc(maxheight * sizeof(DDXPointRec)); + pwFirst = (int *) malloc(maxheight * sizeof(int)); if(!pptFirst || !pwFirst) { - if (pwFirst) DEALLOCATE_LOCAL(pwFirst); - if (pptFirst) DEALLOCATE_LOCAL(pptFirst); + if (pwFirst) free(pwFirst); + if (pptFirst) free(pptFirst); return; } @@ -137,6 +137,6 @@ miPolyFillRect(pDrawable, pGC, nrectFill, prectInit) 1); prect++; } - DEALLOCATE_LOCAL(pwFirst); - DEALLOCATE_LOCAL(pptFirst); + free(pwFirst); + free(pptFirst); } diff --git a/nx-X11/programs/Xserver/mi/mifpolycon.c b/nx-X11/programs/Xserver/mi/mifpolycon.c index d9f18637a..d544555e0 100644 --- a/nx-X11/programs/Xserver/mi/mifpolycon.c +++ b/nx-X11/programs/Xserver/mi/mifpolycon.c @@ -118,15 +118,15 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) y = ymax - ymin + 1; if ((count < 3) || (y <= 0)) return; - ptsOut = FirstPoint = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * y); - width = FirstWidth = (int *) ALLOCATE_LOCAL(sizeof(int) * y); - Marked = (int *) ALLOCATE_LOCAL(sizeof(int) * count); + ptsOut = FirstPoint = (DDXPointPtr)malloc(sizeof(DDXPointRec) * y); + width = FirstWidth = (int *) malloc(sizeof(int) * y); + Marked = (int *) malloc(sizeof(int) * count); if(!ptsOut || !width || !Marked) { - if (Marked) DEALLOCATE_LOCAL(Marked); - if (width) DEALLOCATE_LOCAL(width); - if (ptsOut) DEALLOCATE_LOCAL(ptsOut); + if (Marked) free(Marked); + if (width) free(width); + if (ptsOut) free(ptsOut); return; } @@ -240,9 +240,9 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) /* Finally, fill the spans we've collected */ (*pgc->ops->FillSpans)(dst, pgc, ptsOut-FirstPoint, FirstPoint, FirstWidth, 1); - DEALLOCATE_LOCAL(Marked); - DEALLOCATE_LOCAL(FirstWidth); - DEALLOCATE_LOCAL(FirstPoint); + free(Marked); + free(FirstWidth); + free(FirstPoint); } diff --git a/nx-X11/programs/Xserver/mi/miglblt.c b/nx-X11/programs/Xserver/mi/miglblt.c index 45fa9ea25..e317541a4 100644 --- a/nx-X11/programs/Xserver/mi/miglblt.c +++ b/nx-X11/programs/Xserver/mi/miglblt.c @@ -138,7 +138,7 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0); nbyLine = BitmapBytePad(width); - pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); + pbits = (unsigned char *)malloc(height*nbyLine); if (!pbits) { (*pDrawable->pScreen->DestroyPixmap)(pPixmap); @@ -189,7 +189,7 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) x += pci->metrics.characterWidth; } (*pDrawable->pScreen->DestroyPixmap)(pPixmap); - DEALLOCATE_LOCAL(pbits); + free(pbits); FreeScratchGC(pGCtmp); } diff --git a/nx-X11/programs/Xserver/mi/mipolycon.c b/nx-X11/programs/Xserver/mi/mipolycon.c index 985fceb49..39d13f914 100644 --- a/nx-X11/programs/Xserver/mi/mipolycon.c +++ b/nx-X11/programs/Xserver/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 )malloc(sizeof(DDXPointRec)*dy); + width = FirstWidth = (int *)malloc(sizeof(int) * dy); if(!FirstPoint || !FirstWidth) { - if (FirstWidth) DEALLOCATE_LOCAL(FirstWidth); - if (FirstPoint) DEALLOCATE_LOCAL(FirstPoint); + if (FirstWidth) free(FirstWidth); + if (FirstPoint) free(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); + free(FirstWidth); + free(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); + free(FirstWidth); + free(FirstPoint); return(TRUE); } diff --git a/nx-X11/programs/Xserver/mi/mipolygen.c b/nx-X11/programs/Xserver/mi/mipolygen.c index 917791f16..9eb7568d4 100644 --- a/nx-X11/programs/Xserver/mi/mipolygen.c +++ b/nx-X11/programs/Xserver/mi/mipolygen.c @@ -92,13 +92,13 @@ miFillGeneralPoly(dst, pgc, count, ptsIn) return(TRUE); if(!(pETEs = (EdgeTableEntry *) - ALLOCATE_LOCAL(sizeof(EdgeTableEntry) * count))) + malloc(sizeof(EdgeTableEntry) * count))) return(FALSE); ptsOut = FirstPoint; width = FirstWidth; if (!miCreateETandAET(count, ptsIn, &ET, &AET, pETEs, &SLLBlock)) { - DEALLOCATE_LOCAL(pETEs); + free(pETEs); return(FALSE); } pSLL = ET.scanlines.next; @@ -224,7 +224,7 @@ miFillGeneralPoly(dst, pgc, count, ptsIn) * Get any spans that we missed by buffering */ (*pgc->ops->FillSpans)(dst, pgc, nPts, FirstPoint, FirstWidth, 1); - DEALLOCATE_LOCAL(pETEs); + free(pETEs); miFreeStorage(SLLBlock.next); return(TRUE); } diff --git a/nx-X11/programs/Xserver/mi/mipolypnt.c b/nx-X11/programs/Xserver/mi/mipolypnt.c index 41adc7b22..ff35213b6 100644 --- a/nx-X11/programs/Xserver/mi/mipolypnt.c +++ b/nx-X11/programs/Xserver/mi/mipolypnt.c @@ -106,7 +106,7 @@ miPolyPoint(pDrawable, pGC, mode, npt, pptInit) DoChangeGC(pGC, GCFillStyle, &fsNew, 0); ValidateGC(pDrawable, pGC); } - if(!(pwidthInit = (int *)ALLOCATE_LOCAL(npt * sizeof(int)))) + if(!(pwidthInit = (int *)malloc(npt * sizeof(int)))) return; pwidth = pwidthInit; for(i = 0; i < npt; i++) @@ -118,6 +118,6 @@ miPolyPoint(pDrawable, pGC, mode, npt, pptInit) DoChangeGC(pGC, GCFillStyle, &fsOld, 0); ValidateGC(pDrawable, pGC); } - DEALLOCATE_LOCAL(pwidthInit); + free(pwidthInit); } diff --git a/nx-X11/programs/Xserver/mi/mipolyrect.c b/nx-X11/programs/Xserver/mi/mipolyrect.c index 2fe70cf4b..ee0688513 100644 --- a/nx-X11/programs/Xserver/mi/mipolyrect.c +++ b/nx-X11/programs/Xserver/mi/mipolyrect.c @@ -94,7 +94,7 @@ miPolyRectangle(pDraw, pGC, nrects, pRects) offset2 = pGC->lineWidth; offset1 = offset2 >> 1; offset3 = offset2 - offset1; - tmp = (xRectangle *) ALLOCATE_LOCAL(ntmp * sizeof (xRectangle)); + tmp = (xRectangle *) malloc(ntmp * sizeof (xRectangle)); if (!tmp) return; t = tmp; @@ -162,7 +162,7 @@ miPolyRectangle(pDraw, pGC, nrects, pRects) } } (*pGC->ops->PolyFillRect) (pDraw, pGC, t - tmp, tmp); - DEALLOCATE_LOCAL ((void *) tmp); + free ((void *) tmp); } else { diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c index a0b3d8e3c..a8762d323 100644 --- a/nx-X11/programs/Xserver/mi/mispans.c +++ b/nx-X11/programs/Xserver/mi/mispans.c @@ -531,7 +531,7 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) free(points); free(widths); free(yspans); - free(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */ + free(ysizes); } spanGroup->count = 0; diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c index 530d9f87e..8fcf351a7 100644 --- a/nx-X11/programs/Xserver/mi/miwideline.c +++ b/nx-X11/programs/Xserver/mi/miwideline.c @@ -105,13 +105,13 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, if (!spanData) { - pptInit = (DDXPointPtr) ALLOCATE_LOCAL (overall_height * sizeof(*ppt)); + pptInit = (DDXPointPtr) malloc (overall_height * sizeof(*ppt)); if (!pptInit) return; - pwidthInit = (int *) ALLOCATE_LOCAL (overall_height * sizeof(*pwidth)); + pwidthInit = (int *) malloc (overall_height * sizeof(*pwidth)); if (!pwidthInit) { - DEALLOCATE_LOCAL (pptInit); + free (pptInit); return; } ppt = pptInit; @@ -176,8 +176,8 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, if (!spanData) { (*pGC->ops->FillSpans) (pDrawable, pGC, ppt - pptInit, pptInit, pwidthInit, TRUE); - DEALLOCATE_LOCAL (pwidthInit); - DEALLOCATE_LOCAL (pptInit); + free (pwidthInit); + free (pptInit); if (pixel != oldPixel) { DoChangeGC (pGC, GCForeground, &oldPixel, FALSE); @@ -1056,13 +1056,13 @@ miLineArc ( } if (!spanData) { - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * pGC->lineWidth); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * pGC->lineWidth); if (!points) return; - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * pGC->lineWidth); + widths = (int *)malloc(sizeof(int) * pGC->lineWidth); if (!widths) { - DEALLOCATE_LOCAL(points); + free(points); return; } oldPixel = pGC->fgPixel; @@ -1096,8 +1096,8 @@ miLineArc ( if (!spanData) { (*pGC->ops->FillSpans)(pDraw, pGC, n, points, widths, TRUE); - DEALLOCATE_LOCAL(widths); - DEALLOCATE_LOCAL(points); + free(widths); + free(points); if (pixel != oldPixel) { DoChangeGC(pGC, GCForeground, &oldPixel, FALSE); diff --git a/nx-X11/programs/Xserver/mi/mizerarc.c b/nx-X11/programs/Xserver/mi/mizerarc.c index 4920d4425..82832fea0 100644 --- a/nx-X11/programs/Xserver/mi/mizerarc.c +++ b/nx-X11/programs/Xserver/mi/mizerarc.c @@ -746,7 +746,7 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) dospans = (pGC->fillStyle != FillSolid); if (dospans) { - widths = (int *)ALLOCATE_LOCAL(sizeof(int) * numPts); + widths = (int *)malloc(sizeof(int) * numPts); if (!widths) return; maxw = 0; @@ -763,12 +763,12 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) (unsigned char *) pGC->dash, (int)pGC->numInDashList, &dinfo.dashOffsetInit); } - points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * numPts); + points = (DDXPointPtr)malloc(sizeof(DDXPointRec) * numPts); if (!points) { if (dospans) { - DEALLOCATE_LOCAL(widths); + free(widths); } return; } @@ -845,9 +845,9 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) } } } - DEALLOCATE_LOCAL(points); + free(points); if (dospans) { - DEALLOCATE_LOCAL(widths); + free(widths); } } diff --git a/nx-X11/programs/Xserver/mi/mizerline.c b/nx-X11/programs/Xserver/mi/mizerline.c index 5f7eec32f..49d87edd8 100644 --- a/nx-X11/programs/Xserver/mi/mizerline.c +++ b/nx-X11/programs/Xserver/mi/mizerline.c @@ -155,8 +155,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) width = xright - xleft + 1; height = ybottom - ytop + 1; list_len = (height >= width) ? height : width; - pspanInit = (DDXPointPtr)ALLOCATE_LOCAL(list_len * sizeof(DDXPointRec)); - pwidthInit = (int *)ALLOCATE_LOCAL(list_len * sizeof(int)); + pspanInit = (DDXPointPtr)malloc(list_len * sizeof(DDXPointRec)); + pwidthInit = (int *)malloc(list_len * sizeof(int)); if (!pspanInit || !pwidthInit) return; @@ -359,8 +359,8 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) (*pGC->ops->FillSpans)(pDraw, pGC, Nspans, pspanInit, pwidthInit, FALSE); - DEALLOCATE_LOCAL(pwidthInit); - DEALLOCATE_LOCAL(pspanInit); + free(pwidthInit); + free(pspanInit); } void |