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/dix | |
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/dix')
-rw-r--r-- | nx-X11/programs/Xserver/dix/colormap.c | 40 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/devices.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/dispatch.c | 38 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/dixfonts.c | 8 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/extension.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/grabs.c | 24 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/property.c | 16 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/resource.c | 6 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/swaprep.c | 12 |
9 files changed, 76 insertions, 76 deletions
diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index d4ad5114c..7fcde71f3 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -740,7 +740,7 @@ UpdateColors (ColormapPtr pmap) pVisual = pmap->pVisual; size = pVisual->ColormapEntries; - defs = (xColorItem *)ALLOCATE_LOCAL(size * sizeof(xColorItem)); + defs = (xColorItem *)malloc(size * sizeof(xColorItem)); if (!defs) return; n = 0; @@ -790,7 +790,7 @@ UpdateColors (ColormapPtr pmap) } if (n) (*pmap->pScreen->StoreColors)(pmap, n, defs); - DEALLOCATE_LOCAL(defs); + free(defs); } /* Get a read-only color from a ColorMap (probably slow for large maps) @@ -1741,14 +1741,14 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont for(p = pixels; p < pixels + c; p++) *p = 0; - ppixRed = (Pixel *)ALLOCATE_LOCAL(npixR * sizeof(Pixel)); - ppixGreen = (Pixel *)ALLOCATE_LOCAL(npixG * sizeof(Pixel)); - ppixBlue = (Pixel *)ALLOCATE_LOCAL(npixB * sizeof(Pixel)); + ppixRed = (Pixel *)malloc(npixR * sizeof(Pixel)); + ppixGreen = (Pixel *)malloc(npixG * sizeof(Pixel)); + ppixBlue = (Pixel *)malloc(npixB * sizeof(Pixel)); if (!ppixRed || !ppixGreen || !ppixBlue) { - if (ppixBlue) DEALLOCATE_LOCAL(ppixBlue); - if (ppixGreen) DEALLOCATE_LOCAL(ppixGreen); - if (ppixRed) DEALLOCATE_LOCAL(ppixRed); + if (ppixBlue) free(ppixBlue); + if (ppixGreen) free(ppixGreen); + if (ppixRed) free(ppixRed); return(BadAlloc); } @@ -1786,9 +1786,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont if (okB) for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++) pmap->blue[*ppix].refcnt = 0; - DEALLOCATE_LOCAL(ppixBlue); - DEALLOCATE_LOCAL(ppixGreen); - DEALLOCATE_LOCAL(ppixRed); + free(ppixBlue); + free(ppixGreen); + free(ppixRed); return(BadAlloc); } @@ -1830,9 +1830,9 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont for (pDst = pixels; pDst < pixels + c; pDst++) *pDst |= ALPHAMASK(pmap->pVisual); - DEALLOCATE_LOCAL(ppixBlue); - DEALLOCATE_LOCAL(ppixGreen); - DEALLOCATE_LOCAL(ppixRed); + free(ppixBlue); + free(ppixGreen); + free(ppixRed); return (Success); } @@ -1848,7 +1848,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, npix = c << r; if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) return(BadAlloc); - if(!(ppixTemp = (Pixel *)ALLOCATE_LOCAL(npix * sizeof(Pixel)))) + if(!(ppixTemp = (Pixel *)malloc(npix * sizeof(Pixel)))) return(BadAlloc); ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); @@ -1878,7 +1878,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, pmap->numPixelsRed[client] += npix; pmap->freeRed -= npix; } - DEALLOCATE_LOCAL(ppixTemp); + free(ppixTemp); return (ok ? Success : BadAlloc); } @@ -2078,7 +2078,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, npixClientNew = c << (r + g + b); npixShared = (c << r) + (c << g) + (c << b); - psharedList = (SHAREDCOLOR **)ALLOCATE_LOCAL(npixShared * + psharedList = (SHAREDCOLOR **)malloc(npixShared * sizeof(SHAREDCOLOR *)); if (!psharedList) return FALSE; @@ -2193,7 +2193,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, } } } - DEALLOCATE_LOCAL(psharedList); + free(psharedList); return TRUE; } @@ -2667,7 +2667,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin) Colormap *pmaps; int imap, nummaps, found; - pmaps = (Colormap *) ALLOCATE_LOCAL( + pmaps = (Colormap *) malloc( pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!pmaps) return(FALSE); @@ -2682,7 +2682,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin) break; } } - DEALLOCATE_LOCAL(pmaps); + free(pmaps); return (found); } diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 1d09cde8c..3821d1290 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -1547,7 +1547,7 @@ ProcGetMotionEvents(ClientPtr client) { if (CompareTimeStamps(stop, currentTime) == LATER) stop = currentTime; - coords = (xTimecoord *)ALLOCATE_LOCAL(mouse->valuator->numMotionEvents + coords = (xTimecoord *)malloc(mouse->valuator->numMotionEvents * sizeof(xTimecoord)); if (!coords) return BadAlloc; @@ -1581,7 +1581,7 @@ ProcGetMotionEvents(ClientPtr client) (char *)coords); } if (coords) - DEALLOCATE_LOCAL(coords); + free(coords); return Success; } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index c8971b86c..7b2aa7b3d 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -334,7 +334,7 @@ Dispatch(void) InitSelections(); nClients = 0; - clientReady = (int *) ALLOCATE_LOCAL(sizeof(int) * MaxClients); + clientReady = (int *) malloc(sizeof(int) * MaxClients); if (!clientReady) return; @@ -439,7 +439,7 @@ Dispatch(void) ddxBeforeReset (); #endif KillAllClients(); - DEALLOCATE_LOCAL(clientReady); + free(clientReady); dispatchException &= ~DE_RESET; } @@ -830,7 +830,7 @@ ProcQueryTree(register ClientPtr client) { int curChild = 0; - childIDs = (Window *) ALLOCATE_LOCAL(numChildren * sizeof(Window)); + childIDs = (Window *) malloc(numChildren * sizeof(Window)); if (!childIDs) return BadAlloc; for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) @@ -845,7 +845,7 @@ ProcQueryTree(register ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numChildren * sizeof(Window), childIDs); - DEALLOCATE_LOCAL(childIDs); + free(childIDs); } return(client->noClientException); @@ -1336,7 +1336,7 @@ ProcQueryFont(register ClientPtr client) FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) + nprotoxcistructs * sizeof(xCharInfo); - reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength); + reply = (xQueryFontReply *)malloc(rlength); if(!reply) { return(BadAlloc); @@ -1349,7 +1349,7 @@ ProcQueryFont(register ClientPtr client) QueryFont( pFont, reply, nprotoxcistructs); WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); + free(reply); return(client->noClientException); } } @@ -2182,7 +2182,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, length += widthBytesLine; } } - if(!(pBuf = (char *) ALLOCATE_LOCAL(length))) + if(!(pBuf = (char *) malloc(length))) return (BadAlloc); memset(pBuf, 0, length); WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); @@ -2292,7 +2292,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, RegionDestroy(pVisibleRegion); #endif if (!im_return) - DEALLOCATE_LOCAL(pBuf); + free(pBuf); return (client->noClientException); } @@ -2552,7 +2552,7 @@ ProcListInstalledColormaps(register ClientPtr client) return(BadWindow); preply = (xListInstalledColormapsReply *) - ALLOCATE_LOCAL(sizeof(xListInstalledColormapsReply) + + malloc(sizeof(xListInstalledColormapsReply) + pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!preply) @@ -2567,7 +2567,7 @@ ProcListInstalledColormaps(register ClientPtr client) WriteReplyToClient(client, sizeof (xListInstalledColormapsReply), preply); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); - DEALLOCATE_LOCAL(preply); + free(preply); return(client->noClientException); } @@ -2695,7 +2695,7 @@ ProcAllocColorCells (register ClientPtr client) } nmasks = stuff->planes; length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); + ppixels = (Pixel *)malloc(length); if(!ppixels) return(BadAlloc); pmasks = ppixels + npixels; @@ -2703,7 +2703,7 @@ ProcAllocColorCells (register ClientPtr client) if( (retval = AllocColorCells(client->index, pcmp, npixels, nmasks, (Bool)stuff->contiguous, ppixels, pmasks)) ) { - DEALLOCATE_LOCAL(ppixels); + free(ppixels); if (client->noClientException != Success) return(client->noClientException); else @@ -2722,7 +2722,7 @@ ProcAllocColorCells (register ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); } - DEALLOCATE_LOCAL(ppixels); + free(ppixels); return (client->noClientException); } else @@ -2763,7 +2763,7 @@ ProcAllocColorPlanes(register ClientPtr client) acpr.sequenceNumber = client->sequence; acpr.nPixels = npixels; length = (long)npixels * sizeof(Pixel); - ppixels = (Pixel *)ALLOCATE_LOCAL(length); + ppixels = (Pixel *)malloc(length); if(!ppixels) return(BadAlloc); if( (retval = AllocColorPlanes(client->index, pcmp, npixels, @@ -2771,7 +2771,7 @@ ProcAllocColorPlanes(register ClientPtr client) (Bool)stuff->contiguous, ppixels, &acpr.redMask, &acpr.greenMask, &acpr.blueMask)) ) { - DEALLOCATE_LOCAL(ppixels); + free(ppixels); if (client->noClientException != Success) return(client->noClientException); else @@ -2786,7 +2786,7 @@ ProcAllocColorPlanes(register ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); } - DEALLOCATE_LOCAL(ppixels); + free(ppixels); return (client->noClientException); } else @@ -2915,13 +2915,13 @@ ProcQueryColors(register ClientPtr client) xQueryColorsReply qcr; count = ((client->req_len << 2) - sizeof(xQueryColorsReq)) >> 2; - prgbs = (xrgb *)ALLOCATE_LOCAL(count * sizeof(xrgb)); + prgbs = (xrgb *)malloc(count * sizeof(xrgb)); if(!prgbs && count) return(BadAlloc); memset(prgbs, 0, count * sizeof(xrgb)); if( (retval = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs)) ) { - if (prgbs) DEALLOCATE_LOCAL(prgbs); + if (prgbs) free(prgbs); if (client->noClientException != Success) return(client->noClientException); else @@ -2942,7 +2942,7 @@ ProcQueryColors(register ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); } - if (prgbs) DEALLOCATE_LOCAL(prgbs); + if (prgbs) free(prgbs); return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index c8e5f6cf0..782aa251b 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -793,7 +793,7 @@ finish: reply.nFonts = nnames; reply.sequenceNumber = client->sequence; - bufptr = bufferStart = (char *) ALLOCATE_LOCAL(reply.length << 2); + bufptr = bufferStart = (char *) malloc(reply.length << 2); if (!bufptr && reply.length) { SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc); @@ -818,7 +818,7 @@ finish: client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); WriteToClient(client, stringLens + nnames, bufferStart); - DEALLOCATE_LOCAL(bufferStart); + free(bufferStart); bail: if (c->slept) @@ -1861,7 +1861,7 @@ SetDefaultFontPath(char *path) /* get enough for string, plus values -- use up commas */ len = strlen(temp_path) + 1; - nump = cp = newpath = (unsigned char *) ALLOCATE_LOCAL(len); + nump = cp = newpath = (unsigned char *) malloc(len); if (!newpath) { free(temp_path); return BadAlloc; @@ -1884,7 +1884,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); - DEALLOCATE_LOCAL(newpath); + free(newpath); free(temp_path); return err; diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index be4409cf7..a1701281d 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -358,7 +358,7 @@ ProcListExtensions(ClientPtr client) total_length += strlen(extensions[i]->aliases[j]) + 1; } reply.length = (total_length + 3) >> 2; - buffer = bufptr = (char *)ALLOCATE_LOCAL(total_length); + buffer = bufptr = (char *)malloc(total_length); if (!buffer) return(BadAlloc); for (i=0; i<NumExtensions; i++) @@ -384,7 +384,7 @@ ProcListExtensions(ClientPtr client) if (reply.length) { WriteToClient(client, total_length, buffer); - DEALLOCATE_LOCAL(buffer); + free(buffer); } return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c index 04a571eb8..0068676c2 100644 --- a/nx-X11/programs/Xserver/dix/grabs.c +++ b/nx-X11/programs/Xserver/dix/grabs.c @@ -321,16 +321,16 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) i++; if (!i) return TRUE; - deletes = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); - adds = (GrabPtr *)ALLOCATE_LOCAL(i * sizeof(GrabPtr)); - updates = (Mask ***)ALLOCATE_LOCAL(i * sizeof(Mask **)); - details = (Mask **)ALLOCATE_LOCAL(i * sizeof(Mask *)); + deletes = (GrabPtr *)malloc(i * sizeof(GrabPtr)); + adds = (GrabPtr *)malloc(i * sizeof(GrabPtr)); + updates = (Mask ***)malloc(i * sizeof(Mask **)); + details = (Mask **)malloc(i * sizeof(Mask *)); if (!deletes || !adds || !updates || !details) { - if (details) DEALLOCATE_LOCAL(details); - if (updates) DEALLOCATE_LOCAL(updates); - if (adds) DEALLOCATE_LOCAL(adds); - if (deletes) DEALLOCATE_LOCAL(deletes); + if (details) free(details); + if (updates) free(updates); + if (adds) free(adds); + if (deletes) free(deletes); return FALSE; } ndels = nadds = nups = 0; @@ -425,10 +425,10 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab) *updates[i] = details[i]; } } - DEALLOCATE_LOCAL(details); - DEALLOCATE_LOCAL(updates); - DEALLOCATE_LOCAL(adds); - DEALLOCATE_LOCAL(deletes); + free(details); + free(updates); + free(adds); + free(deletes); return ok; #undef UPDATE diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 211c4cce2..66c38f56c 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -111,7 +111,7 @@ ProcRotateProperties(ClientPtr client) if (!stuff->nAtoms) return(Success); atoms = (Atom *) & stuff[1]; - props = (PropertyPtr *)ALLOCATE_LOCAL(stuff->nAtoms * sizeof(PropertyPtr)); + props = (PropertyPtr *)malloc(stuff->nAtoms * sizeof(PropertyPtr)); if (!props) return(BadAlloc); for (i = 0; i < stuff->nAtoms; i++) @@ -126,21 +126,21 @@ ProcRotateProperties(ClientPtr client) #endif ) { - DEALLOCATE_LOCAL(props); + free(props); client->errorValue = atoms[i]; return BadAtom; } #ifdef XCSECURITY if (SecurityIgnoreOperation == action) { - DEALLOCATE_LOCAL(props); + free(props); return Success; } #endif for (j = i + 1; j < stuff->nAtoms; j++) if (atoms[j] == atoms[i]) { - DEALLOCATE_LOCAL(props); + free(props); return BadMatch; } pProp = wUserProps (pWin); @@ -150,7 +150,7 @@ ProcRotateProperties(ClientPtr client) goto found; pProp = pProp->next; } - DEALLOCATE_LOCAL(props); + free(props); return BadMatch; found: props[i] = pProp; @@ -181,7 +181,7 @@ found: props[i]->propertyName = atoms[(i + delta) % stuff->nAtoms]; } } - DEALLOCATE_LOCAL(props); + free(props); return Success; } @@ -630,7 +630,7 @@ ProcListProperties(ClientPtr client) numProps++; } if (numProps) - if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) + if(!(pAtoms = (Atom *)malloc(numProps * sizeof(Atom)))) return(BadAlloc); memset(&xlpr, 0, sizeof(xListPropertiesReply)); @@ -650,7 +650,7 @@ ProcListProperties(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); - DEALLOCATE_LOCAL(pAtoms); + free(pAtoms); } return(client->noClientException); } diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index d22b0cdd0..8d2b612d7 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -470,13 +470,13 @@ RebuildTable(int client) */ j = 2 * clientTable[client].buckets; - tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); + tails = (ResourcePtr **)malloc(j * sizeof(ResourcePtr *)); if (!tails) return; resources = (ResourcePtr *)malloc(j * sizeof(ResourcePtr)); if (!resources) { - DEALLOCATE_LOCAL(tails); + free(tails); return; } for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) @@ -499,7 +499,7 @@ RebuildTable(int client) *tptr = &res->next; } } - DEALLOCATE_LOCAL(tails); + free(tails); clientTable[client].buckets *= 2; free(clientTable[client].resources); clientTable[client].resources = resources; diff --git a/nx-X11/programs/Xserver/dix/swaprep.c b/nx-X11/programs/Xserver/dix/swaprep.c index 62122e3a4..74dae817d 100644 --- a/nx-X11/programs/Xserver/dix/swaprep.c +++ b/nx-X11/programs/Xserver/dix/swaprep.c @@ -98,7 +98,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) CARD32 tmpbuf[1]; /* Allocate as big a buffer as we can... */ - while (!(pbufT = (CARD32 *) ALLOCATE_LOCAL(bufsize))) + while (!(pbufT = (CARD32 *) malloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) @@ -130,7 +130,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) } if (pbufT != tmpbuf) - DEALLOCATE_LOCAL ((char *) pbufT); + free ((char *) pbufT); } /** @@ -146,7 +146,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) short tmpbuf[2]; /* Allocate as big a buffer as we can... */ - while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize))) + while (!(pbufT = (short *) malloc(bufsize))) { bufsize >>= 1; if (bufsize == 4) @@ -178,7 +178,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) } if (pbufT != tmpbuf) - DEALLOCATE_LOCAL ((char *) pbufT); + free ((char *) pbufT); } @@ -1137,7 +1137,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { char *pInfoTBase; - pInfoTBase = (char *) ALLOCATE_LOCAL(size); + pInfoTBase = (char *) malloc(size); if (!pInfoTBase) { pClient->noClientException = -1; @@ -1145,7 +1145,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) } SwapConnSetupInfo(pInfo, pInfoTBase); WriteToClient(pClient, (int)size, pInfoTBase); - DEALLOCATE_LOCAL(pInfoTBase); + free(pInfoTBase); } void |