diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-03-02 15:38:08 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-03-03 22:44:44 +0100 |
commit | 06bb154df0a4d6e35885bce6a63057bd8f8636e8 (patch) | |
tree | 7eb1bb1a0e4633e77edf9d3d8e3829849303f1cd /nx-X11/programs/Xserver/render/render.c | |
parent | 6e8aee499ede4f8849653cdd248a6c0db5fb8b76 (diff) | |
download | nx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.tar.gz nx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.tar.bz2 nx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.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/render/render.c')
-rw-r--r-- | nx-X11/programs/Xserver/render/render.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index abc26b5d9..43cb430aa 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1338,7 +1338,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); + glyphsBase = (GlyphPtr *) malloc (nglyph * sizeof (GlyphPtr)); if (!glyphsBase) return BadAlloc; } @@ -1346,7 +1346,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) listsBase = listsLocal; else { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); + listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec)); if (!listsBase) return BadAlloc; } @@ -1371,9 +1371,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) { client->errorValue = gs; if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + free (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + free (listsBase); return RenderErrBase + BadGlyphSet; } } @@ -1427,9 +1427,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase); if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + free (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + free (listsBase); return client->noClientException; } @@ -2893,7 +2893,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -2919,7 +2919,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -2944,7 +2944,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -2981,7 +2981,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3006,7 +3006,7 @@ PanoramiXRenderTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3039,7 +3039,7 @@ PanoramiXRenderTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3064,7 +3064,7 @@ PanoramiXRenderTriStrip(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3093,7 +3093,7 @@ PanoramiXRenderTriStrip(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3118,7 +3118,7 @@ PanoramiXRenderTriFan(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3147,7 +3147,7 @@ PanoramiXRenderTriFan(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3172,7 +3172,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3193,7 +3193,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3216,7 +3216,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3237,7 +3237,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3260,7 +3260,7 @@ PanoramiXRenderAddTraps (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); x_off = stuff->xOff; @@ -3277,7 +3277,7 @@ PanoramiXRenderAddTraps (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; |