aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxcmds.c2
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glximports.c12
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxscreens.c6
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxutil.c12
-rw-r--r--nx-X11/programs/Xserver/GL/glx/unpack.h2
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c2
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/extmod/modinit.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiX.c38
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiXprocs.c30
-rw-r--r--nx-X11/programs/Xserver/Xext/saver.c18
-rw-r--r--nx-X11/programs/Xserver/Xext/security.c30
-rw-r--r--nx-X11/programs/Xserver/Xext/shape.c12
-rw-r--r--nx-X11/programs/Xserver/Xext/shm.c12
-rw-r--r--nx-X11/programs/Xserver/Xext/sleepuntil.c6
-rw-r--r--nx-X11/programs/Xserver/Xext/sync.c42
-rw-r--r--nx-X11/programs/Xserver/Xext/xcmisc.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/xf86bigfont.c8
-rw-r--r--nx-X11/programs/Xserver/Xext/xvdisp.c6
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmain.c14
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmc.c28
-rw-r--r--nx-X11/programs/Xserver/Xi/chgkbd.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/chgptr.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/exevents.c22
-rw-r--r--nx-X11/programs/Xserver/Xi/extinit.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/getdctl.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/getfctl.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/getprop.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/getselev.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/listdev.c4
-rw-r--r--nx-X11/programs/Xserver/Xi/queryst.c4
-rw-r--r--nx-X11/programs/Xserver/composite/compalloc.c28
-rw-r--r--nx-X11/programs/Xserver/composite/compinit.c10
-rwxr-xr-xnx-X11/programs/Xserver/damageext/damageext.c6
-rw-r--r--nx-X11/programs/Xserver/dbe/dbe.c58
-rw-r--r--nx-X11/programs/Xserver/dbe/midbe.c2
-rw-r--r--nx-X11/programs/Xserver/dix/atom.c20
-rw-r--r--nx-X11/programs/Xserver/dix/colormap.c92
-rw-r--r--nx-X11/programs/Xserver/dix/cursor.c42
-rw-r--r--nx-X11/programs/Xserver/dix/devices.c92
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c26
-rw-r--r--nx-X11/programs/Xserver/dix/dixfonts.c136
-rw-r--r--nx-X11/programs/Xserver/dix/dixutils.c36
-rw-r--r--nx-X11/programs/Xserver/dix/events.c22
-rw-r--r--nx-X11/programs/Xserver/dix/extension.c36
-rw-r--r--nx-X11/programs/Xserver/dix/gc.c26
-rw-r--r--nx-X11/programs/Xserver/dix/glyphcurs.c4
-rw-r--r--nx-X11/programs/Xserver/dix/grabs.c14
-rw-r--r--nx-X11/programs/Xserver/dix/main.c30
-rw-r--r--nx-X11/programs/Xserver/dix/pixmap.c4
-rw-r--r--nx-X11/programs/Xserver/dix/privates.c16
-rw-r--r--nx-X11/programs/Xserver/dix/property.c26
-rw-r--r--nx-X11/programs/Xserver/dix/region.c32
-rw-r--r--nx-X11/programs/Xserver/dix/resource.c30
-rw-r--r--nx-X11/programs/Xserver/dix/window.c28
-rw-r--r--nx-X11/programs/Xserver/fb/fballpriv.c2
-rw-r--r--nx-X11/programs/Xserver/fb/fbcmap.c14
-rw-r--r--nx-X11/programs/Xserver/fb/fbcopy.c4
-rw-r--r--nx-X11/programs/Xserver/fb/fboverlay.c2
-rw-r--r--nx-X11/programs/Xserver/fb/fbpixmap.c4
-rw-r--r--nx-X11/programs/Xserver/fb/fbpseudocolor.c26
-rw-r--r--nx-X11/programs/Xserver/fb/fbscreen.c10
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c12
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Colormap.c36
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Cursor.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c22
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c38
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GCOps.c12
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Image.c26
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c18
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c12
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c122
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXevents.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyph.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXpicture.c20
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXproperty.c22
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c54
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXresource.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c14
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c30
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Render.c10
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Rootless.c10
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c70
-rw-r--r--nx-X11/programs/Xserver/include/os.h18
-rw-r--r--nx-X11/programs/Xserver/mi/miarc.c48
-rw-r--r--nx-X11/programs/Xserver/mi/mibank.c14
-rw-r--r--nx-X11/programs/Xserver/mi/mibitblt.c8
-rw-r--r--nx-X11/programs/Xserver/mi/mibstore.c14
-rw-r--r--nx-X11/programs/Xserver/mi/micmap.c22
-rw-r--r--nx-X11/programs/Xserver/mi/midash.c4
-rw-r--r--nx-X11/programs/Xserver/mi/midispcur.c22
-rw-r--r--nx-X11/programs/Xserver/mi/migc.c6
-rw-r--r--nx-X11/programs/Xserver/mi/mioverlay.c14
-rw-r--r--nx-X11/programs/Xserver/mi/mipointer.c4
-rw-r--r--nx-X11/programs/Xserver/mi/mipolyutil.c4
-rw-r--r--nx-X11/programs/Xserver/mi/mipushpxl.c4
-rw-r--r--nx-X11/programs/Xserver/mi/miscrinit.c4
-rw-r--r--nx-X11/programs/Xserver/mi/mispans.c76
-rw-r--r--nx-X11/programs/Xserver/mi/misprite.c6
-rw-r--r--nx-X11/programs/Xserver/mi/miwideline.c18
-rw-r--r--nx-X11/programs/Xserver/mi/miwindow.c2
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw.c4
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw_render.c6
-rwxr-xr-xnx-X11/programs/Xserver/miext/damage/damage.c8
-rw-r--r--nx-X11/programs/Xserver/os/Imakefile17
-rw-r--r--nx-X11/programs/Xserver/os/WaitFor.c6
-rw-r--r--nx-X11/programs/Xserver/os/access.c26
-rw-r--r--nx-X11/programs/Xserver/os/connection.c16
-rw-r--r--nx-X11/programs/Xserver/os/io.c48
-rw-r--r--nx-X11/programs/Xserver/os/log.c6
-rw-r--r--nx-X11/programs/Xserver/os/mitauth.c14
-rw-r--r--nx-X11/programs/Xserver/os/oscolor.c8
-rw-r--r--nx-X11/programs/Xserver/os/rpcauth.c6
-rw-r--r--nx-X11/programs/Xserver/os/utils.c177
-rw-r--r--nx-X11/programs/Xserver/os/xalloc.c817
-rw-r--r--nx-X11/programs/Xserver/os/xdmauth.c40
-rw-r--r--nx-X11/programs/Xserver/os/xdmcp.c14
-rw-r--r--nx-X11/programs/Xserver/os/xprintf.c4
-rw-r--r--nx-X11/programs/Xserver/randr/randr.c14
-rw-r--r--nx-X11/programs/Xserver/randr/rrcrtc.c62
-rw-r--r--nx-X11/programs/Xserver/randr/rrdispatch.c6
-rw-r--r--nx-X11/programs/Xserver/randr/rrinfo.c12
-rw-r--r--nx-X11/programs/Xserver/randr/rrmode.c16
-rw-r--r--nx-X11/programs/Xserver/randr/rrmonitor.c24
-rw-r--r--nx-X11/programs/Xserver/randr/rroutput.c36
-rw-r--r--nx-X11/programs/Xserver/randr/rrproperty.c34
-rw-r--r--nx-X11/programs/Xserver/randr/rrprovider.c12
-rw-r--r--nx-X11/programs/Xserver/randr/rrproviderproperty.c34
-rw-r--r--nx-X11/programs/Xserver/randr/rrscreen.c42
-rw-r--r--nx-X11/programs/Xserver/randr/rrtransform.c6
-rw-r--r--nx-X11/programs/Xserver/record/record.c40
-rw-r--r--nx-X11/programs/Xserver/record/set.c22
-rw-r--r--nx-X11/programs/Xserver/render/animcur.c6
-rw-r--r--nx-X11/programs/Xserver/render/filter.c28
-rw-r--r--nx-X11/programs/Xserver/render/glyph.c26
-rw-r--r--nx-X11/programs/Xserver/render/miindex.c10
-rw-r--r--nx-X11/programs/Xserver/render/mipict.c2
-rw-r--r--nx-X11/programs/Xserver/render/picture.c64
-rw-r--r--nx-X11/programs/Xserver/render/render.c62
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/cursor.c18
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/region.c6
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/select.c6
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxList.c8
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxLoad.c12
-rw-r--r--nx-X11/programs/Xserver/xkb/xkb.c14
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbActions.c2
154 files changed, 1491 insertions, 2464 deletions
diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c
index c62585507..7d8fbe81f 100644
--- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c
+++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c
@@ -2138,7 +2138,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
reply.length = length;
reply.n = n;
- if ((buf = (char *) Xalloc(length << 2)) == NULL) {
+ if ((buf = (char *) malloc(length << 2)) == NULL) {
return BadAlloc;
}
__glXStrncpy(buf, ptr, n);
diff --git a/nx-X11/programs/Xserver/GL/glx/glximports.c b/nx-X11/programs/Xserver/GL/glx/glximports.c
index 435caca58..f966ca4df 100644
--- a/nx-X11/programs/Xserver/GL/glx/glximports.c
+++ b/nx-X11/programs/Xserver/GL/glx/glximports.c
@@ -50,7 +50,7 @@ void *__glXImpMalloc(__GLcontext *gc, size_t size)
if (size == 0) {
return NULL;
}
- addr = xalloc(size);
+ addr = malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
@@ -67,7 +67,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
return NULL;
}
size = numElements * elementSize;
- addr = xalloc(size);
+ addr = malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
@@ -81,7 +81,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
void __glXImpFree(__GLcontext *gc, void *addr)
{
if (addr) {
- xfree(addr);
+ free(addr);
}
}
@@ -91,15 +91,15 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
if (addr) {
if (newSize == 0) {
- xfree(addr);
+ free(addr);
return NULL;
}
- newAddr = xrealloc(addr, newSize);
+ newAddr = realloc(addr, newSize);
} else {
if (newSize == 0) {
return NULL;
}
- newAddr = xalloc(newSize);
+ newAddr = malloc(newSize);
}
if (newAddr == NULL) {
return NULL; /* XXX: out of memory error */
diff --git a/nx-X11/programs/Xserver/GL/glx/glxscreens.c b/nx-X11/programs/Xserver/GL/glx/glxscreens.c
index 58b38b1a2..1cbc0baf7 100644
--- a/nx-X11/programs/Xserver/GL/glx/glxscreens.c
+++ b/nx-X11/programs/Xserver/GL/glx/glxscreens.c
@@ -366,9 +366,9 @@ void __glXScreenReset(void)
__glXFree(__glXActiveScreens[i].GLXextensions);
__glXFree(__glXActiveScreens[i].GLextensions);
}
- xfree(__glXActiveScreens);
- xfree(__glXHyperpipeFuncs);
- xfree(__glXSwapBarrierFuncs);
+ free(__glXActiveScreens);
+ free(__glXHyperpipeFuncs);
+ free(__glXSwapBarrierFuncs);
__glXNumHyperpipeFuncs = 0;
__glXNumSwapBarrierFuncs = 0;
__glXHyperpipeFuncs = NULL;
diff --git a/nx-X11/programs/Xserver/GL/glx/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c
index 03bc19f63..b95a21f89 100644
--- a/nx-X11/programs/Xserver/GL/glx/glxutil.c
+++ b/nx-X11/programs/Xserver/GL/glx/glxutil.c
@@ -68,7 +68,7 @@ __glXMalloc(size_t size)
if (size == 0) {
return NULL;
}
- addr = (void *) xalloc(size);
+ addr = (void *) malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
@@ -86,7 +86,7 @@ __glXCalloc(size_t numElements, size_t elementSize)
return NULL;
}
size = numElements * elementSize;
- addr = (void *) xalloc(size);
+ addr = (void *) malloc(size);
if (addr == NULL) {
/* XXX: handle out of memory error */
return NULL;
@@ -102,16 +102,16 @@ __glXRealloc(void *addr, size_t newSize)
if (addr) {
if (newSize == 0) {
- xfree(addr);
+ free(addr);
return NULL;
} else {
- newAddr = xrealloc(addr, newSize);
+ newAddr = realloc(addr, newSize);
}
} else {
if (newSize == 0) {
return NULL;
} else {
- newAddr = xalloc(newSize);
+ newAddr = malloc(newSize);
}
}
if (newAddr == NULL) {
@@ -125,7 +125,7 @@ void
__glXFree(void *addr)
{
if (addr) {
- xfree(addr);
+ free(addr);
}
}
diff --git a/nx-X11/programs/Xserver/GL/glx/unpack.h b/nx-X11/programs/Xserver/GL/glx/unpack.h
index 94bdae8f9..d1150c32b 100644
--- a/nx-X11/programs/Xserver/GL/glx/unpack.h
+++ b/nx-X11/programs/Xserver/GL/glx/unpack.h
@@ -93,7 +93,7 @@ extern xGLXSingleReply __glXReply;
else if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
- (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
+ (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
(size)+(align)); \
if (!(cl)->returnBuf) { \
return BadAlloc; \
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c
index 19b5be637..6ec2164ba 100644
--- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c
@@ -516,7 +516,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
/* Free the private list created by DDX HW driver */
if (visualPrivates)
- xfree(visualPrivates);
+ free(visualPrivates);
visualPrivates = NULL;
return TRUE;
diff --git a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c
index 1889bdabd..057acb6d3 100644
--- a/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c
+++ b/nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c
@@ -52,7 +52,7 @@ XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height, char *data
{
XMesaImage *image;
- image = (XMesaImage *)xalloc(sizeof(XMesaImage));
+ image = (XMesaImage *)malloc(sizeof(XMesaImage));
if (image) {
image->width = width;
@@ -70,7 +70,7 @@ void XMesaDestroyImage(XMesaImage *image)
{
if (image->data)
free(image->data);
- xfree(image);
+ free(image);
}
unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c
index 6969148a3..5224a8ad9 100644
--- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c
+++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c
@@ -161,13 +161,13 @@ extmodSetup(void * module, void * opts, int *errmaj, int *errmin)
for (i = 0; extensionModules[i].name != NULL; i++) {
if (opts) {
char *s;
- s = (char *)xalloc(strlen(extensionModules[i].name) + 5);
+ s = (char *)malloc(strlen(extensionModules[i].name) + 5);
if (s) {
void * o;
strcpy(s, "omit");
strcat(s, extensionModules[i].name);
o = xf86FindOption(opts, s);
- xfree(s);
+ free(s);
if (o) {
xf86MarkOptionUsed(o);
continue;
diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c
index a1bfa91d6..c00d003a5 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiX.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiX.c
@@ -165,7 +165,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
if (pScreen->myNum == 0)
RegionUninit(&PanoramiXScreenRegion);
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -337,7 +337,7 @@ XineramaDestroyClip(GCPtr pGC)
int
XineramaDeleteResource(void * data, XID id)
{
- xfree(data);
+ free(data);
return 1;
}
@@ -420,7 +420,7 @@ XineramaRegisterConnectionBlockCallback(void (*func)(void))
{
XineramaConnectionCallbackList *newlist;
- if(!(newlist = xalloc(sizeof(XineramaConnectionCallbackList))))
+ if(!(newlist = malloc(sizeof(XineramaConnectionCallbackList))))
return FALSE;
newlist->next = ConnectionCallbackList;
@@ -525,7 +525,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
*/
panoramiXdataPtr = (PanoramiXData *)
- xcalloc(PanoramiXNumScreens, sizeof(PanoramiXData));
+ calloc(PanoramiXNumScreens, sizeof(PanoramiXData));
BREAK_IF(!panoramiXdataPtr);
BREAK_IF((PanoramiXGCIndex = AllocateGCPrivateIndex()) < 0);
@@ -539,7 +539,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
return;
}
- pScreenPriv = xalloc(sizeof(PanoramiXScreenRec));
+ pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
pScreen->devPrivates[PanoramiXScreenIndex].ptr =
(void *)pScreenPriv;
if(!pScreenPriv) {
@@ -727,10 +727,10 @@ Bool PanoramiXCreateConnectionBlock(void)
connSetupPrefix.length = length >> 2;
- xfree(PanoramiXVisuals);
+ free(PanoramiXVisuals);
for (i = 0; i < PanoramiXNumDepths; i++)
- xfree(PanoramiXDepths[i].vids);
- xfree(PanoramiXDepths);
+ free(PanoramiXDepths[i].vids);
+ free(PanoramiXDepths);
/*
* OK, change some dimensions so it looks as if it were one big screen
@@ -752,7 +752,7 @@ Bool PanoramiXCreateConnectionBlock(void)
tmp = (void *)ConnectionCallbackList;
(*ConnectionCallbackList->func)();
ConnectionCallbackList = ConnectionCallbackList->next;
- xfree(tmp);
+ free(tmp);
}
return TRUE;
@@ -769,16 +769,16 @@ void PanoramiXConsolidate(void)
Bool foundDepth, missingDepth;
if(!PanoramiXVisualTable)
- PanoramiXVisualTable = xcalloc(256 * MAXSCREENS, sizeof(XID));
+ PanoramiXVisualTable = calloc(256 * MAXSCREENS, sizeof(XID));
pScreen = screenInfo.screens[0];
pVisual = pScreen->visuals;
pDepth = pScreen->allowedDepths;
PanoramiXNumDepths = 0;
- PanoramiXDepths = xcalloc(pScreen->numDepths,sizeof(DepthRec));
+ PanoramiXDepths = calloc(pScreen->numDepths,sizeof(DepthRec));
PanoramiXNumVisuals = 0;
- PanoramiXVisuals = xcalloc(pScreen->numVisuals,sizeof(VisualRec));
+ PanoramiXVisuals = calloc(pScreen->numVisuals,sizeof(VisualRec));
for (i = 0; i < pScreen->numDepths; i++, pDepth++) {
missingDepth = FALSE;
@@ -805,7 +805,7 @@ void PanoramiXConsolidate(void)
PanoramiXDepths[PanoramiXNumDepths].numVids = 0;
if(pDepth->numVids)
PanoramiXDepths[PanoramiXNumDepths].vids =
- xalloc(sizeof(VisualID) * pDepth->numVids);
+ malloc(sizeof(VisualID) * pDepth->numVids);
else
PanoramiXDepths[PanoramiXNumDepths].vids = NULL;
PanoramiXNumDepths++;
@@ -887,11 +887,11 @@ void PanoramiXConsolidate(void)
}
- root = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
+ root = (PanoramiXRes *) malloc(sizeof(PanoramiXRes));
root->type = XRT_WINDOW;
- defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
+ defmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes));
defmap->type = XRT_COLORMAP;
- saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
+ saver = (PanoramiXRes *) malloc(sizeof(PanoramiXRes));
saver->type = XRT_WINDOW;
@@ -927,7 +927,7 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry)
for (i = 256; i--; )
ProcVector[i] = SavedProcVector[i];
- Xfree(panoramiXdataPtr);
+ free(panoramiXdataPtr);
}
@@ -1217,7 +1217,7 @@ XineramaGetImageData(
if(sizeNeeded > size) {
char *tmpdata = ScratchMem;
- ScratchMem = xrealloc(ScratchMem, sizeNeeded);
+ ScratchMem = realloc(ScratchMem, sizeNeeded);
if(ScratchMem)
size = sizeNeeded;
else {
@@ -1292,7 +1292,7 @@ XineramaGetImageData(
}
if(ScratchMem)
- xfree(ScratchMem);
+ free(ScratchMem);
RegionUninit(&SrcRegion);
RegionUninit(&GrabRegion);
diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
index b4719d76f..36ebfac21 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
@@ -130,7 +130,7 @@ int PanoramiXCreateWindow(ClientPtr client)
}
}
- if(!(newWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newWin = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newWin->type = XRT_WINDOW;
@@ -170,7 +170,7 @@ int PanoramiXCreateWindow(ClientPtr client)
if (result == Success)
AddResource(newWin->info[0].id, XRT_WINDOW, newWin);
else
- xfree(newWin);
+ free(newWin);
return (result);
}
@@ -660,7 +660,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess)))
return BadDrawable;
- if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
@@ -679,7 +679,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
if (result == Success)
AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
else
- xfree(newPix);
+ free(newPix);
return (result);
}
@@ -760,7 +760,7 @@ int PanoramiXCreateGC(ClientPtr client)
}
}
- if(!(newGC = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newGC = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newGC->type = XRT_GC;
@@ -784,7 +784,7 @@ int PanoramiXCreateGC(ClientPtr client)
if (result == Success)
AddResource(newGC->info[0].id, XRT_GC, newGC);
else
- xfree(newGC);
+ free(newGC);
return (result);
}
@@ -1036,7 +1036,7 @@ int PanoramiXCopyArea(ClientPtr client)
VERIFY_DRAWABLE(drawables[j], src->info[j].id, client);
pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
- if(!(data = xcalloc(1, stuff->height * pitch)))
+ if(!(data = calloc(1, stuff->height * pitch)))
return BadAlloc;
XineramaGetImageData(drawables, srcx, srcy,
@@ -1049,7 +1049,7 @@ int PanoramiXCopyArea(ClientPtr client)
if(drawables[0]->depth != pDst->depth) {
client->errorValue = stuff->dstDrawable;
- xfree(data);
+ free(data);
return (BadMatch);
}
@@ -1060,7 +1060,7 @@ int PanoramiXCopyArea(ClientPtr client)
if(dstShared) break;
}
- xfree(data);
+ free(data);
result = Success;
} else {
@@ -1844,7 +1844,7 @@ int PanoramiXGetImage(ClientPtr client)
linesPerBuf = h;
}
length = linesPerBuf * widthBytesLine;
- if(!(pBuf = xalloc(length)))
+ if(!(pBuf = malloc(length)))
return (BadAlloc);
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
@@ -1890,7 +1890,7 @@ int PanoramiXGetImage(ClientPtr client)
}
}
}
- xfree(pBuf);
+ free(pBuf);
return (client->noClientException);
}
@@ -2072,7 +2072,7 @@ int PanoramiXCreateColormap(ClientPtr client)
if(!stuff->visual || (stuff->visual > 255))
return BadValue;
- if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
@@ -2092,7 +2092,7 @@ int PanoramiXCreateColormap(ClientPtr client)
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
else
- xfree(newCmap);
+ free(newCmap);
return (result);
}
@@ -2141,7 +2141,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
SecurityReadAccess | SecurityWriteAccess)))
return BadColor;
- if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
@@ -2159,7 +2159,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
else
- xfree(newCmap);
+ free(newCmap);
return (result);
}
diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c
index 81f502189..f9a86899f 100644
--- a/nx-X11/programs/Xserver/Xext/saver.c
+++ b/nx-X11/programs/Xserver/Xext/saver.c
@@ -218,7 +218,7 @@ static int ScreenPrivateIndex;
#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (void *) v);
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
-#define New(t) ((t *) xalloc (sizeof (t)))
+#define New(t) ((t *) malloc (sizeof (t)))
/****************
* ScreenSaverExtensionInit
@@ -274,7 +274,7 @@ CheckScreenPrivate (pScreen)
if (!pPriv->attr && !pPriv->events &&
!pPriv->hasWindow && pPriv->installedMap == None)
{
- xfree (pPriv);
+ free (pPriv);
SetScreenPrivate (pScreen, NULL);
savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
}
@@ -340,7 +340,7 @@ setEventMask (pScreen, client, mask)
{
FreeResource (pEv->resource, EventType);
*pPrev = pEv->next;
- xfree (pEv);
+ free (pEv);
CheckScreenPrivate (pScreen);
}
else
@@ -386,8 +386,8 @@ FreeScreenAttr (pAttr)
ScreenSaverAttrPtr pAttr;
{
FreeAttrs (pAttr);
- xfree (pAttr->values);
- xfree (pAttr);
+ free (pAttr->values);
+ free (pAttr);
}
static int
@@ -408,7 +408,7 @@ ScreenSaverFreeEvents (value, id)
if (!pEv)
return TRUE;
*pPrev = pEv->next;
- xfree (pEv);
+ free (pEv);
CheckScreenPrivate (pScreen);
return TRUE;
}
@@ -939,7 +939,7 @@ ScreenSaverSetAttributes (ClientPtr client)
goto bail;
}
/* over allocate for override redirect */
- values = (unsigned long *) xalloc ((len + 1) * sizeof (unsigned long));
+ values = (unsigned long *) malloc ((len + 1) * sizeof (unsigned long));
if (!values)
{
ret = BadAlloc;
@@ -1172,8 +1172,8 @@ PatchUp:
FreeAttrs (pAttr);
bail:
CheckScreenPrivate (pScreen);
- if (pAttr) xfree (pAttr->values);
- xfree (pAttr);
+ if (pAttr) free (pAttr->values);
+ free (pAttr);
return ret;
}
diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c
index 096b88d20..a68cbf998 100644
--- a/nx-X11/programs/Xserver/Xext/security.c
+++ b/nx-X11/programs/Xserver/Xext/security.c
@@ -331,7 +331,7 @@ SecurityDeleteAuthorization(
}
SecurityAudit("revoked authorization ID %d\n", pAuth->id);
- xfree(pAuth);
+ free(pAuth);
return Success;
} /* SecurityDeleteAuthorization */
@@ -356,7 +356,7 @@ SecurityDeleteAuthorizationEventClient(
prev->next = pEventClient->next;
else
pAuth->eventClients = pEventClient->next;
- xfree(pEventClient);
+ free(pEventClient);
return(Success);
}
prev = pEventClient;
@@ -524,7 +524,7 @@ SecurityEventSelectForAuthorization(
}
}
- pEventClient = (OtherClients *) xalloc(sizeof(OtherClients));
+ pEventClient = (OtherClients *) malloc(sizeof(OtherClients));
if (!pEventClient)
return BadAlloc;
pEventClient->mask = mask;
@@ -533,7 +533,7 @@ SecurityEventSelectForAuthorization(
if (!AddResource(pEventClient->resource, RTEventClient,
(void *)pAuth))
{
- xfree(pEventClient);
+ free(pEventClient);
return BadAlloc;
}
pAuth->eventClients = pEventClient;
@@ -662,7 +662,7 @@ ProcSecurityGenerateAuthorization(
/* associate additional information with this auth ID */
- pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec));
+ pAuth = (SecurityAuthorizationPtr)malloc(sizeof(SecurityAuthorizationRec));
if (!pAuth)
{
err = BadAlloc;
@@ -734,7 +734,7 @@ bailout:
if (removeAuth)
RemoveAuthorization(stuff->nbytesAuthProto, protoname,
authdata_len, pAuthdata);
- if (pAuth) xfree(pAuth);
+ if (pAuth) free(pAuth);
return err;
} /* ProcSecurityGenerateAuthorization */
@@ -1486,7 +1486,7 @@ SecurityFreePropertyAccessList(void)
{
PropertyAccessPtr freeit = PropertyAccessList;
PropertyAccessList = PropertyAccessList->next;
- xfree(freeit);
+ free(freeit);
}
} /* SecurityFreePropertyAccessList */
@@ -1643,14 +1643,14 @@ SecurityParsePropertyAccessRule(
*/
if (mustHaveValue)
size += strlen(mustHaveValue) + 1;
- pacl = (PropertyAccessPtr)Xalloc(size);
+ pacl = (PropertyAccessPtr)malloc(size);
if (!pacl)
return FALSE;
pacl->name = MakeAtom(propname, strlen(propname), TRUE);
if (pacl->name == BAD_RESOURCE)
{
- Xfree(pacl);
+ free(pacl);
return FALSE;
}
if (mustHaveProperty)
@@ -1659,7 +1659,7 @@ SecurityParsePropertyAccessRule(
strlen(mustHaveProperty), TRUE);
if (pacl->mustHaveProperty == BAD_RESOURCE)
{
- Xfree(pacl);
+ free(pacl);
return FALSE;
}
}
@@ -1716,15 +1716,15 @@ SecurityParseSitePolicy(
if (!policyStr)
return FALSE;
- copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1);
+ copyPolicyStr = (char *)malloc(strlen(policyStr) + 1);
if (!copyPolicyStr)
return TRUE;
strcpy(copyPolicyStr, policyStr);
- newStrings = (char **)Xrealloc(SecurityPolicyStrings,
+ newStrings = (char **)realloc(SecurityPolicyStrings,
sizeof (char *) * (nSecurityPolicyStrings + 1));
if (!newStrings)
{
- Xfree(copyPolicyStr);
+ free(copyPolicyStr);
return TRUE;
}
@@ -1752,9 +1752,9 @@ SecurityFreeSitePolicyStrings(void)
assert(nSecurityPolicyStrings);
while (nSecurityPolicyStrings--)
{
- Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]);
+ free(SecurityPolicyStrings[nSecurityPolicyStrings]);
}
- Xfree(SecurityPolicyStrings);
+ free(SecurityPolicyStrings);
SecurityPolicyStrings = NULL;
nSecurityPolicyStrings = 0;
}
diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c
index b272f1bbe..b929dded0 100644
--- a/nx-X11/programs/Xserver/Xext/shape.c
+++ b/nx-X11/programs/Xserver/Xext/shape.c
@@ -796,7 +796,7 @@ ShapeFreeClient (data, id)
*pHead = pShapeEvent->next;
}
}
- xfree ((void *) pShapeEvent);
+ free ((void *) pShapeEvent);
return 1;
}
@@ -812,9 +812,9 @@ ShapeFreeEvents (data, id)
for (pCur = *pHead; pCur; pCur = pNext) {
pNext = pCur->next;
FreeResource (pCur->clientResource, ClientType);
- xfree ((void *) pCur);
+ free ((void *) pCur);
}
- xfree ((void *) pHead);
+ free ((void *) pHead);
return 1;
}
@@ -849,7 +849,7 @@ ProcShapeSelectInput (client)
/* build the entry */
pNewShapeEvent = (ShapeEventPtr)
- xalloc (sizeof (ShapeEventRec));
+ malloc (sizeof (ShapeEventRec));
if (!pNewShapeEvent)
return BadAlloc;
pNewShapeEvent->next = 0;
@@ -871,7 +871,7 @@ ProcShapeSelectInput (client)
*/
if (!pHead)
{
- pHead = (ShapeEventPtr *) xalloc (sizeof (ShapeEventPtr));
+ pHead = (ShapeEventPtr *) malloc (sizeof (ShapeEventPtr));
if (!pHead ||
!AddResource (pWin->drawable.id, EventType, (void *)pHead))
{
@@ -898,7 +898,7 @@ ProcShapeSelectInput (client)
pNewShapeEvent->next = pShapeEvent->next;
else
*pHead = pShapeEvent->next;
- xfree (pShapeEvent);
+ free (pShapeEvent);
}
}
break;
diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c
index 83d6eaaab..af529e46f 100644
--- a/nx-X11/programs/Xserver/Xext/shm.c
+++ b/nx-X11/programs/Xserver/Xext/shm.c
@@ -439,7 +439,7 @@ ProcShmAttach(client)
}
else
{
- shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec));
+ shmdesc = (ShmDescPtr) malloc(sizeof(ShmDescRec));
if (!shmdesc)
return BadAlloc;
shmdesc->addr = shmat(stuff->shmid, 0,
@@ -447,7 +447,7 @@ ProcShmAttach(client)
if ((shmdesc->addr == ((char *)-1)) ||
shmctl(stuff->shmid, IPC_STAT, &buf))
{
- xfree(shmdesc);
+ free(shmdesc);
return BadAccess;
}
@@ -457,7 +457,7 @@ ProcShmAttach(client)
if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) {
shmdt(shmdesc->addr);
- xfree(shmdesc);
+ free(shmdesc);
return BadAccess;
}
@@ -488,7 +488,7 @@ ShmDetachSegment(value, shmseg)
for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next)
;
*prev = shmdesc->next;
- xfree(shmdesc);
+ free(shmdesc);
return Success;
}
@@ -779,7 +779,7 @@ CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
- if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
@@ -820,7 +820,7 @@ CreatePmap:
(*pScreen->DestroyPixmap)(pMap);
FreeResource(newPix->info[j].id, RT_NONE);
}
- xfree(newPix);
+ free(newPix);
} else
AddResource(stuff->pid, XRT_PIXMAP, newPix);
diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c
index 62f946cf8..93d75a862 100644
--- a/nx-X11/programs/Xserver/Xext/sleepuntil.c
+++ b/nx-X11/programs/Xserver/Xext/sleepuntil.c
@@ -98,7 +98,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure)
SertafiedGeneration = serverGeneration;
BlockHandlerRegistered = FALSE;
}
- pRequest = (SertafiedPtr) xalloc (sizeof (SertafiedRec));
+ pRequest = (SertafiedPtr) malloc (sizeof (SertafiedRec));
if (!pRequest)
return FALSE;
pRequest->pClient = client;
@@ -111,7 +111,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure)
SertafiedWakeupHandler,
(void *) 0))
{
- xfree (pRequest);
+ free (pRequest);
return FALSE;
}
BlockHandlerRegistered = TRUE;
@@ -169,7 +169,7 @@ SertafiedDelete (value, id)
}
if (pRequest->notifyFunc)
(*pRequest->notifyFunc) (pRequest->pClient, pRequest->closure);
- xfree (pRequest);
+ free (pRequest);
return TRUE;
}
diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c
index f79cc1b23..aab85666e 100644
--- a/nx-X11/programs/Xserver/Xext/sync.c
+++ b/nx-X11/programs/Xserver/Xext/sync.c
@@ -319,7 +319,7 @@ SyncDeleteTriggerFromCounter(pTrigger)
pPrev->next = pCur->next;
else
pTrigger->pCounter->pTriglist = pCur->next;
- xfree(pCur);
+ free(pCur);
break;
}
}
@@ -345,7 +345,7 @@ SyncAddTriggerToCounter(pTrigger)
return Success;
}
- if (!(pCur = (SyncTriggerList *)xalloc(sizeof(SyncTriggerList))))
+ if (!(pCur = (SyncTriggerList *)malloc(sizeof(SyncTriggerList))))
return BadAlloc;
pCur->pTrigger = pTrigger;
@@ -879,7 +879,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents)
/* add new client to pAlarm->pEventClients */
- pClients = (SyncAlarmClientList *) xalloc(sizeof(SyncAlarmClientList));
+ pClients = (SyncAlarmClientList *) malloc(sizeof(SyncAlarmClientList));
if (!pClients)
return BadAlloc;
@@ -890,7 +890,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents)
pClients->delete_id = FakeClientID(client->index);
if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm))
{
- xfree(pClients);
+ free(pClients);
return BadAlloc;
}
@@ -1014,12 +1014,12 @@ SyncCreateCounter(client, id, initialvalue)
{
SyncCounter *pCounter;
- if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter))))
+ if (!(pCounter = (SyncCounter *) malloc(sizeof(SyncCounter))))
return (SyncCounter *)NULL;
if (!AddResource(id, RTCounter, (void *) pCounter))
{
- xfree((void *) pCounter);
+ free((void *) pCounter);
return (SyncCounter *)NULL;
}
@@ -1058,7 +1058,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType,
{
SyncCounter *pCounter;
- SysCounterList = (SyncCounter **)xrealloc(SysCounterList,
+ SysCounterList = (SyncCounter **)realloc(SysCounterList,
(SyncNumSystemCounters+1)*sizeof(SyncCounter *));
if (!SysCounterList)
return (void *)NULL;
@@ -1081,7 +1081,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType,
{
SysCounterInfo *psci;
- psci = (SysCounterInfo *)xalloc(sizeof(SysCounterInfo));
+ psci = (SysCounterInfo *)malloc(sizeof(SysCounterInfo));
if (!psci)
{
FreeResource(pCounter->id, RT_NONE);
@@ -1214,7 +1214,7 @@ FreeAlarm(addr, id)
SyncDeleteTriggerFromCounter(&pAlarm->trigger);
- xfree(pAlarm);
+ free(pAlarm);
return Success;
}
@@ -1237,13 +1237,13 @@ FreeCounter(env, id)
{
(*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
pnext = ptl->next;
- xfree(ptl); /* destroy the trigger list as we go */
+ free(ptl); /* destroy the trigger list as we go */
}
if (IsSystemCounter(pCounter))
{
int i, found = 0;
- xfree(pCounter->pSysCounterInfo);
+ free(pCounter->pSysCounterInfo);
/* find the counter in the list of system counters and remove it */
@@ -1267,7 +1267,7 @@ FreeCounter(env, id)
}
SyncNumSystemCounters--;
}
- xfree(pCounter);
+ free(pCounter);
return Success;
}
@@ -1298,7 +1298,7 @@ FreeAwait(addr, id)
if (pCounter && !pCounter->beingDestroyed)
SyncDeleteTriggerFromCounter(&pAwait->trigger);
}
- xfree(pAwaitUnion);
+ free(pAwaitUnion);
return Success;
}
@@ -1321,7 +1321,7 @@ FreeAlarmClient(value, id)
pPrev->next = pCur->next;
else
pAlarm->pEventClients = pCur->next;
- xfree(pCur);
+ free(pCur);
return(Success);
}
}
@@ -1670,7 +1670,7 @@ ProcSyncAwait(client)
/* all the memory for the entire await list is allocated
* here in one chunk
*/
- pAwaitUnion = (SyncAwaitUnion *)xalloc((items+1) * sizeof(SyncAwaitUnion));
+ pAwaitUnion = (SyncAwaitUnion *)malloc((items+1) * sizeof(SyncAwaitUnion));
if (!pAwaitUnion)
return BadAlloc;
@@ -1679,7 +1679,7 @@ ProcSyncAwait(client)
pAwaitUnion->header.delete_id = FakeClientID(client->index);
if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion))
{
- xfree(pAwaitUnion);
+ free(pAwaitUnion);
return BadAlloc;
}
@@ -1821,7 +1821,7 @@ ProcSyncCreateAlarm(client)
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
return BadLength;
- if (!(pAlarm = (SyncAlarm *) xalloc(sizeof(SyncAlarm))))
+ if (!(pAlarm = (SyncAlarm *) malloc(sizeof(SyncAlarm))))
{
return BadAlloc;
}
@@ -1838,7 +1838,7 @@ ProcSyncCreateAlarm(client)
status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger);
if (status != Success)
{
- xfree(pAlarm);
+ free(pAlarm);
return status;
}
@@ -1852,13 +1852,13 @@ ProcSyncCreateAlarm(client)
(CARD32 *)&stuff[1]);
if (status != Success)
{
- xfree(pAlarm);
+ free(pAlarm);
return status;
}
if (!AddResource(stuff->id, RTAlarm, pAlarm))
{
- xfree(pAlarm);
+ free(pAlarm);
return BadAlloc;
}
@@ -2346,7 +2346,7 @@ static void
SyncResetProc(extEntry)
ExtensionEntry *extEntry;
{
- xfree(SysCounterList);
+ free(SysCounterList);
SysCounterList = NULL;
RTCounter = 0;
}
diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c
index ee7d69fc3..7021ed47e 100644
--- a/nx-X11/programs/Xserver/Xext/xcmisc.c
+++ b/nx-X11/programs/Xserver/Xext/xcmisc.c
@@ -154,7 +154,7 @@ ProcXCMiscGetXIDList(client)
if (stuff->count > UINT32_MAX / sizeof(XID))
return BadAlloc;
- pids = (XID *)Xalloc(stuff->count * sizeof(XID));
+ pids = (XID *)malloc(stuff->count * sizeof(XID));
if (!pids)
{
return BadAlloc;
@@ -175,7 +175,7 @@ ProcXCMiscGetXIDList(client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
}
- Xfree(pids);
+ free(pids);
return(client->noClientException);
}
diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c
index 848f0114b..a89005cde 100644
--- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c
+++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c
@@ -248,7 +248,7 @@ shmalloc(
if (size < 3500)
return (ShmDescPtr) NULL;
- pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec));
+ pDesc = (ShmDescRec *) malloc(sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
@@ -257,7 +257,7 @@ shmalloc(
if (shmid == -1) {
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n",
size, errno);
- xfree(pDesc);
+ free(pDesc);
return (ShmDescPtr) NULL;
}
@@ -265,7 +265,7 @@ shmalloc(
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n",
size, errno);
shmctl(shmid, IPC_RMID, (void *) 0);
- xfree(pDesc);
+ free(pDesc);
return (ShmDescPtr) NULL;
}
@@ -294,7 +294,7 @@ shmdealloc(
if (pDesc->next) pDesc->next->prev = pDesc->prev;
*pDesc->prev = pDesc->next;
- xfree(pDesc);
+ free(pDesc);
}
#endif
diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c
index 3bcb130c7..e9250427d 100644
--- a/nx-X11/programs/Xserver/Xext/xvdisp.c
+++ b/nx-X11/programs/Xserver/Xext/xvdisp.c
@@ -1258,7 +1258,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
num_planes = pImage->num_planes;
- if(!(offsets = xalloc(num_planes << 3)))
+ if(!(offsets = malloc(num_planes << 3)))
return BadAlloc;
pitches = offsets + num_planes;
@@ -1281,7 +1281,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
SwapLongs((CARD32*)offsets, rep.length);
WriteToClient(client, rep.length << 2, (char*)offsets);
- xfree(offsets);
+ free(offsets);
return Success;
}
@@ -2223,7 +2223,7 @@ void XineramifyXv(void)
/* now create a resource for each port */
for(j = 0; j < refAdapt->nPorts; j++) {
- if(!(port = xalloc(sizeof(PanoramiXRes))))
+ if(!(port = malloc(sizeof(PanoramiXRes))))
break;
port->info[0].id = MatchingAdaptors[0]->base_id + j;
AddResource(port->info[0].id, XvXRTPort, port);
diff --git a/nx-X11/programs/Xserver/Xext/xvmain.c b/nx-X11/programs/Xserver/Xext/xvmain.c
index 571bb9c46..8a279ac1e 100644
--- a/nx-X11/programs/Xserver/Xext/xvmain.c
+++ b/nx-X11/programs/Xserver/Xext/xvmain.c
@@ -288,7 +288,7 @@ XvScreenInit(ScreenPtr pScreen)
/* ALLOCATE SCREEN PRIVATE RECORD */
- pxvs = (XvScreenPtr) xalloc (sizeof (XvScreenRec));
+ pxvs = (XvScreenPtr) malloc (sizeof (XvScreenRec));
if (!pxvs)
{
ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
@@ -325,7 +325,7 @@ XvCloseScreen(
(* pxvs->ddCloseScreen)(ii, pScreen);
- xfree(pxvs);
+ free(pxvs);
pScreen->devPrivates[XvScreenIndex].ptr = (void *)NULL;
@@ -522,7 +522,7 @@ XvdiDestroyVideoNotifyList(void * pn, XID id)
{
npn = cpn->next;
if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify);
- xfree(cpn);
+ free(cpn);
cpn = npn;
}
return Success;
@@ -941,12 +941,12 @@ XvdiSelectVideoNotify(
if (!pn)
{
- if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
+ if (!(tpn = (XvVideoNotifyPtr)malloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = (XvVideoNotifyPtr)NULL;
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
{
- xfree(tpn);
+ free(tpn);
return BadAlloc;
}
}
@@ -979,7 +979,7 @@ XvdiSelectVideoNotify(
}
else
{
- if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
+ if (!(tpn = (XvVideoNotifyPtr)malloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = pn->next;
pn->next = tpn;
@@ -1037,7 +1037,7 @@ XvdiSelectPortNotify(
if (!tpn)
{
- if (!(tpn = (XvPortNotifyPtr)xalloc(sizeof(XvPortNotifyRec))))
+ if (!(tpn = (XvPortNotifyPtr)malloc(sizeof(XvPortNotifyRec))))
return BadAlloc;
tpn->next = pPort->pNotify;
pPort->pNotify = tpn;
diff --git a/nx-X11/programs/Xserver/Xext/xvmc.c b/nx-X11/programs/Xserver/Xext/xvmc.c
index b1441fa1d..bce7fbf7a 100644
--- a/nx-X11/programs/Xserver/Xext/xvmc.c
+++ b/nx-X11/programs/Xserver/Xext/xvmc.c
@@ -75,7 +75,7 @@ XvMCDestroyContextRes(void * data, XID id)
if(!pContext->refcnt) {
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext);
- xfree(pContext);
+ free(pContext);
}
return Success;
@@ -89,7 +89,7 @@ XvMCDestroySurfaceRes(void * data, XID id)
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface);
- xfree(pSurface);
+ free(pSurface);
XvMCDestroyContextRes((void *)pContext, pContext->context_id);
@@ -105,7 +105,7 @@ XvMCDestroySubpictureRes(void * data, XID id)
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict);
- xfree(pSubpict);
+ free(pSubpict);
XvMCDestroyContextRes((void *)pContext, pContext->context_id);
@@ -242,7 +242,7 @@ ProcXvMCCreateContext(ClientPtr client)
(stuff->height > surface->max_height))
return BadValue;
- if(!(pContext = xalloc(sizeof(XvMCContextRec)))) {
+ if(!(pContext = malloc(sizeof(XvMCContextRec)))) {
return BadAlloc;
}
@@ -259,7 +259,7 @@ ProcXvMCCreateContext(ClientPtr client)
result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data);
if(result != Success) {
- xfree(pContext);
+ free(pContext);
return result;
}
@@ -276,7 +276,7 @@ ProcXvMCCreateContext(ClientPtr client)
AddResource(pContext->context_id, XvMCRTContext, pContext);
if(data)
- xfree(data);
+ free(data);
return Success;
}
@@ -313,7 +313,7 @@ ProcXvMCCreateSurface(ClientPtr client)
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
- if(!(pSurface = xalloc(sizeof(XvMCSurfaceRec))))
+ if(!(pSurface = malloc(sizeof(XvMCSurfaceRec))))
return BadAlloc;
pSurface->surface_id = stuff->surface_id;
@@ -324,7 +324,7 @@ ProcXvMCCreateSurface(ClientPtr client)
pSurface, &dwords, &data);
if(result != Success) {
- xfree(pSurface);
+ free(pSurface);
return result;
}
@@ -338,7 +338,7 @@ ProcXvMCCreateSurface(ClientPtr client)
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
if(data)
- xfree(data);
+ free(data);
pContext->refcnt++;
@@ -408,7 +408,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
(stuff->height > surface->subpicture_max_height))
return BadValue;
- if(!(pSubpicture = xalloc(sizeof(XvMCSubpictureRec))))
+ if(!(pSubpicture = malloc(sizeof(XvMCSubpictureRec))))
return BadAlloc;
pSubpicture->subpicture_id = stuff->subpicture_id;
@@ -427,7 +427,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
pSubpicture, &dwords, &data);
if(result != Success) {
- xfree(pSubpicture);
+ free(pSubpicture);
return result;
}
@@ -449,7 +449,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
if(data)
- xfree(data);
+ free(data);
pContext->refcnt++;
@@ -708,7 +708,7 @@ XvMCCloseScreen (int i, ScreenPtr pScreen)
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- xfree(pScreenPriv);
+ free(pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
@@ -726,7 +726,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
XvMCGeneration = serverGeneration;
}
- if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
+ if(!(pScreenPriv = (XvMCScreenPtr)malloc(sizeof(XvMCScreenRec))))
return BadAlloc;
pScreen->devPrivates[XvMCScreenIndex].ptr = (void *)pScreenPriv;
diff --git a/nx-X11/programs/Xserver/Xi/chgkbd.c b/nx-X11/programs/Xserver/Xi/chgkbd.c
index 136d257c6..0cf8a1c87 100644
--- a/nx-X11/programs/Xserver/Xi/chgkbd.c
+++ b/nx-X11/programs/Xserver/Xi/chgkbd.c
@@ -168,7 +168,7 @@ ProcXChangeKeyboardDevice (client)
if (df->traceSize != xf->traceSize)
{
Must_have_memory = TRUE; /* XXX */
- df->trace = (WindowPtr *) xrealloc(df->trace,
+ df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize * sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
diff --git a/nx-X11/programs/Xserver/Xi/chgptr.c b/nx-X11/programs/Xserver/Xi/chgptr.c
index 4877fcc84..2bbd7bc37 100644
--- a/nx-X11/programs/Xserver/Xi/chgptr.c
+++ b/nx-X11/programs/Xserver/Xi/chgptr.c
@@ -185,8 +185,8 @@ void
DeleteFocusClassDeviceStruct(dev)
DeviceIntPtr dev;
{
- xfree(dev->focus->trace);
- xfree(dev->focus);
+ free(dev->focus->trace);
+ free(dev->focus);
dev->focus = NULL;
}
diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c
index ce5fe9ec9..85abd4fee 100644
--- a/nx-X11/programs/Xserver/Xi/exevents.c
+++ b/nx-X11/programs/Xserver/Xi/exevents.c
@@ -302,7 +302,7 @@ InitProximityClassDeviceStruct( DeviceIntPtr dev)
{
register ProximityClassPtr proxc;
- proxc = (ProximityClassPtr)xalloc(sizeof(ProximityClassRec));
+ proxc = (ProximityClassPtr)malloc(sizeof(ProximityClassRec));
if (!proxc)
return FALSE;
dev->proximity = proxc;
@@ -460,7 +460,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
}
}
- sev = ev = (deviceStateNotify *) xalloc(evcount * sizeof(xEvent));
+ sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent));
FixDeviceStateNotify (dev, ev, NULL, NULL, NULL, first);
if (b != NULL) {
@@ -515,7 +515,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
(void) DeliverEventsToWindow(pWin, (xEvent *)sev, evcount,
DeviceStateNotifyMask, NullGrab, dev->id);
- xfree (sev);
+ free (sev);
}
}
@@ -741,7 +741,7 @@ AddExtensionClient (pWin, client, mask, mskidx)
if (!pWin->optional && !MakeWindowOptional (pWin))
return BadAlloc;
- others = (InputClients *) xalloc(sizeof(InputClients));
+ others = (InputClients *) malloc(sizeof(InputClients));
if (!others)
return BadAlloc;
if (!pWin->optional->inputMasks && !MakeInputMasks (pWin))
@@ -763,7 +763,7 @@ MakeInputMasks (pWin)
struct _OtherInputMasks *imasks;
imasks = (struct _OtherInputMasks *)
- xalloc (sizeof (struct _OtherInputMasks));
+ malloc (sizeof (struct _OtherInputMasks));
if (!imasks)
return FALSE;
bzero((char *) imasks, sizeof (struct _OtherInputMasks));
@@ -830,17 +830,17 @@ InputClientGone(pWin, id)
if (prev)
{
prev->next = other->next;
- xfree(other);
+ free(other);
}
else if (!(other->next))
{
if (ShouldFreeInputMasks(pWin, TRUE))
{
wOtherInputMasks(pWin)->inputClients = other->next;
- xfree(wOtherInputMasks(pWin));
+ free(wOtherInputMasks(pWin));
pWin->optional->inputMasks = (OtherInputMasks *) NULL;
CheckWindowOptionalNeed (pWin);
- xfree(other);
+ free(other);
}
else
{
@@ -853,7 +853,7 @@ InputClientGone(pWin, id)
else
{
wOtherInputMasks(pWin)->inputClients = other->next;
- xfree(other);
+ free(other);
}
RecalculateDeviceDeliverableEvents(pWin);
return(Success);
@@ -1027,12 +1027,12 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
* list of keycodes.
*/
if (inputMapLen) {
- map = (KeyCode *)xalloc(inputMapLen);
+ map = (KeyCode *)malloc(inputMapLen);
if (!map)
return BadAlloc;
}
if ((*k)->modifierKeyMap)
- xfree((*k)->modifierKeyMap);
+ free((*k)->modifierKeyMap);
if (inputMapLen) {
(*k)->modifierKeyMap = map;
memmove((char *)(*k)->modifierKeyMap, (char *)inputMap, inputMapLen);
diff --git a/nx-X11/programs/Xserver/Xi/extinit.c b/nx-X11/programs/Xserver/Xi/extinit.c
index 81f5ca551..d74ac5dc7 100644
--- a/nx-X11/programs/Xserver/Xi/extinit.c
+++ b/nx-X11/programs/Xserver/Xi/extinit.c
@@ -872,7 +872,7 @@ AssignTypeAndName (dev, type, name)
char *name;
{
dev->type = type;
- dev->name = (char *) xalloc(strlen(name)+1);
+ dev->name = (char *) malloc(strlen(name)+1);
strcpy (dev->name, name);
}
diff --git a/nx-X11/programs/Xserver/Xi/getdctl.c b/nx-X11/programs/Xserver/Xi/getdctl.c
index d8c310d92..1161e5aef 100644
--- a/nx-X11/programs/Xserver/Xi/getdctl.c
+++ b/nx-X11/programs/Xserver/Xi/getdctl.c
@@ -139,7 +139,7 @@ ProcXGetDeviceControl(client)
return Success;
}
- buf = (char *) xalloc (total_length);
+ buf = (char *) malloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
@@ -161,7 +161,7 @@ ProcXGetDeviceControl(client)
rep.length = (total_length+3) >> 2;
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
+ free (savbuf);
return Success;
}
diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c
index c6cb8457c..bc92784d3 100644
--- a/nx-X11/programs/Xserver/Xi/getfctl.c
+++ b/nx-X11/programs/Xserver/Xi/getfctl.c
@@ -165,7 +165,7 @@ ProcXGetFeedbackControl(client)
return Success;
}
- buf = (char *) xalloc (total_length);
+ buf = (char *) malloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0,
@@ -190,7 +190,7 @@ ProcXGetFeedbackControl(client)
rep.length = (total_length+3) >> 2;
WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
+ free (savbuf);
return Success;
}
diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c
index ac37617ec..42403b0e5 100644
--- a/nx-X11/programs/Xserver/Xi/getprop.c
+++ b/nx-X11/programs/Xserver/Xi/getprop.c
@@ -137,7 +137,7 @@ ProcXGetDeviceDontPropagateList (client)
if (count)
{
rep.count = count;
- buf = (XEventClass *) xalloc (rep.count * sizeof(XEventClass));
+ buf = (XEventClass *) malloc (rep.count * sizeof(XEventClass));
rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2;
tbuf = buf;
@@ -154,7 +154,7 @@ ProcXGetDeviceDontPropagateList (client)
{
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
- xfree (buf);
+ free (buf);
}
return Success;
}
diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c
index 7cd97b5ef..8abea78d4 100644
--- a/nx-X11/programs/Xserver/Xi/getselev.c
+++ b/nx-X11/programs/Xserver/Xi/getselev.c
@@ -149,7 +149,7 @@ ProcXGetSelectedExtensionEvents(client)
total_length = (rep.all_clients_count + rep.this_client_count) *
sizeof (XEventClass);
rep.length = (total_length + 3) >> 2;
- buf = (XEventClass *) xalloc (total_length);
+ buf = (XEventClass *) malloc (total_length);
tclient = buf;
aclient = buf + rep.this_client_count;
@@ -168,7 +168,7 @@ ProcXGetSelectedExtensionEvents(client)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient( client, total_length, buf);
- xfree (buf);
+ free (buf);
}
return Success;
}
diff --git a/nx-X11/programs/Xserver/Xi/listdev.c b/nx-X11/programs/Xserver/Xi/listdev.c
index e99584d0e..7f3b49e89 100644
--- a/nx-X11/programs/Xserver/Xi/listdev.c
+++ b/nx-X11/programs/Xserver/Xi/listdev.c
@@ -129,7 +129,7 @@ ProcXListInputDevices (client)
SizeDeviceInfo (d, &namesize, &size);
total_length = numdevs * sizeof (xDeviceInfo) + size + namesize;
- devbuf = (char *) xcalloc (1, total_length);
+ devbuf = (char *) calloc (1, total_length);
classbuf = devbuf + (numdevs * sizeof (xDeviceInfo));
namebuf = classbuf + size;
savbuf = devbuf;
@@ -144,7 +144,7 @@ ProcXListInputDevices (client)
rep.length = (total_length + 3) >> 2;
WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep);
WriteToClient(client, total_length, savbuf);
- xfree (savbuf);
+ free (savbuf);
return Success;
}
diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c
index af2b4301d..a590aa0e1 100644
--- a/nx-X11/programs/Xserver/Xi/queryst.c
+++ b/nx-X11/programs/Xserver/Xi/queryst.c
@@ -135,7 +135,7 @@ ProcXQueryDeviceState(client)
(v->numAxes * sizeof(int)));
num_classes++;
}
- buf = (char *) xalloc (total_length);
+ buf = (char *) malloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
@@ -190,7 +190,7 @@ ProcXQueryDeviceState(client)
WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep);
if (total_length > 0)
WriteToClient (client, total_length, savbuf);
- xfree (savbuf);
+ free (savbuf);
return Success;
}
diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c
index 017459b6b..e24c490d2 100644
--- a/nx-X11/programs/Xserver/composite/compalloc.c
+++ b/nx-X11/programs/Xserver/composite/compalloc.c
@@ -146,7 +146,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
* The client *could* allocate multiple, but while supported,
* it is not expected to be common
*/
- ccw = xalloc (sizeof (CompClientWindowRec));
+ ccw = malloc (sizeof (CompClientWindowRec));
if (!ccw)
return BadAlloc;
ccw->id = FakeClientID (pClient->index);
@@ -156,10 +156,10 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
*/
if (!cw)
{
- cw = xalloc (sizeof (CompWindowRec));
+ cw = malloc (sizeof (CompWindowRec));
if (!cw)
{
- xfree (ccw);
+ free (ccw);
return BadAlloc;
}
cw->damage = DamageCreate (compReportDamage,
@@ -170,8 +170,8 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
pWin);
if (!cw->damage)
{
- xfree (ccw);
- xfree (cw);
+ free (ccw);
+ free (cw);
return BadAlloc;
}
@@ -269,7 +269,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
*prev = ccw->next;
if (ccw->update == CompositeRedirectManual)
cw->update = CompositeRedirectAutomatic;
- xfree (ccw);
+ free (ccw);
break;
}
}
@@ -288,7 +288,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
RegionUninit(&cw->borderClip);
FAKE_DIX_SET_WINDOW_PRIVATE(pWin, NULL);
- xfree (cw);
+ free (cw);
}
else if (cw->update == CompositeRedirectAutomatic &&
!cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone)
@@ -355,7 +355,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
* The client *could* allocate multiple, but while supported,
* it is not expected to be common
*/
- ccw = xalloc (sizeof (CompClientWindowRec));
+ ccw = malloc (sizeof (CompClientWindowRec));
if (!ccw)
return BadAlloc;
ccw->id = FakeClientID (pClient->index);
@@ -365,10 +365,10 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
*/
if (!csw)
{
- csw = xalloc (sizeof (CompSubwindowsRec));
+ csw = malloc (sizeof (CompSubwindowsRec));
if (!csw)
{
- xfree (ccw);
+ free (ccw);
return BadAlloc;
}
csw->update = CompositeRedirectAutomatic;
@@ -387,10 +387,10 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
(void) compUnredirectWindow (pClient, pChild, update);
if (!csw->clients)
{
- xfree (csw);
+ free (csw);
FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL);
}
- xfree (ccw);
+ free (ccw);
return ret;
}
}
@@ -451,7 +451,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id)
for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
(void) compUnredirectWindow (pClient, pChild, ccw->update);
- xfree (ccw);
+ free (ccw);
break;
}
}
@@ -462,7 +462,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id)
if (!csw->clients)
{
FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL);
- xfree (csw);
+ free (csw);
}
}
diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c
index c86aaed5a..27b54468f 100644
--- a/nx-X11/programs/Xserver/composite/compinit.c
+++ b/nx-X11/programs/Xserver/composite/compinit.c
@@ -76,7 +76,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->GetSpans = cs->GetSpans;
pScreen->SourceValidate = cs->SourceValidate;
- xfree (cs);
+ free (cs);
FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, NULL);
ret = (*pScreen->CloseScreen) (index, pScreen);
return ret;
@@ -230,7 +230,7 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals)
p = reallocarray(cs->alternateVisuals,
cs->numAlternateVisuals + nVisuals, sizeof(VisualID));
#else
- p = xrealloc(cs->alternateVisuals,
+ p = realloc(cs->alternateVisuals,
sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
#endif
if (p == NULL)
@@ -265,7 +265,7 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
p = reallocarray(cs->implicitRedirectExceptions,
cs->numImplicitRedirectExceptions + 1, sizeof(p[0]));
#else
- p = xrealloc(cs->implicitRedirectExceptions,
+ p = realloc(cs->implicitRedirectExceptions,
sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1));
#endif
if (p == NULL)
@@ -405,7 +405,7 @@ compScreenInit (ScreenPtr pScreen)
if (GetCompScreen (pScreen))
return TRUE;
- cs = (CompScreenPtr) xalloc (sizeof (CompScreenRec));
+ cs = (CompScreenPtr) malloc (sizeof (CompScreenRec));
if (!cs)
return FALSE;
@@ -422,7 +422,7 @@ compScreenInit (ScreenPtr pScreen)
if (!compAddAlternateVisuals (pScreen, cs))
{
- xfree (cs);
+ free (cs);
return FALSE;
}
diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c
index d14f14985..88858f621 100755
--- a/nx-X11/programs/Xserver/damageext/damageext.c
+++ b/nx-X11/programs/Xserver/damageext/damageext.c
@@ -199,7 +199,7 @@ ProcDamageCreate (ClientPtr client)
return BadValue;
}
- pDamageExt = xalloc (sizeof (DamageExtRec));
+ pDamageExt = malloc (sizeof (DamageExtRec));
if (!pDamageExt)
return BadAlloc;
pDamageExt->id = stuff->damage;
@@ -214,7 +214,7 @@ ProcDamageCreate (ClientPtr client)
pDamageExt);
if (!pDamageExt->pDamage)
{
- xfree (pDamageExt);
+ free (pDamageExt);
return BadAlloc;
}
if (!AddResource (stuff->damage, DamageExtType, (void *) pDamageExt))
@@ -412,7 +412,7 @@ FreeDamageExt (void * value, XID did)
DamageUnregister (pDamageExt->pDrawable, pDamageExt->pDamage);
DamageDestroy (pDamageExt->pDamage);
}
- xfree (pDamageExt);
+ free (pDamageExt);
return Success;
}
diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c
index 064987dec..5687f3d56 100644
--- a/nx-X11/programs/Xserver/dbe/dbe.c
+++ b/nx-X11/programs/Xserver/dbe/dbe.c
@@ -176,7 +176,7 @@ DbeAllocWinPriv(pScreen)
register int i;
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
- pDbeWindowPriv = (DbeWindowPrivPtr)xalloc(pDbeScreenPriv->totalWinPrivSize);
+ pDbeWindowPriv = (DbeWindowPrivPtr)malloc(pDbeScreenPriv->totalWinPrivSize);
if (pDbeWindowPriv)
{
@@ -268,7 +268,7 @@ DbeAllocWinPrivPriv(pScreen, index, amount)
if (index >= pDbeScreenPriv->winPrivPrivLen)
{
unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pDbeScreenPriv->winPrivPrivSizes,
+ nsizes = (unsigned *)realloc(pDbeScreenPriv->winPrivPrivSizes,
(index + 1) * sizeof(unsigned));
if (!nsizes)
{
@@ -476,7 +476,7 @@ ProcDbeAllocateBackBufferName(client)
}
/* Free what was allocated by the GetVisualInfo() call above. */
- xfree(scrVisInfo.visinfo);
+ free(scrVisInfo.visinfo);
if (!visualMatched)
{
@@ -499,7 +499,7 @@ ProcDbeAllocateBackBufferName(client)
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
(void *)pDbeWindowPriv))
{
- xfree(pDbeWindowPriv);
+ free(pDbeWindowPriv);
return(BadAlloc);
}
@@ -564,7 +564,7 @@ ProcDbeAllocateBackBufferName(client)
}
/* malloc/realloc a new array and initialize all elements to 0. */
- pDbeWindowPriv->IDs = (XID *)xrealloc(pIDs,
+ pDbeWindowPriv->IDs = (XID *)realloc(pIDs,
(pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID));
if (!pDbeWindowPriv->IDs)
{
@@ -610,7 +610,7 @@ ProcDbeAllocateBackBufferName(client)
/* The DDX buffer allocation routine failed for the first buffer of
* this window.
*/
- xfree(pDbeWindowPriv);
+ free(pDbeWindowPriv);
return(status);
}
@@ -746,7 +746,7 @@ ProcDbeSwapBuffers(client)
dbeSwapInfo = (xDbeSwapInfo *)&stuff[1];
/* Allocate array to record swap information. */
- swapInfo = (DbeSwapInfoPtr)Xalloc(nStuff * sizeof(DbeSwapInfoRec));
+ swapInfo = (DbeSwapInfoPtr)malloc(nStuff * sizeof(DbeSwapInfoRec));
if (swapInfo == NULL)
{
return(BadAlloc);
@@ -761,14 +761,14 @@ ProcDbeSwapBuffers(client)
if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
SecurityWriteAccess)))
{
- Xfree(swapInfo);
+ free(swapInfo);
return(BadWindow);
}
/* Each window must be double-buffered - BadMatch. */
if (DBE_WINDOW_PRIV(pWin) == NULL)
{
- Xfree(swapInfo);
+ free(swapInfo);
return(BadMatch);
}
@@ -777,7 +777,7 @@ ProcDbeSwapBuffers(client)
{
if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
{
- Xfree(swapInfo);
+ free(swapInfo);
return(BadMatch);
}
}
@@ -788,7 +788,7 @@ ProcDbeSwapBuffers(client)
(dbeSwapInfo[i].swapAction != XdbeUntouched ) &&
(dbeSwapInfo[i].swapAction != XdbeCopied ))
{
- Xfree(swapInfo);
+ free(swapInfo);
return(BadValue);
}
@@ -818,12 +818,12 @@ ProcDbeSwapBuffers(client)
error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo);
if (error != Success)
{
- Xfree(swapInfo);
+ free(swapInfo);
return(error);
}
}
- Xfree(swapInfo);
+ free(swapInfo);
return(Success);
} /* ProcDbeSwapBuffers() */
@@ -912,7 +912,7 @@ ProcDbeGetVisualInfo(client)
/* Make sure any specified drawables are valid. */
if (stuff->n != 0)
{
- if (!(pDrawables = (DrawablePtr *)Xalloc(stuff->n *
+ if (!(pDrawables = (DrawablePtr *)malloc(stuff->n *
sizeof(DrawablePtr))))
{
return(BadAlloc);
@@ -925,19 +925,19 @@ ProcDbeGetVisualInfo(client)
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
drawables[i], client, SecurityReadAccess)))
{
- Xfree(pDrawables);
+ free(pDrawables);
return(BadDrawable);
}
}
}
count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n;
- if (!(pScrVisInfo = (XdbeScreenVisualInfo *)xalloc(count *
+ if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count *
sizeof(XdbeScreenVisualInfo))))
{
if (pDrawables)
{
- Xfree(pDrawables);
+ free(pDrawables);
}
return(BadAlloc);
@@ -958,13 +958,13 @@ ProcDbeGetVisualInfo(client)
/* Free visinfos that we allocated for previous screen infos.*/
for (j = 0; j < i; j++)
{
- xfree(pScrVisInfo[j].visinfo);
+ free(pScrVisInfo[j].visinfo);
}
/* Free pDrawables if we needed to allocate it above. */
if (pDrawables)
{
- Xfree(pDrawables);
+ free(pDrawables);
}
return(BadAlloc);
@@ -1039,13 +1039,13 @@ ProcDbeGetVisualInfo(client)
/* Clean up memory. */
for (i = 0; i < count; i++)
{
- xfree(pScrVisInfo[i].visinfo);
+ free(pScrVisInfo[i].visinfo);
}
- xfree(pScrVisInfo);
+ free(pScrVisInfo);
if (pDrawables)
{
- Xfree(pDrawables);
+ free(pDrawables);
}
return(client->noClientException);
@@ -1640,7 +1640,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id)
DBE_INIT_MAX_IDS * sizeof(XID));
/* Free the extended array; use the static array. */
- xfree(pDbeWindowPriv->IDs);
+ free(pDbeWindowPriv->IDs);
pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs;
pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
}
@@ -1671,7 +1671,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id)
(void *)NULL;
/* We are done with the window priv. */
- xfree(pDbeWindowPriv);
+ free(pDbeWindowPriv);
}
return(Success);
@@ -1719,10 +1719,10 @@ DbeResetProc(extEntry)
if (pDbeScreenPriv->winPrivPrivSizes)
{
- xfree(pDbeScreenPriv->winPrivPrivSizes);
+ free(pDbeScreenPriv->winPrivPrivSizes);
}
- xfree(pDbeScreenPriv);
+ free(pDbeScreenPriv);
}
}
@@ -1874,7 +1874,7 @@ DbeExtensionInit()
if (!AllocateWindowPrivate(pScreen, dbeWindowPrivIndex, 0) ||
!(pDbeScreenPriv =
- (DbeScreenPrivPtr)Xcalloc(sizeof(DbeScreenPrivRec))))
+ (DbeScreenPrivPtr)calloc(1, sizeof(DbeScreenPrivRec))))
{
/* If we can not alloc a window or screen private,
* then free any privates that we already alloc'ed and return
@@ -1882,7 +1882,7 @@ DbeExtensionInit()
for (j = 0; j < i; j++)
{
- xfree(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr);
+ free(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr);
screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr = NULL;
}
return;
@@ -1986,7 +1986,7 @@ DbeExtensionInit()
for (i = 0; i < screenInfo.numScreens; i++)
{
- xfree(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr);
+ free(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr);
pScreen->devPrivates[dbeScreenPrivIndex].ptr = NULL;
}
return;
diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c
index b8383e11a..c83b42771 100644
--- a/nx-X11/programs/Xserver/dbe/midbe.c
+++ b/nx-X11/programs/Xserver/dbe/midbe.c
@@ -115,7 +115,7 @@ miDbeGetVisualInfo(pScreen, pScrVisInfo)
}
/* Allocate an array of XdbeVisualInfo items. */
- if (!(visInfo = (XdbeVisualInfo *)xalloc(count * sizeof(XdbeVisualInfo))))
+ if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo))))
{
return(FALSE); /* memory alloc failure */
}
diff --git a/nx-X11/programs/Xserver/dix/atom.c b/nx-X11/programs/Xserver/dix/atom.c
index 29e60be03..6a1f17854 100644
--- a/nx-X11/programs/Xserver/dix/atom.c
+++ b/nx-X11/programs/Xserver/dix/atom.c
@@ -109,7 +109,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
{
register NodePtr nd;
- nd = (NodePtr) xalloc(sizeof(NodeRec));
+ nd = (NodePtr) malloc(sizeof(NodeRec));
if (!nd)
return BAD_RESOURCE;
if (lastAtom < XA_LAST_PREDEFINED)
@@ -118,9 +118,9 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
}
else
{
- nd->string = (char *) xalloc(len + 1);
+ nd->string = (char *) malloc(len + 1);
if (!nd->string) {
- xfree(nd);
+ free(nd);
return BAD_RESOURCE;
}
strncpy(nd->string, string, (int)len);
@@ -129,12 +129,12 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
- table = (NodePtr *) xrealloc(nodeTable,
+ table = (NodePtr *) realloc(nodeTable,
tableLength * (2 * sizeof(NodePtr)));
if (!table) {
if (nd->string != string)
- xfree(nd->string);
- xfree(nd);
+ free(nd->string);
+ free(nd);
return BAD_RESOURCE;
}
tableLength <<= 1;
@@ -180,8 +180,8 @@ FreeAtom(NodePtr patom)
if(patom->right)
FreeAtom(patom->right);
if (patom->a > XA_LAST_PREDEFINED)
- xfree(patom->string);
- xfree(patom);
+ free(patom->string);
+ free(patom);
}
void
@@ -191,7 +191,7 @@ FreeAllAtoms()
return;
FreeAtom(atomRoot);
atomRoot = (NodePtr)NULL;
- xfree(nodeTable);
+ free(nodeTable);
nodeTable = (NodePtr *)NULL;
lastAtom = None;
}
@@ -201,7 +201,7 @@ InitAtoms()
{
FreeAllAtoms();
tableLength = InitialTableSize;
- nodeTable = (NodePtr *)xalloc(InitialTableSize*sizeof(NodePtr));
+ nodeTable = (NodePtr *)malloc(InitialTableSize*sizeof(NodePtr));
if (!nodeTable)
AtomError();
nodeTable[None] = (NodePtr)NULL;
diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c
index 4acfdc1bb..44095b729 100644
--- a/nx-X11/programs/Xserver/dix/colormap.c
+++ b/nx-X11/programs/Xserver/dix/colormap.c
@@ -274,7 +274,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if ((class | DynamicClass) == DirectColor)
sizebytes *= 3;
sizebytes += sizeof(ColormapRec);
- pmap = (ColormapPtr) xalloc(sizebytes);
+ pmap = (ColormapPtr) malloc(sizebytes);
if (!pmap)
return (BadAlloc);
pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec));
@@ -303,10 +303,10 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--)
pent->refcnt = AllocPrivate;
pmap->freeRed = 0;
- ppix = (Pixel *)xalloc(size * sizeof(Pixel));
+ ppix = (Pixel *)malloc(size * sizeof(Pixel));
if (!ppix)
{
- xfree(pmap);
+ free(pmap);
return (BadAlloc);
}
pmap->clientPixelsRed[client] = ppix;
@@ -349,11 +349,11 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for(pent = &pmap->green[size-1]; pent >= pmap->green; pent--)
pent->refcnt = AllocPrivate;
pmap->freeGreen = 0;
- ppix = (Pixel *) xalloc(size * sizeof(Pixel));
+ ppix = (Pixel *) malloc(size * sizeof(Pixel));
if (!ppix)
{
- xfree(pmap->clientPixelsRed[client]);
- xfree(pmap);
+ free(pmap->clientPixelsRed[client]);
+ free(pmap);
return(BadAlloc);
}
pmap->clientPixelsGreen[client] = ppix;
@@ -365,12 +365,12 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for(pent = &pmap->blue[size-1]; pent >= pmap->blue; pent--)
pent->refcnt = AllocPrivate;
pmap->freeBlue = 0;
- ppix = (Pixel *) xalloc(size * sizeof(Pixel));
+ ppix = (Pixel *) malloc(size * sizeof(Pixel));
if (!ppix)
{
- xfree(pmap->clientPixelsGreen[client]);
- xfree(pmap->clientPixelsRed[client]);
- xfree(pmap);
+ free(pmap->clientPixelsGreen[client]);
+ free(pmap->clientPixelsRed[client]);
+ free(pmap);
return(BadAlloc);
}
pmap->clientPixelsBlue[client] = ppix;
@@ -395,7 +395,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap->devPrivates = NULL;
else
{
- pmap->devPrivates = (DevUnion *) xcalloc (
+ pmap->devPrivates = (DevUnion *) calloc (
sizeof(DevUnion), colormapPrivateCount);
if (!pmap->devPrivates)
{
@@ -438,7 +438,7 @@ FreeColormap (void * value, XID mid)
if(pmap->clientPixelsRed)
{
for(i = 0; i < MAXCLIENTS; i++)
- xfree(pmap->clientPixelsRed[i]);
+ free(pmap->clientPixelsRed[i]);
}
if ((pmap->class == PseudoColor) || (pmap->class == GrayScale))
@@ -450,11 +450,11 @@ FreeColormap (void * value, XID mid)
if(pent->fShared)
{
if (--pent->co.shco.red->refcnt == 0)
- xfree(pent->co.shco.red);
+ free(pent->co.shco.red);
if (--pent->co.shco.green->refcnt == 0)
- xfree(pent->co.shco.green);
+ free(pent->co.shco.green);
if (--pent->co.shco.blue->refcnt == 0)
- xfree(pent->co.shco.blue);
+ free(pent->co.shco.blue);
}
}
}
@@ -462,15 +462,15 @@ FreeColormap (void * value, XID mid)
{
for(i = 0; i < MAXCLIENTS; i++)
{
- xfree(pmap->clientPixelsGreen[i]);
- xfree(pmap->clientPixelsBlue[i]);
+ free(pmap->clientPixelsGreen[i]);
+ free(pmap->clientPixelsBlue[i]);
}
}
if (pmap->devPrivates)
- xfree(pmap->devPrivates);
+ free(pmap->devPrivates);
- xfree(pmap);
+ free(pmap);
return(Success);
}
@@ -721,11 +721,11 @@ FreeCell (ColormapPtr pmap, Pixel i, int channel)
if (pent->fShared)
{
if(--pent->co.shco.red->refcnt == 0)
- xfree(pent->co.shco.red);
+ free(pent->co.shco.red);
if(--pent->co.shco.green->refcnt == 0)
- xfree(pent->co.shco.green);
+ free(pent->co.shco.green);
if(--pent->co.shco.blue->refcnt == 0)
- xfree(pent->co.shco.blue);
+ free(pent->co.shco.blue);
pent->fShared = FALSE;
}
pent->refcnt = 0;
@@ -841,7 +841,7 @@ AllocColor (ColormapPtr pmap,
*pgreen = pmap->red[pixR].co.local.green;
*pblue = pmap->red[pixR].co.local.blue;
npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
+ ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
@@ -864,21 +864,21 @@ AllocColor (ColormapPtr pmap,
*pgreen = pmap->green[pixG].co.local.green;
*pblue = pmap->blue[pixB].co.local.blue;
npix = pmap->numPixelsRed[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
+ ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
ppix[npix] = pixR;
pmap->clientPixelsRed[client] = ppix;
npix = pmap->numPixelsGreen[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
+ ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
ppix[npix] = pixG;
pmap->clientPixelsGreen[client] = ppix;
npix = pmap->numPixelsBlue[client];
- ppix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
+ ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
@@ -963,7 +963,7 @@ AllocColor (ColormapPtr pmap,
{
colorResource *pcr;
- pcr = (colorResource *) xalloc(sizeof(colorResource));
+ pcr = (colorResource *) malloc(sizeof(colorResource));
if (!pcr)
{
(void)FreeColors(pmap, client, 1, pPix, (Pixel)0);
@@ -1348,7 +1348,7 @@ gotit:
break;
}
npix = nump[client];
- ppix = (Pixel *) xrealloc (pixp[client], (npix + 1) * sizeof(Pixel));
+ ppix = (Pixel *) realloc (pixp[client], (npix + 1) * sizeof(Pixel));
if (!ppix)
{
pent->refcnt--;
@@ -1518,7 +1518,7 @@ FreePixels(register ColormapPtr pmap, register int client)
}
}
- xfree(ppixStart);
+ free(ppixStart);
pmap->clientPixelsRed[client] = (Pixel *) NULL;
pmap->numPixelsRed[client] = 0;
if ((class | DynamicClass) == DirectColor)
@@ -1527,7 +1527,7 @@ FreePixels(register ColormapPtr pmap, register int client)
if (class & DynamicClass)
for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;)
FreeCell(pmap, *ppix++, GREENMAP);
- xfree(ppixStart);
+ free(ppixStart);
pmap->clientPixelsGreen[client] = (Pixel *) NULL;
pmap->numPixelsGreen[client] = 0;
@@ -1535,7 +1535,7 @@ FreePixels(register ColormapPtr pmap, register int client)
if (class & DynamicClass)
for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0; )
FreeCell(pmap, *ppix++, BLUEMAP);
- xfree(ppixStart);
+ free(ppixStart);
pmap->clientPixelsBlue[client] = (Pixel *) NULL;
pmap->numPixelsBlue[client] = 0;
}
@@ -1556,7 +1556,7 @@ FreeClientPixels (void * value, XID fakeid)
pmap = (ColormapPtr) LookupIDByType(pcr->mid, RT_COLORMAP);
if (pmap)
FreePixels(pmap, pcr->client);
- xfree(pcr);
+ free(pcr);
return Success;
}
@@ -1578,7 +1578,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
if (!oldcount && (CLIENT_ID(pmap->mid) != client))
{
- pcr = (colorResource *) xalloc(sizeof(colorResource));
+ pcr = (colorResource *) malloc(sizeof(colorResource));
if (!pcr)
return (BadAlloc);
}
@@ -1626,7 +1626,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr))
ok = BadAlloc;
} else if (pcr)
- xfree(pcr);
+ free(pcr);
return (ok);
}
@@ -1653,7 +1653,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
if (!oldcount && (CLIENT_ID(pmap->mid) != client))
{
- pcr = (colorResource *) xalloc(sizeof(colorResource));
+ pcr = (colorResource *) malloc(sizeof(colorResource));
if (!pcr)
return (BadAlloc);
}
@@ -1717,7 +1717,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr))
ok = BadAlloc;
} else if (pcr)
- xfree(pcr);
+ free(pcr);
return (ok);
}
@@ -1762,17 +1762,17 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
if (okR && okG && okB)
{
- rpix = (Pixel *) xrealloc(pmap->clientPixelsRed[client],
+ rpix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(pmap->numPixelsRed[client] + (c << r)) *
sizeof(Pixel));
if (rpix)
pmap->clientPixelsRed[client] = rpix;
- gpix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client],
+ gpix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
(pmap->numPixelsGreen[client] + (c << g)) *
sizeof(Pixel));
if (gpix)
pmap->clientPixelsGreen[client] = gpix;
- bpix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client],
+ bpix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
(pmap->numPixelsBlue[client] + (c << b)) *
sizeof(Pixel));
if (bpix)
@@ -1861,7 +1861,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
/* all the allocated pixels are added to the client pixel list,
* but only the unique ones are returned to the client */
- ppix = (Pixel *)xrealloc(pmap->clientPixelsRed[client],
+ ppix = (Pixel *)realloc(pmap->clientPixelsRed[client],
(pmap->numPixelsRed[client] + npix) * sizeof(Pixel));
if (!ppix)
{
@@ -2089,10 +2089,10 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
ppshared = psharedList;
for (z = npixShared; --z >= 0; )
{
- if (!(ppshared[z] = (SHAREDCOLOR *)xalloc(sizeof(SHAREDCOLOR))))
+ if (!(ppshared[z] = (SHAREDCOLOR *)malloc(sizeof(SHAREDCOLOR))))
{
for (z++ ; z < npixShared; z++)
- xfree(ppshared[z]);
+ free(ppshared[z]);
return FALSE;
}
}
@@ -2364,7 +2364,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
npix++;
}
}
- pptr = (Pixel *)xrealloc(ppixClient, npixNew * sizeof(Pixel));
+ pptr = (Pixel *)realloc(ppixClient, npixNew * sizeof(Pixel));
if (pptr)
ppixClient = pptr;
npixClient = npixNew;
@@ -2372,7 +2372,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
else
{
npixClient = 0;
- xfree(ppixClient);
+ free(ppixClient);
ppixClient = (Pixel *)NULL;
}
switch(color)
@@ -2729,7 +2729,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
vids = reallocarray(depth->vids, depth->numVids + new_visual_count,
sizeof(XID));
#else
- vids = xrealloc(depth->vids, sizeof(XID) *
+ vids = realloc(depth->vids, sizeof(XID) *
(depth->numVids + new_visual_count));
#endif
if (!vids)
@@ -2742,7 +2742,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
#if 0 /* !defined(NXAGENT_SERVER) */
visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec));
#else
- visuals = xrealloc(pScreen->visuals, sizeof(VisualRec) * numVisuals);
+ visuals = realloc(pScreen->visuals, sizeof(VisualRec) * numVisuals);
#endif
if (!visuals) {
return FALSE;
diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c
index 1e1dba36b..875e19480 100644
--- a/nx-X11/programs/Xserver/dix/cursor.c
+++ b/nx-X11/programs/Xserver/dix/cursor.c
@@ -81,10 +81,10 @@ FreeCursorBits(CursorBitsPtr bits)
{
if (--bits->refcnt > 0)
return;
- xfree(bits->source);
- xfree(bits->mask);
+ free(bits->source);
+ free(bits->mask);
#ifdef ARGB_CURSOR
- xfree(bits->argb);
+ free(bits->argb);
#endif
if (bits->refcnt == 0)
{
@@ -98,9 +98,9 @@ FreeCursorBits(CursorBitsPtr bits)
{
*prev = this->next;
CloseFont(this->font, (Font)0);
- xfree(this);
+ free(this);
}
- xfree(bits);
+ free(bits);
}
}
@@ -126,7 +126,7 @@ FreeCursor(void * value, XID cid)
(void)( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(pCurs->bits);
- xfree( pCurs);
+ free( pCurs);
return(Success);
}
@@ -174,11 +174,11 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
int nscr;
ScreenPtr pscr;
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
+ pCurs = (CursorPtr)malloc(sizeof(CursorRec) + sizeof(CursorBits));
if (!pCurs)
{
- xfree(psrcbits);
- xfree(pmaskbits);
+ free(psrcbits);
+ free(pmaskbits);
return (CursorPtr)NULL;
}
bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec));
@@ -223,7 +223,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(bits);
- xfree(pCurs);
+ free(pCurs);
return (CursorPtr)NULL;
}
}
@@ -292,7 +292,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
if (pShare)
{
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec));
+ pCurs = (CursorPtr)malloc(sizeof(CursorRec));
if (!pCurs)
return BadAlloc;
bits = pShare->bits;
@@ -311,7 +311,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
register unsigned char *mskptr;
n = BitmapBytePad(cm.width)*(long)cm.height;
- mskptr = mskbits = (unsigned char *)xalloc(n);
+ mskptr = mskbits = (unsigned char *)malloc(n);
if (!mskptr)
return BadAlloc;
while (--n >= 0)
@@ -329,12 +329,12 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
if ((res = ServerBitsFromGlyph(sourcefont, sourceChar, &cm, &srcbits)) != 0)
{
- xfree(mskbits);
+ free(mskbits);
return res;
}
if (sourcefont != maskfont)
{
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
+ pCurs = (CursorPtr)malloc(sizeof(CursorRec) + sizeof(CursorBits));
if (pCurs)
bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec));
else
@@ -342,17 +342,17 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
else
{
- pCurs = (CursorPtr)xalloc(sizeof(CursorRec));
+ pCurs = (CursorPtr)malloc(sizeof(CursorRec));
if (pCurs)
- bits = (CursorBitsPtr)xalloc(sizeof(CursorBits));
+ bits = (CursorBitsPtr)malloc(sizeof(CursorBits));
else
bits = (CursorBitsPtr)NULL;
}
if (!bits)
{
- xfree(pCurs);
- xfree(mskbits);
- xfree(srcbits);
+ free(pCurs);
+ free(mskbits);
+ free(srcbits);
return BadAlloc;
}
bits->source = srcbits;
@@ -369,7 +369,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
else
{
bits->refcnt = 1;
- pShare = (GlyphSharePtr)xalloc(sizeof(GlyphShare));
+ pShare = (GlyphSharePtr)malloc(sizeof(GlyphShare));
if (!pShare)
{
FreeCursorBits(bits);
@@ -414,7 +414,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(pCurs->bits);
- xfree(pCurs);
+ free(pCurs);
return BadAlloc;
}
}
diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c
index 49ab80529..69a72fbad 100644
--- a/nx-X11/programs/Xserver/dix/devices.c
+++ b/nx-X11/programs/Xserver/dix/devices.c
@@ -86,7 +86,7 @@ _AddInputDevice(DeviceProc deviceProc, Bool autoStart)
if (inputInfo.numDevices >= MAX_DEVICES)
return (DeviceIntPtr)NULL;
- dev = (DeviceIntPtr) xalloc(sizeof(DeviceIntRec));
+ dev = (DeviceIntPtr) malloc(sizeof(DeviceIntRec));
if (!dev)
return (DeviceIntPtr)NULL;
dev->name = (char *)NULL;
@@ -208,29 +208,29 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
- xfree(dev->name);
+ free(dev->name);
if (dev->key)
{
#ifdef XKB
if (dev->key->xkbInfo)
XkbFreeInfo(dev->key->xkbInfo);
#endif
- xfree(dev->key->curKeySyms.map);
- xfree(dev->key->modifierKeyMap);
- xfree(dev->key);
+ free(dev->key->curKeySyms.map);
+ free(dev->key->modifierKeyMap);
+ free(dev->key);
}
- xfree(dev->valuator);
+ free(dev->valuator);
#ifdef XKB
if ((dev->button)&&(dev->button->xkb_acts))
- xfree(dev->button->xkb_acts);
+ free(dev->button->xkb_acts);
#endif
- xfree(dev->button);
+ free(dev->button);
if (dev->focus)
{
- xfree(dev->focus->trace);
- xfree(dev->focus);
+ free(dev->focus->trace);
+ free(dev->focus);
}
- xfree(dev->proximity);
+ free(dev->proximity);
for (k=dev->kbdfeed; k; k=knext)
{
knext = k->next;
@@ -238,29 +238,29 @@ CloseDevice(register DeviceIntPtr dev)
if (k->xkb_sli)
XkbFreeSrvLedInfo(k->xkb_sli);
#endif
- xfree(k);
+ free(k);
}
for (p=dev->ptrfeed; p; p=pnext)
{
pnext = p->next;
- xfree(p);
+ free(p);
}
for (i=dev->intfeed; i; i=inext)
{
inext = i->next;
- xfree(i);
+ free(i);
}
for (s=dev->stringfeed; s; s=snext)
{
snext = s->next;
- xfree(s->ctrl.symbols_supported);
- xfree(s->ctrl.symbols_displayed);
- xfree(s);
+ free(s->ctrl.symbols_supported);
+ free(s->ctrl.symbols_displayed);
+ free(s);
}
for (b=dev->bell; b; b=bnext)
{
bnext = b->next;
- xfree(b);
+ free(b);
}
for (l=dev->leds; l; l=lnext)
{
@@ -269,15 +269,15 @@ CloseDevice(register DeviceIntPtr dev)
if (l->xkb_sli)
XkbFreeSrvLedInfo(l->xkb_sli);
#endif
- xfree(l);
+ free(l);
}
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
- xfree(dev->sync.event);
- xfree(dev);
+ free(dev->sync.event);
+ free(dev);
}
void
@@ -369,7 +369,7 @@ _RegisterPointerDevice(DeviceIntPtr device)
if (!device->name)
{
char *p = "pointer";
- device->name = (char *)xalloc(strlen(p) + 1);
+ device->name = (char *)malloc(strlen(p) + 1);
strcpy(device->name, p);
}
}
@@ -392,7 +392,7 @@ _RegisterKeyboardDevice(DeviceIntPtr device)
if (!device->name)
{
char *k = "keyboard";
- device->name = (char *)xalloc(strlen(k) + 1);
+ device->name = (char *)malloc(strlen(k) + 1);
strcpy(device->name, k);
}
}
@@ -461,7 +461,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src)
KeySym *map;
int bytes = sizeof(KeySym) * src->mapWidth *
(dst->maxKeyCode - dst->minKeyCode + 1);
- map = (KeySym *)xalloc(bytes);
+ map = (KeySym *)malloc(bytes);
if (!map)
return FALSE;
bzero((char *)map, bytes);
@@ -471,7 +471,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src)
memmove((char *)&map[i*src->mapWidth],
(char *)&dst->map[i*dst->mapWidth],
dst->mapWidth * sizeof(KeySym));
- xfree(dst->map);
+ free(dst->map);
}
dst->mapWidth = src->mapWidth;
dst->map = map;
@@ -504,7 +504,7 @@ InitModMap(register KeyClassPtr keyc)
}
}
}
- keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier);
+ keyc->modifierKeyMap = (KeyCode *)malloc(8*keyc->maxKeysPerModifier);
if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier)
return (FALSE);
bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier);
@@ -531,7 +531,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
int i;
register KeyClassPtr keyc;
- keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec));
+ keyc = (KeyClassPtr)malloc(sizeof(KeyClassRec));
if (!keyc)
return FALSE;
keyc->curKeySyms.map = (KeySym *)NULL;
@@ -550,9 +550,9 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
keyc->modifierKeyCount[i] = 0;
if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc))
{
- xfree(keyc->curKeySyms.map);
- xfree(keyc->modifierKeyMap);
- xfree(keyc);
+ free(keyc->curKeySyms.map);
+ free(keyc->modifierKeyMap);
+ free(keyc);
return FALSE;
}
dev->key = keyc;
@@ -570,7 +570,7 @@ InitButtonClassDeviceStruct(register DeviceIntPtr dev, int numButtons,
register ButtonClassPtr butc;
int i;
- butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec));
+ butc = (ButtonClassPtr)malloc(sizeof(ButtonClassRec));
if (!butc)
return FALSE;
butc->numButtons = numButtons;
@@ -595,7 +595,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
int i;
register ValuatorClassPtr valc;
- valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) +
+ valc = (ValuatorClassPtr)malloc(sizeof(ValuatorClassRec) +
numAxes * sizeof(AxisInfo) +
numAxes * sizeof(unsigned int));
if (!valc)
@@ -618,7 +618,7 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev)
{
register FocusClassPtr focc;
- focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec));
+ focc = (FocusClassPtr)malloc(sizeof(FocusClassRec));
if (!focc)
return FALSE;
focc->win = PointerRootWin;
@@ -637,7 +637,7 @@ InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc,
{
register KbdFeedbackPtr feedc;
- feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec));
+ feedc = (KbdFeedbackPtr)malloc(sizeof(KbdFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->BellProc = bellProc;
@@ -664,7 +664,7 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc)
{
register PtrFeedbackPtr feedc;
- feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec));
+ feedc = (PtrFeedbackPtr)malloc(sizeof(PtrFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
@@ -708,7 +708,7 @@ InitStringFeedbackClassDeviceStruct (
int i;
register StringFeedbackPtr feedc;
- feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec));
+ feedc = (StringFeedbackPtr)malloc(sizeof(StringFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
@@ -716,16 +716,16 @@ InitStringFeedbackClassDeviceStruct (
feedc->ctrl.num_symbols_displayed = 0;
feedc->ctrl.max_symbols = max_symbols;
feedc->ctrl.symbols_supported = (KeySym *)
- xalloc (sizeof (KeySym) * num_symbols_supported);
+ malloc (sizeof (KeySym) * num_symbols_supported);
feedc->ctrl.symbols_displayed = (KeySym *)
- xalloc (sizeof (KeySym) * max_symbols);
+ malloc (sizeof (KeySym) * max_symbols);
if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed)
{
if (feedc->ctrl.symbols_supported)
- xfree(feedc->ctrl.symbols_supported);
+ free(feedc->ctrl.symbols_supported);
if (feedc->ctrl.symbols_displayed)
- xfree(feedc->ctrl.symbols_displayed);
- xfree(feedc);
+ free(feedc->ctrl.symbols_displayed);
+ free(feedc);
return FALSE;
}
for (i=0; i<num_symbols_supported; i++)
@@ -746,7 +746,7 @@ InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc,
{
register BellFeedbackPtr feedc;
- feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec));
+ feedc = (BellFeedbackPtr)malloc(sizeof(BellFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
@@ -765,7 +765,7 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc)
{
register LedFeedbackPtr feedc;
- feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec));
+ feedc = (LedFeedbackPtr)malloc(sizeof(LedFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
@@ -786,7 +786,7 @@ InitIntegerFeedbackClassDeviceStruct (DeviceIntPtr dev, IntegerCtrlProcPtr contr
{
register IntegerFeedbackPtr feedc;
- feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec));
+ feedc = (IntegerFeedbackPtr)malloc(sizeof(IntegerFeedbackClassRec));
if (!feedc)
return FALSE;
feedc->CtrlProc = controlProc;
@@ -997,11 +997,11 @@ ProcSetModifierMapping(ClientPtr client)
* Now build the keyboard's modifier bitmap from the
* list of keycodes.
*/
- map = (KeyCode *)xalloc(inputMapLen);
+ map = (KeyCode *)malloc(inputMapLen);
if (!map && inputMapLen)
return BadAlloc;
if (keyc->modifierKeyMap)
- xfree(keyc->modifierKeyMap);
+ free(keyc->modifierKeyMap);
keyc->modifierKeyMap = map;
memmove((char *)map, (char *)inputMap, inputMapLen);
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index 803870369..aac3284a7 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -214,7 +214,7 @@ void
InitSelections()
{
if (CurrentSelections)
- xfree(CurrentSelections);
+ free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
}
@@ -1021,9 +1021,9 @@ ProcSetSelectionOwner(register ClientPtr client)
Selection *newsels;
if (i == 0)
- newsels = (Selection *)xalloc(sizeof(Selection));
+ newsels = (Selection *)malloc(sizeof(Selection));
else
- newsels = (Selection *)xrealloc(CurrentSelections,
+ newsels = (Selection *)realloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
if (!newsels)
return BadAlloc;
@@ -2188,7 +2188,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
xgi.length = length;
if (im_return) {
- pBuf = (char *)xcalloc(1, sz_xGetImageReply + length);
+ pBuf = (char *)calloc(1, sz_xGetImageReply + length);
if (!pBuf)
return (BadAlloc);
if (widthBytesLine == 0)
@@ -3084,13 +3084,13 @@ ProcCreateCursor (register ClientPtr client)
return (BadMatch);
n = BitmapBytePad(width)*height;
- srcbits = (unsigned char *)xalloc(n);
+ srcbits = (unsigned char *)malloc(n);
if (!srcbits)
return (BadAlloc);
- mskbits = (unsigned char *)xalloc(n);
+ mskbits = (unsigned char *)malloc(n);
if (!mskbits)
{
- xfree(srcbits);
+ free(srcbits);
return (BadAlloc);
}
@@ -3332,7 +3332,7 @@ ProcListHosts(register ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
WriteSwappedDataToClient(client, len, pdata);
}
- xfree(pdata);
+ free(pdata);
return (client->noClientException);
}
@@ -3600,7 +3600,7 @@ CloseDownClient(register ClientPtr client)
#ifdef SMART_SCHEDULE
SmartLastClient = NullClient;
#endif
- xfree(client);
+ free(client);
while (!clients[currentMaxClients-1])
currentMaxClients--;
@@ -3716,7 +3716,7 @@ InitClientPrivates(ClientPtr client)
ppriv = (DevUnion *)(client + 1);
else
{
- ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec));
+ ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec));
if (!ppriv)
return 0;
}
@@ -3753,14 +3753,14 @@ ClientPtr NextAvailableClient(void * ospriv)
i = nextFreeClientID;
if (i == MAXCLIENTS)
return (ClientPtr)NULL;
- clients[i] = client = (ClientPtr)xalloc(totalClientSize);
+ clients[i] = client = (ClientPtr)malloc(totalClientSize);
if (!client)
return (ClientPtr)NULL;
InitClient(client, i, ospriv);
InitClientPrivates(client);
if (!InitClientResources(client))
{
- xfree(client);
+ free(client);
return (ClientPtr)NULL;
}
data.reqType = 1;
@@ -3768,7 +3768,7 @@ ClientPtr NextAvailableClient(void * ospriv)
if (!InsertFakeRequest(client, (char *)&data, sz_xReq))
{
FreeClientResources(client);
- xfree(client);
+ free(client);
return (ClientPtr)NULL;
}
if (i == currentMaxClients)
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index 58e562411..0ebb4e68d 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -170,7 +170,7 @@ QueueFontWakeup(FontPathElementPtr fpe)
}
if (num_slept_fpes == size_slept_fpes) {
new = (FontPathElementPtr *)
- xrealloc(slept_fpes,
+ realloc(slept_fpes,
sizeof(FontPathElementPtr) * (size_slept_fpes + 4));
if (!new)
return;
@@ -226,8 +226,8 @@ FreeFPE (FontPathElementPtr fpe)
fpe->refcount--;
if (fpe->refcount == 0) {
(*fpe_functions[fpe->type].free_fpe) (fpe);
- xfree(fpe->name);
- xfree(fpe);
+ free(fpe->name);
+ free(fpe);
}
}
@@ -302,7 +302,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (err == FontNameAlias && alias) {
newlen = strlen(alias);
- newname = (char *) xrealloc(c->fontname, newlen);
+ newname = (char *) realloc(c->fontname, newlen);
if (!newname) {
err = AllocError;
break;
@@ -377,9 +377,9 @@ bail:
for (i = 0; i < c->num_fpes; i++) {
FreeFPE(c->fpe_list[i]);
}
- xfree(c->fpe_list);
- xfree(c->fontname);
- xfree(c);
+ free(c->fpe_list);
+ free(c->fontname);
+ free(c);
return TRUE;
}
#endif /* NXAGENT_SERVER */
@@ -393,11 +393,11 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
#ifdef FONTDEBUG
char *f;
- f = (char *)xalloc(lenfname + 1);
+ f = (char *)malloc(lenfname + 1);
memmove(f, pfontname, lenfname);
f[lenfname] = '\0';
ErrorF("OpenFont: fontname is \"%s\"\n", f);
- xfree(f);
+ free(f);
#endif
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
return BadName;
@@ -430,14 +430,14 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
return Success;
}
}
- c = (OFclosurePtr) xalloc(sizeof(OFclosureRec));
+ c = (OFclosurePtr) malloc(sizeof(OFclosureRec));
if (!c)
return BadAlloc;
- c->fontname = (char *) xalloc(lenfname);
+ c->fontname = (char *) malloc(lenfname);
c->origFontName = pfontname;
c->origFontNameLen = lenfname;
if (!c->fontname) {
- xfree(c);
+ free(c);
return BadAlloc;
}
/*
@@ -445,10 +445,10 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
* while we're blocking, the request still appears atomic
*/
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
- xfree(c->fontname);
- xfree(c);
+ free(c->fontname);
+ free(c);
return BadAlloc;
}
memmove(c->fontname, pfontname, lenfname);
@@ -679,8 +679,8 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) xfree(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ if (resolved) free(resolved);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
}
@@ -734,8 +734,8 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ free(c->savedName);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
c->savedNameLen = namelen;
@@ -829,11 +829,11 @@ bail:
ClientWakeup(client);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
+ free(c->fpe_list);
+ if (c->savedName) free(c->savedName);
FreeFontNames(names);
- xfree(c);
- if (resolved) xfree(resolved);
+ free(c);
+ if (resolved) free(resolved);
return TRUE;
}
@@ -853,19 +853,19 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
if (length > XLFDMAXFONTNAMELEN)
return BadAlloc;
- if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
+ if (!(c = (LFclosurePtr) malloc(sizeof *c)))
return BadAlloc;
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
- xfree(c);
+ free(c);
return BadAlloc;
}
c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100);
if (!c->names)
{
- xfree(c->fpe_list);
- xfree(c);
+ free(c->fpe_list);
+ free(c);
return BadAlloc;
}
memmove( c->current.pattern, pattern, length);
@@ -994,8 +994,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ free(c->savedName);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
aliascount = 20;
@@ -1038,7 +1038,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
reply = c->reply;
if (c->length < length)
{
- reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length);
+ reply = (xListFontsWithInfoReply *) realloc(c->reply, length);
if (!reply)
{
err = AllocError;
@@ -1084,8 +1084,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
(void) WriteToClient(client, namelen, name);
if (pFontInfo == &fontInfo)
{
- xfree(fontInfo.props);
- xfree(fontInfo.isStringProp);
+ free(fontInfo.props);
+ free(fontInfo.isStringProp);
}
--c->current.max_names;
}
@@ -1103,10 +1103,10 @@ bail:
ClientWakeup(client);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->reply);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
- xfree(c);
+ free(c->reply);
+ free(c->fpe_list);
+ if (c->savedName) free(c->savedName);
+ free(c);
return TRUE;
}
#endif /* NXAGENT_SERVER */
@@ -1127,13 +1127,13 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern,
if (length > XLFDMAXFONTNAMELEN)
return BadAlloc;
- if (!(c = (LFWIclosurePtr) xalloc(sizeof *c)))
+ if (!(c = (LFWIclosurePtr) malloc(sizeof *c)))
goto badAlloc;
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list)
{
- xfree(c);
+ free(c);
goto badAlloc;
}
memmove(c->current.pattern, pattern, length);
@@ -1317,7 +1317,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
/* Step 1 */
/* Allocate a malloc'd closure structure to replace
the local one we were passed */
- new_closure = (PTclosurePtr) xalloc(sizeof(PTclosureRec));
+ new_closure = (PTclosurePtr) malloc(sizeof(PTclosureRec));
if (!new_closure)
{
err = BadAlloc;
@@ -1327,10 +1327,10 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
c = new_closure;
len = c->endReq - c->pElt;
- c->data = (unsigned char *)xalloc(len);
+ c->data = (unsigned char *)malloc(len);
if (!c->data)
{
- xfree(c);
+ free(c);
err = BadAlloc;
goto bail;
}
@@ -1343,8 +1343,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
if (!pGC)
{
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
err = BadAlloc;
goto bail;
}
@@ -1366,8 +1366,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
Success)
{
FreeScratchGC(pGC);
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
err = BadAlloc;
goto bail;
}
@@ -1434,8 +1434,8 @@ bail:
c->pGC->font = NullFont;
FreeScratchGC(c->pGC);
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
}
return TRUE;
}
@@ -1517,7 +1517,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
in doPolyText, but much simpler because the
request structure is much simpler. */
- new_closure = (ITclosurePtr) xalloc(sizeof(ITclosureRec));
+ new_closure = (ITclosurePtr) malloc(sizeof(ITclosureRec));
if (!new_closure)
{
err = BadAlloc;
@@ -1527,10 +1527,10 @@ doImageText(ClientPtr client, register ITclosurePtr c)
*new_closure = *c;
c = new_closure;
- data = (unsigned char *)xalloc(c->nChars * c->itemSize);
+ data = (unsigned char *)malloc(c->nChars * c->itemSize);
if (!data)
{
- xfree(c);
+ free(c);
c = old_closure;
err = BadAlloc;
goto bail;
@@ -1541,8 +1541,8 @@ doImageText(ClientPtr client, register ITclosurePtr c)
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
if (!pGC)
{
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
c = old_closure;
err = BadAlloc;
goto bail;
@@ -1562,8 +1562,8 @@ doImageText(ClientPtr client, register ITclosurePtr c)
GCClipYOrigin | GCClipMask)) != Success)
{
FreeScratchGC(pGC);
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
c = old_closure;
err = BadAlloc;
goto bail;
@@ -1602,8 +1602,8 @@ bail:
c->pGC->font = NullFont;
FreeScratchGC(c->pGC);
- xfree(c->data);
- xfree(c);
+ free(c->data);
+ free(c);
}
return TRUE;
}
@@ -1677,7 +1677,7 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
}
FreeFPE(list[i]);
}
- xfree((char *) list);
+ free((char *) list);
}
static FontPathElementPtr
@@ -1704,7 +1704,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
FontPathElementPtr fpe = NULL, *fplist;
fplist = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * npaths);
+ malloc(sizeof(FontPathElementPtr) * npaths);
if (!fplist) {
*bad = 0;
return BadAlloc;
@@ -1745,16 +1745,16 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
/* if error or can't do it, act like it's a new one */
if (!fpe)
{
- fpe = (FontPathElementPtr) xalloc(sizeof(FontPathElementRec));
+ fpe = (FontPathElementPtr) malloc(sizeof(FontPathElementRec));
if (!fpe)
{
err = BadAlloc;
goto bail;
}
- fpe->name = (char *) xalloc(len + 1);
+ fpe->name = (char *) malloc(len + 1);
if (!fpe->name)
{
- xfree(fpe);
+ free(fpe);
err = BadAlloc;
goto bail;
}
@@ -1777,8 +1777,8 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
fpe->name);
}
#endif /* NXAGENT_SERVER */
- xfree (fpe->name);
- xfree (fpe);
+ free (fpe->name);
+ free (fpe);
}
}
}
@@ -1805,7 +1805,7 @@ bail:
*bad = i;
while (--valid_paths >= 0)
FreeFPE(fplist[valid_paths]);
- xfree(fplist);
+ free(fplist);
return FontToXError(err);
}
@@ -1998,7 +1998,7 @@ RegisterFPEFunctions(NameCheckFunc name_func,
FPEFunctions *new;
/* grow the list */
- new = (FPEFunctions *) xrealloc(fpe_functions,
+ new = (FPEFunctions *) realloc(fpe_functions,
(num_fpe_types + 1) * sizeof(FPEFunctions));
if (!new)
return -1;
@@ -2037,7 +2037,7 @@ FreeFonts()
FreeFontPath(font_path_elements, num_fpes, TRUE);
font_path_elements = 0;
num_fpes = 0;
- xfree(fpe_functions);
+ free(fpe_functions);
num_fpe_types = 0;
fpe_functions = (FPEFunctions *) 0;
}
diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c
index e91303851..d43b57a2c 100644
--- a/nx-X11/programs/Xserver/dix/dixutils.c
+++ b/nx-X11/programs/Xserver/dix/dixutils.c
@@ -351,7 +351,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
if (j < numnow) /* duplicate */
return(Success);
numnow++;
- pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow);
+ pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow);
if (!pTmp)
return(BadAlloc);
client->saveSet = pTmp;
@@ -371,13 +371,13 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
numnow--;
if (numnow)
{
- pTmp = (SaveSetElt *)xrealloc(client->saveSet, sizeof(*pTmp) * numnow);
+ pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow);
if (pTmp)
client->saveSet = pTmp;
}
else
{
- xfree(client->saveSet);
+ free(client->saveSet);
client->saveSet = (SaveSetElt *)NULL;
}
client->numSaved = numnow;
@@ -504,7 +504,7 @@ RegisterBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
if (numHandlers >= sizeHandlers)
{
- new = (BlockHandlerPtr) xrealloc (handlers, (numHandlers + 1) *
+ new = (BlockHandlerPtr) realloc (handlers, (numHandlers + 1) *
sizeof (BlockHandlerRec));
if (!new)
return FALSE;
@@ -549,7 +549,7 @@ RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
void
InitBlockAndWakeupHandlers ()
{
- xfree (handlers);
+ free (handlers);
handlers = (BlockHandlerPtr) 0;
numHandlers = 0;
sizeHandlers = 0;
@@ -581,7 +581,7 @@ ProcessWorkQueue(void)
{
/* remove q from the list */
*p = q->next; /* don't fetch until after func called */
- xfree (q);
+ free (q);
}
else
{
@@ -604,7 +604,7 @@ ProcessWorkQueueZombies(void)
(void) (*q->function) (q->client, q->closure);
/* remove q from the list */
*p = q->next; /* don't fetch until after func called */
- xfree (q);
+ free (q);
}
else
{
@@ -621,7 +621,7 @@ QueueWorkProc (
{
WorkQueuePtr q;
- q = (WorkQueuePtr) xalloc (sizeof *q);
+ q = (WorkQueuePtr) malloc (sizeof *q);
if (!q)
return FALSE;
q->function = function;
@@ -655,7 +655,7 @@ ClientSleep (ClientPtr client, ClientSleepProcPtr function, void * closure)
{
SleepQueuePtr q;
- q = (SleepQueuePtr) xalloc (sizeof *q);
+ q = (SleepQueuePtr) malloc (sizeof *q);
if (!q)
return FALSE;
@@ -692,7 +692,7 @@ ClientWakeup (ClientPtr client)
if (q->client == client)
{
*prev = q->next;
- xfree (q);
+ free (q);
if (client->clientGone)
/* Oops -- new zombie cleanup code ensures this only
* happens from inside CloseDownClient; don't want to
@@ -735,7 +735,7 @@ _AddCallback(
{
CallbackPtr cbr;
- cbr = (CallbackPtr) xalloc(sizeof(CallbackRec));
+ cbr = (CallbackPtr) malloc(sizeof(CallbackRec));
if (!cbr)
return FALSE;
cbr->proc = callback;
@@ -775,7 +775,7 @@ _DeleteCallback(
cbl->list = cbr->next;
else
pcbr->next = cbr->next;
- xfree(cbr);
+ free(cbr);
}
return TRUE;
}
@@ -820,12 +820,12 @@ _CallCallbacks(
if (pcbr)
{
cbr = cbr->next;
- xfree(pcbr->next);
+ free(pcbr->next);
pcbr->next = cbr;
} else
{
cbr = cbr->next;
- xfree(cbl->list);
+ free(cbl->list);
cbl->list = cbr;
}
cbl->numDeleted--;
@@ -865,9 +865,9 @@ _DeleteCallbackList(
for (cbr = cbl->list; cbr != NULL; cbr = nextcbr)
{
nextcbr = cbr->next;
- xfree(cbr);
+ free(cbr);
}
- xfree(cbl);
+ free(cbl);
*pcbl = NULL;
}
@@ -888,7 +888,7 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
int i;
if (!pcbl) return FALSE;
- cbl = (CallbackListPtr) xalloc(sizeof(CallbackListRec));
+ cbl = (CallbackListPtr) malloc(sizeof(CallbackListRec));
if (!cbl) return FALSE;
cbl->funcs = cbfuncs ? *cbfuncs : default_cbfuncs;
cbl->inCallback = 0;
@@ -955,7 +955,7 @@ InitCallbackManager()
{
DeleteCallbackList(listsToCleanup[i]);
}
- if (listsToCleanup) xfree(listsToCleanup);
+ if (listsToCleanup) free(listsToCleanup);
numCallbackListsToCleanup = 0;
listsToCleanup = NULL;
diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c
index 31b76e38f..676640f01 100644
--- a/nx-X11/programs/Xserver/dix/events.c
+++ b/nx-X11/programs/Xserver/dix/events.c
@@ -1027,7 +1027,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
return;
}
}
- qe = (QdEventPtr)xalloc(sizeof(QdEventRec) + (count * sizeof(xEvent)));
+ qe = (QdEventPtr)malloc(sizeof(QdEventRec) + (count * sizeof(xEvent)));
if (!qe)
return;
qe->next = (QdEventPtr)NULL;
@@ -1076,7 +1076,7 @@ PlayReleasedEvents(void)
#endif
(*qe->device->public.processInputProc)(qe->event, qe->device,
qe->evcount);
- xfree(qe);
+ free(qe);
for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next)
;
if (!dev)
@@ -1952,7 +1952,7 @@ XYToWindow(int x, int y)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
- spriteTrace = (WindowPtr *)xrealloc(
+ spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
@@ -2467,7 +2467,7 @@ CheckPassiveGrabsOnWindow(
if (device->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
- device->sync.event = (xEvent *)xrealloc(device->sync.event,
+ device->sync.event = (xEvent *)realloc(device->sync.event,
count*
sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
@@ -2639,7 +2639,7 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev,
if (thisDev->sync.evcount < count)
{
Must_have_memory = TRUE; /* XXX */
- thisDev->sync.event = (xEvent *)xrealloc(thisDev->sync.event,
+ thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event,
count*sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
}
@@ -2959,7 +2959,7 @@ OtherClientGone(void * value, XID id)
if (!(pWin->optional->otherClients = other->next))
CheckWindowOptionalNeed (pWin);
}
- xfree(other);
+ free(other);
RecalculateDeliverableEvents(pWin);
return(Success);
}
@@ -3030,7 +3030,7 @@ EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask ma
check = 0;
if (!pWin->optional && !MakeWindowOptional (pWin))
return BadAlloc;
- others = (OtherClients *) xalloc(sizeof(OtherClients));
+ others = (OtherClients *) malloc(sizeof(OtherClients));
if (!others)
return BadAlloc;
others->mask = mask;
@@ -3530,7 +3530,7 @@ SetInputFocus(
{
focus->traceSize = depth+1;
Must_have_memory = TRUE; /* XXX */
- focus->trace = (WindowPtr *)xrealloc(focus->trace,
+ focus->trace = (WindowPtr *)realloc(focus->trace,
focus->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
@@ -3929,7 +3929,7 @@ InitEvents()
if (spriteTraceSize == 0)
{
spriteTraceSize = 32;
- spriteTrace = (WindowPtr *)xalloc(32*sizeof(WindowPtr));
+ spriteTrace = (WindowPtr *)malloc(32*sizeof(WindowPtr));
if (!spriteTrace)
FatalError("failed to allocate spriteTrace");
}
@@ -3948,7 +3948,7 @@ InitEvents()
while (syncEvents.pending)
{
QdEventPtr next = syncEvents.pending->next;
- xfree(syncEvents.pending);
+ free(syncEvents.pending);
syncEvents.pending = next;
}
syncEvents.pendtail = &syncEvents.pending;
@@ -3968,7 +3968,7 @@ InitEvents()
void
CloseDownEvents(void)
{
- xfree(spriteTrace);
+ free(spriteTrace);
spriteTrace = NULL;
spriteTraceSize = 0;
}
diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c
index fe51f8916..b0859757b 100644
--- a/nx-X11/programs/Xserver/dix/extension.c
+++ b/nx-X11/programs/Xserver/dix/extension.c
@@ -95,25 +95,25 @@ AddExtension(char *name, int NumEvents, int NumErrors,
(unsigned)(lastError + NumErrors > LAST_ERROR))
return((ExtensionEntry *) NULL);
- ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry));
+ ext = (ExtensionEntry *) malloc(sizeof(ExtensionEntry));
if (!ext)
return((ExtensionEntry *) NULL);
- ext->name = (char *)xalloc(strlen(name) + 1);
+ ext->name = (char *)malloc(strlen(name) + 1);
ext->num_aliases = 0;
ext->aliases = (char **)NULL;
if (!ext->name)
{
- xfree(ext);
+ free(ext);
return((ExtensionEntry *) NULL);
}
strcpy(ext->name, name);
i = NumExtensions;
- newexts = (ExtensionEntry **) xrealloc(extensions,
+ newexts = (ExtensionEntry **) realloc(extensions,
(i + 1) * sizeof(ExtensionEntry *));
if (!newexts)
{
- xfree(ext->name);
- xfree(ext);
+ free(ext->name);
+ free(ext);
return((ExtensionEntry *) NULL);
}
NumExtensions++;
@@ -159,12 +159,12 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
char *name;
char **aliases;
- aliases = (char **)xrealloc(ext->aliases,
+ aliases = (char **)realloc(ext->aliases,
(ext->num_aliases + 1) * sizeof(char *));
if (!aliases)
return FALSE;
ext->aliases = aliases;
- name = (char *)xalloc(strlen(alias) + 1);
+ name = (char *)malloc(strlen(alias) + 1);
if (!name)
return FALSE;
strcpy(name, alias);
@@ -263,13 +263,13 @@ CloseDownExtensions()
if (extensions[i]->CloseDown)
(* extensions[i]->CloseDown)(extensions[i]);
NumExtensions = i;
- xfree(extensions[i]->name);
+ free(extensions[i]->name);
for (j = extensions[i]->num_aliases; --j >= 0;)
- xfree(extensions[i]->aliases[j]);
- xfree(extensions[i]->aliases);
- xfree(extensions[i]);
+ free(extensions[i]->aliases[j]);
+ free(extensions[i]->aliases);
+ free(extensions[i]);
}
- xfree(extensions);
+ free(extensions);
extensions = (ExtensionEntry **)NULL;
lastEvent = EXTENSION_EVENT_BASE;
lastError = FirstExtensionError;
@@ -280,9 +280,9 @@ CloseDownExtensions()
while (spentry->num)
{
spentry->num--;
- xfree(spentry->procList[spentry->num].name);
+ free(spentry->procList[spentry->num].name);
}
- xfree(spentry->procList);
+ free(spentry->procList);
spentry->procList = (ProcEntryPtr)NULL;
}
}
@@ -438,15 +438,15 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
procEntry->proc = proc;
else
{
- newname = (char *)xalloc(strlen(name)+1);
+ newname = (char *)malloc(strlen(name)+1);
if (!newname)
return FALSE;
procEntry = (ProcEntryPtr)
- xrealloc(spentry->procList,
+ realloc(spentry->procList,
sizeof(ProcEntryRec) * (spentry->num+1));
if (!procEntry)
{
- xfree(newname);
+ free(newname);
return FALSE;
}
spentry->procList = procEntry;
diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c
index 2c17de3d6..9566bb8f7 100644
--- a/nx-X11/programs/Xserver/dix/gc.c
+++ b/nx-X11/programs/Xserver/dix/gc.c
@@ -457,7 +457,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
if (pGC->dash != DefaultDash)
{
- xfree(pGC->dash);
+ free(pGC->dash);
pGC->numInDashList = 2;
pGC->dash = DefaultDash;
}
@@ -466,11 +466,11 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
unsigned char *dash;
- dash = (unsigned char *)xalloc(2 * sizeof(unsigned char));
+ dash = (unsigned char *)malloc(2 * sizeof(unsigned char));
if (dash)
{
if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
+ free(pGC->dash);
pGC->numInDashList = 2;
pGC->dash = dash;
dash[0] = newdash;
@@ -580,7 +580,7 @@ AllocateGC(ScreenPtr pScreen)
register unsigned size;
register int i;
- pGC = (GCPtr)xalloc(pScreen->totalGCSize);
+ pGC = (GCPtr)malloc(pScreen->totalGCSize);
if (pGC)
{
ppriv = (DevUnion *)(pGC + 1);
@@ -838,7 +838,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask)
{
if (pgcDst->dash != DefaultDash)
{
- xfree(pgcDst->dash);
+ free(pgcDst->dash);
pgcDst->numInDashList = pgcSrc->numInDashList;
pgcDst->dash = pgcSrc->dash;
}
@@ -848,12 +848,12 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask)
unsigned char *dash;
unsigned int i;
- dash = (unsigned char *)xalloc(pgcSrc->numInDashList *
+ dash = (unsigned char *)malloc(pgcSrc->numInDashList *
sizeof(unsigned char));
if (dash)
{
if (pgcDst->dash != DefaultDash)
- xfree(pgcDst->dash);
+ free(pgcDst->dash);
pgcDst->numInDashList = pgcSrc->numInDashList;
pgcDst->dash = dash;
for (i=0; i<pgcSrc->numInDashList; i++)
@@ -904,8 +904,8 @@ FreeGC(void * value, XID gid)
(*pGC->funcs->DestroyGC) (pGC);
if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
- xfree(pGC);
+ free(pGC->dash);
+ free(pGC);
return(Success);
}
@@ -1098,9 +1098,9 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd
}
if (ndash & 1)
- p = (unsigned char *)xalloc(2 * ndash * sizeof(unsigned char));
+ p = (unsigned char *)malloc(2 * ndash * sizeof(unsigned char));
else
- p = (unsigned char *)xalloc(ndash * sizeof(unsigned char));
+ p = (unsigned char *)malloc(ndash * sizeof(unsigned char));
if (!p)
return BadAlloc;
@@ -1113,7 +1113,7 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd
}
if (pGC->dash != DefaultDash)
- xfree(pGC->dash);
+ free(pGC->dash);
pGC->numInDashList = ndash;
pGC->dash = p;
if (ndash & 1)
@@ -1195,7 +1195,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects,
if (newct < 0)
return(BadMatch);
size = nrects * sizeof(xRectangle);
- prectsNew = (xRectangle *) xalloc(size);
+ prectsNew = (xRectangle *) malloc(size);
if (!prectsNew && size)
return BadAlloc;
diff --git a/nx-X11/programs/Xserver/dix/glyphcurs.c b/nx-X11/programs/Xserver/dix/glyphcurs.c
index f715a327f..a1da68443 100644
--- a/nx-X11/programs/Xserver/dix/glyphcurs.c
+++ b/nx-X11/programs/Xserver/dix/glyphcurs.c
@@ -93,7 +93,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
pScreen = screenInfo.screens[0];
nby = BitmapBytePad(cm->width) * (long)cm->height;
- pbits = (char *)xalloc(nby);
+ pbits = (char *)malloc(nby);
if (!pbits)
return BadAlloc;
/* zeroing the (pad) bits seems to help some ddx cursor handling */
@@ -108,7 +108,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
(*pScreen->DestroyPixmap)(ppix);
if (pGC)
FreeScratchGC(pGC);
- xfree(pbits);
+ free(pbits);
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c
index 839e930b1..d72ef3f6a 100644
--- a/nx-X11/programs/Xserver/dix/grabs.c
+++ b/nx-X11/programs/Xserver/dix/grabs.c
@@ -84,7 +84,7 @@ CreateGrab(
{
GrabPtr grab;
- grab = (GrabPtr)xalloc(sizeof(GrabRec));
+ grab = (GrabPtr)malloc(sizeof(GrabRec));
if (!grab)
return (GrabPtr)NULL;
grab->resource = FakeClientID(client);
@@ -116,15 +116,15 @@ static void
FreeGrab(GrabPtr pGrab)
{
if (pGrab->modifiersDetail.pMask != NULL)
- xfree(pGrab->modifiersDetail.pMask);
+ free(pGrab->modifiersDetail.pMask);
if (pGrab->detail.pMask != NULL)
- xfree(pGrab->detail.pMask);
+ free(pGrab->detail.pMask);
if (pGrab->cursor)
FreeCursor(pGrab->cursor, (Cursor)0);
- xfree(pGrab);
+ free(pGrab);
}
int
@@ -158,7 +158,7 @@ DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail)
register Mask *mask;
register int i;
- mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask);
+ mask = (Mask *)malloc(sizeof(Mask) * MasksPerDetailMask);
if (mask)
{
if (pDetailMask)
@@ -410,7 +410,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
for (i = 0; i < nadds; i++)
FreeResource(adds[i]->resource, RT_NONE);
for (i = 0; i < nups; i++)
- xfree(details[i]);
+ free(details[i]);
}
else
{
@@ -424,7 +424,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
}
for (i = 0; i < nups; i++)
{
- xfree(*updates[i]);
+ free(*updates[i]);
*updates[i] = details[i];
}
}
diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c
index 25fbb8b65..de53a6593 100644
--- a/nx-X11/programs/Xserver/dix/main.c
+++ b/nx-X11/programs/Xserver/dix/main.c
@@ -310,12 +310,12 @@ main(int argc, char *argv[], char *envp[])
{
CreateWellKnownSockets();
InitProcVectors();
- clients = (ClientPtr *)xalloc(MAXCLIENTS * sizeof(ClientPtr));
+ clients = (ClientPtr *)malloc(MAXCLIENTS * sizeof(ClientPtr));
if (!clients)
FatalError("couldn't create client array");
for (i=1; i<MAXCLIENTS; i++)
clients[i] = NullClient;
- serverClient = (ClientPtr)xalloc(sizeof(ClientRec));
+ serverClient = (ClientPtr)malloc(sizeof(ClientRec));
if (!serverClient)
FatalError("couldn't create server client");
InitClient(serverClient, 0, (void *)NULL);
@@ -474,7 +474,7 @@ main(int argc, char *argv[], char *envp[])
#endif
FreeAuditTimer();
- xfree(serverClient->devPrivates);
+ free(serverClient->devPrivates);
serverClient->devPrivates = NULL;
if (dispatchException & DE_TERMINATE)
@@ -490,7 +490,7 @@ main(int argc, char *argv[], char *envp[])
break;
}
- xfree(ConnectionInfo);
+ free(ConnectionInfo);
ConnectionInfo = NULL;
}
return(0);
@@ -556,7 +556,7 @@ CreateConnectionBlock()
((setup.nbytesVendor + 3) & ~3) +
(setup.numFormats * sizeof(xPixmapFormat)) +
(setup.numRoots * sizeof(xWindowRoot));
- ConnectionInfo = (char *) xalloc(lenofblock);
+ ConnectionInfo = (char *) malloc(lenofblock);
if (!ConnectionInfo)
return FALSE;
@@ -618,10 +618,10 @@ CreateConnectionBlock()
{
lenofblock += sizeof(xDepth) +
(pDepth->numVids * sizeof(xVisualType));
- pBuf = (char *)xrealloc(ConnectionInfo, lenofblock);
+ pBuf = (char *)realloc(ConnectionInfo, lenofblock);
if (!pBuf)
{
- xfree(ConnectionInfo);
+ free(ConnectionInfo);
return FALSE;
}
ConnectionInfo = pBuf;
@@ -689,15 +689,15 @@ AddScreen(
if (i == MAXSCREENS)
return -1;
- pScreen = (ScreenPtr) xcalloc(1, sizeof(ScreenRec));
+ pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec));
if (!pScreen)
return -1;
- pScreen->devPrivates = (DevUnion *)xcalloc(sizeof(DevUnion),
+ pScreen->devPrivates = (DevUnion *)calloc(sizeof(DevUnion),
screenPrivateCount);
if (!pScreen->devPrivates && screenPrivateCount)
{
- xfree(pScreen);
+ free(pScreen);
return -1;
}
pScreen->myNum = i;
@@ -782,11 +782,11 @@ static void
FreeScreen(ScreenPtr pScreen)
{
pScreen->root = NullWindow;
- xfree(pScreen->WindowPrivateSizes);
- xfree(pScreen->GCPrivateSizes);
+ free(pScreen->WindowPrivateSizes);
+ free(pScreen->GCPrivateSizes);
#ifdef PIXPRIV
- xfree(pScreen->PixmapPrivateSizes);
+ free(pScreen->PixmapPrivateSizes);
#endif
- xfree(pScreen->devPrivates);
- xfree(pScreen);
+ free(pScreen->devPrivates);
+ free(pScreen);
}
diff --git a/nx-X11/programs/Xserver/dix/pixmap.c b/nx-X11/programs/Xserver/dix/pixmap.c
index 463e31598..246d26067 100644
--- a/nx-X11/programs/Xserver/dix/pixmap.c
+++ b/nx-X11/programs/Xserver/dix/pixmap.c
@@ -128,7 +128,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
* the pixmap buffer. This may be a RENDER bug.
*/
- pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize + 4);
+ pPixmap = (PixmapPtr)malloc(pScreen->totalPixmapSize + pixDataSize + 4);
if (!pPixmap)
return NullPixmap;
ppriv = (DevUnion *)(pPixmap + 1);
@@ -146,7 +146,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
ppriv->ptr = (void *)NULL;
}
#else
- pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
+ pPixmap = (PixmapPtr)malloc(sizeof(PixmapRec) + pixDataSize);
#endif
return pPixmap;
}
diff --git a/nx-X11/programs/Xserver/dix/privates.c b/nx-X11/programs/Xserver/dix/privates.c
index d08883d1d..15a9dff4d 100644
--- a/nx-X11/programs/Xserver/dix/privates.c
+++ b/nx-X11/programs/Xserver/dix/privates.c
@@ -66,7 +66,7 @@ ResetClientPrivates()
{
clientPrivateCount = 0;
clientPrivateLen = 0;
- xfree(clientPrivateSizes);
+ free(clientPrivateSizes);
clientPrivateSizes = (unsigned *)NULL;
totalClientSize =
((sizeof(ClientRec) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
@@ -89,7 +89,7 @@ AllocateClientPrivate(int index2, unsigned amount)
if (index2 >= clientPrivateLen)
{
unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(clientPrivateSizes,
+ nsizes = (unsigned *)realloc(clientPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
@@ -136,7 +136,7 @@ AllocateScreenPrivateIndex()
for (i = 0; i < screenInfo.numScreens; i++)
{
pScreen = screenInfo.screens[i];
- nprivs = (DevUnion *)xrealloc(pScreen->devPrivates,
+ nprivs = (DevUnion *)realloc(pScreen->devPrivates,
screenPrivateCount * sizeof(DevUnion));
if (!nprivs)
{
@@ -180,7 +180,7 @@ AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->WindowPrivateLen)
{
unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->WindowPrivateSizes,
+ nsizes = (unsigned *)realloc(pScreen->WindowPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
@@ -230,7 +230,7 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->GCPrivateLen)
{
unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->GCPrivateSizes,
+ nsizes = (unsigned *)realloc(pScreen->GCPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
@@ -280,7 +280,7 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
if (index2 >= pScreen->PixmapPrivateLen)
{
unsigned *nsizes;
- nsizes = (unsigned *)xrealloc(pScreen->PixmapPrivateSizes,
+ nsizes = (unsigned *)realloc(pScreen->PixmapPrivateSizes,
(index2 + 1) * sizeof(unsigned));
if (!nsizes)
return FALSE;
@@ -345,7 +345,7 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc)
if (pColormap)
{
- privs = (DevUnion *) xrealloc (pColormap->devPrivates,
+ privs = (DevUnion *) realloc (pColormap->devPrivates,
colormapPrivateCount * sizeof(DevUnion));
if (!privs) {
colormapPrivateCount--;
@@ -380,7 +380,7 @@ Bool
AllocateDevicePrivate(DeviceIntPtr device, int index)
{
if (device->nPrivates < ++index) {
- DevUnion *nprivs = (DevUnion *) xrealloc(device->devPrivates,
+ DevUnion *nprivs = (DevUnion *) realloc(device->devPrivates,
index * sizeof(DevUnion));
if (!nprivs)
return FALSE;
diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c
index b3b650dda..7ed66b60a 100644
--- a/nx-X11/programs/Xserver/dix/property.c
+++ b/nx-X11/programs/Xserver/dix/property.c
@@ -284,13 +284,13 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (!pWin->optional && !MakeWindowOptional (pWin))
return(BadAlloc);
- pProp = (PropertyPtr)xalloc(sizeof(PropertyRec));
+ pProp = (PropertyPtr)malloc(sizeof(PropertyRec));
if (!pProp)
return(BadAlloc);
- data = (void *)xalloc(totalSize);
+ data = (void *)malloc(totalSize);
if (!data && len)
{
- xfree(pProp);
+ free(pProp);
return(BadAlloc);
}
pProp->propertyName = property;
@@ -318,7 +318,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (totalSize != pProp->size * (pProp->format >> 3))
{
- data = (void *)xrealloc(pProp->data, totalSize);
+ data = (void *)realloc(pProp->data, totalSize);
if (!data && len)
return(BadAlloc);
pProp->data = data;
@@ -335,7 +335,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModeAppend)
{
- data = (void *)xrealloc(pProp->data,
+ data = (void *)realloc(pProp->data,
sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
@@ -347,13 +347,13 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModePrepend)
{
- data = (void *)xalloc(sizeInBytes * (len + pProp->size));
+ data = (void *)malloc(sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
memmove(&((char *)data)[totalSize], (char *)pProp->data,
(int)(pProp->size * sizeInBytes));
memmove((char *)data, (char *)value, totalSize);
- xfree(pProp->data);
+ free(pProp->data);
pProp->data = data;
pProp->size += len;
}
@@ -404,8 +404,8 @@ DeleteProperty(WindowPtr pWin, Atom propName)
event.u.property.atom = pProp->propertyName;
event.u.property.time = currentTime.milliseconds;
DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
- xfree(pProp->data);
- xfree(pProp);
+ free(pProp->data);
+ free(pProp);
}
return(Success);
}
@@ -426,8 +426,8 @@ DeleteAllWindowProperties(WindowPtr pWin)
event.u.property.time = currentTime.milliseconds;
DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
pNextProp = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
+ free(pProp->data);
+ free(pProp);
pProp = pNextProp;
}
}
@@ -599,8 +599,8 @@ ProcGetProperty(ClientPtr client)
}
else
prevProp->next = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
+ free(pProp->data);
+ free(pProp);
}
return(client->noClientException);
}
diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c
index e927b9fde..f2b7224f8 100644
--- a/nx-X11/programs/Xserver/dix/region.c
+++ b/nx-X11/programs/Xserver/dix/region.c
@@ -172,7 +172,7 @@ Equipment Corporation.
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
-#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
+#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
#define RECTALLOC_BAIL(pReg,n,bail) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
@@ -210,7 +210,7 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
size_t NewSize = RegionSizeof(numRects); \
RegDataPtr NewData = \
- (NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \
+ (NewSize > 0) ? (RegDataPtr)realloc((reg)->data, NewSize) : NULL; \
if (NewData) \
{ \
NewData->size = (numRects); \
@@ -311,7 +311,7 @@ RegionCreate(rect, size)
{
register RegionPtr pReg;
size_t newSize;
- pReg = (RegionPtr)xalloc(sizeof(RegionRec));
+ pReg = (RegionPtr)malloc(sizeof(RegionRec));
if (!pReg)
return &RegionBrokenRegion;
if (rect)
@@ -324,7 +324,7 @@ RegionCreate(rect, size)
pReg->extents = RegionEmptyBox;
newSize = RegionSizeof(size);
if ((size > 1) && (newSize > 0) &&
- (pReg->data = xalloc(newSize)))
+ (pReg->data = malloc(newSize)))
{
pReg->data->size = size;
pReg->data->numRects = 0;
@@ -342,7 +342,7 @@ RegionDestroy(pReg)
good(pReg);
xfreeData(pReg);
if (pReg != &RegionBrokenRegion)
- xfree(pReg);
+ free(pReg);
}
Bool
@@ -367,7 +367,7 @@ RegionRectAlloc(
{
n++;
rgnSize = RegionSizeof(n);
- pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL;
+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
if (!pRgn->data)
return RegionBreak (pRgn);
pRgn->data->numRects = 1;
@@ -376,7 +376,7 @@ RegionRectAlloc(
else if (!pRgn->data->size)
{
rgnSize = RegionSizeof(n);
- pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL;
+ pRgn->data = (rgnSize > 0) ? malloc(rgnSize) : NULL;
if (!pRgn->data)
return RegionBreak (pRgn);
pRgn->data->numRects = 0;
@@ -391,7 +391,7 @@ RegionRectAlloc(
}
n += pRgn->data->numRects;
rgnSize = RegionSizeof(n);
- data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL;
+ data = (rgnSize > 0) ? realloc(pRgn->data, rgnSize) : NULL;
if (!data)
return RegionBreak (pRgn);
pRgn->data = data;
@@ -795,7 +795,7 @@ RegionOp(
}
if (oldData)
- xfree(oldData);
+ free(oldData);
if (!(numRects = newReg->data->numRects))
{
@@ -1235,7 +1235,7 @@ RegionValidate(badreg, pOverlap)
/* Set up the first region to be the first rectangle in badreg */
/* Note that step 2 code will never overflow the ri[0].reg rects array */
- ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo));
+ ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo));
if (!ri)
return RegionBreak (badreg);
sizeRI = 4;
@@ -1299,7 +1299,7 @@ RegionValidate(badreg, pOverlap)
{
/* Oops, allocate space for new region information */
sizeRI <<= 1;
- rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo));
+ rit = (RegionInfo *) realloc(ri, sizeRI * sizeof(RegionInfo));
if (!rit)
goto bail;
ri = rit;
@@ -1355,13 +1355,13 @@ NextRect: ;
numRI -= half;
}
*badreg = ri[0].reg;
- xfree(ri);
+ free(ri);
good(badreg);
return ret;
bail:
for (i = 0; i < numRI; i++)
xfreeData(&ri[i].reg);
- xfree (ri);
+ free (ri);
return RegionBreak (badreg);
}
@@ -1402,7 +1402,7 @@ RegionFromRects(nrects, prect, ctype)
return pRgn;
}
newSize = RegionSizeof(nrects);
- pData = newSize > 0 ? xalloc(newSize) : NULL;
+ pData = newSize > 0 ? malloc(newSize) : NULL;
if (!pData)
{
RegionBreak (pRgn);
@@ -1443,7 +1443,7 @@ RegionFromRects(nrects, prect, ctype)
}
else
{
- xfree (pData);
+ free (pData);
}
return pRgn;
}
@@ -1469,7 +1469,7 @@ miRegionDataCopy(
{
size_t newSize = RegionSizeof(src->data->numRects);
xfreeData(dst);
- dst->data = newSize > 0 ? xalloc(newSize) : NULL;
+ dst->data = newSize > 0 ? malloc(newSize) : NULL;
if (!dst->data)
return RegionBreak (dst);
}
diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c
index b0edbb2aa..40a063891 100644
--- a/nx-X11/programs/Xserver/dix/resource.c
+++ b/nx-X11/programs/Xserver/dix/resource.c
@@ -178,7 +178,7 @@ CreateNewResourceType(DeleteType deleteFunc)
if (next & lastResourceClass)
return 0;
- funcs = (DeleteType *)xrealloc(DeleteFuncs,
+ funcs = (DeleteType *)realloc(DeleteFuncs,
(next + 1) * sizeof(DeleteType));
if (!funcs)
return 0;
@@ -186,7 +186,7 @@ CreateNewResourceType(DeleteType deleteFunc)
#ifdef XResExtension
{
Atom *newnames;
- newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom));
+ newnames = realloc(ResourceNames, (next + 1) * sizeof(Atom));
if(!newnames)
return 0;
ResourceNames = newnames;
@@ -231,8 +231,8 @@ InitClientResources(ClientPtr client)
lastResourceClass = RC_LASTPREDEF;
TypeMask = RC_LASTPREDEF - 1;
if (DeleteFuncs)
- xfree(DeleteFuncs);
- DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) *
+ free(DeleteFuncs);
+ DeleteFuncs = (DeleteType *)malloc((lastResourceType + 1) *
sizeof(DeleteType));
if (!DeleteFuncs)
return FALSE;
@@ -249,14 +249,14 @@ InitClientResources(ClientPtr client)
#ifdef XResExtension
if(ResourceNames)
- xfree(ResourceNames);
- ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom));
+ free(ResourceNames);
+ ResourceNames = malloc((lastResourceType + 1) * sizeof(Atom));
if(!ResourceNames)
return FALSE;
#endif
}
clientTable[i = client->index].resources =
- (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr));
+ (ResourcePtr *)malloc(INITBUCKETS*sizeof(ResourcePtr));
if (!clientTable[i].resources)
return FALSE;
clientTable[i].buckets = INITBUCKETS;
@@ -442,7 +442,7 @@ AddResource(XID id, RESTYPE type, void * value)
(rrec->hashsize < MAXHASHSIZE))
RebuildTable(client);
head = &rrec->resources[Hash(client, id)];
- res = (ResourcePtr)xalloc(sizeof(ResourceRec));
+ res = (ResourcePtr)malloc(sizeof(ResourceRec));
if (!res)
{
(*DeleteFuncs[type & TypeMask])(value, id);
@@ -477,7 +477,7 @@ RebuildTable(int client)
tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *));
if (!tails)
return;
- resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr));
+ resources = (ResourcePtr *)malloc(j * sizeof(ResourcePtr));
if (!resources)
{
DEALLOCATE_LOCAL(tails);
@@ -505,7 +505,7 @@ RebuildTable(int client)
}
DEALLOCATE_LOCAL(tails);
clientTable[client].buckets *= 2;
- xfree(clientTable[client].resources);
+ free(clientTable[client].resources);
clientTable[client].resources = resources;
}
@@ -535,7 +535,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
elements = --*eltptr;
if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
- xfree(res);
+ free(res);
if (*eltptr != elements)
prev = head; /* prev may no longer be valid */
gotOne = TRUE;
@@ -568,7 +568,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
*prev = res->next;
if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id);
- xfree(res);
+ free(res);
break;
}
else
@@ -723,7 +723,7 @@ FreeClientNeverRetainResources(ClientPtr client)
{
*prev = this->next;
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
- xfree(this);
+ free(this);
}
else
prev = &this->next;
@@ -767,10 +767,10 @@ FreeClientResources(ClientPtr client)
RESTYPE rtype = this->type;
*head = this->next;
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
- xfree(this);
+ free(this);
}
}
- xfree(clientTable[client->index].resources);
+ free(clientTable[client->index].resources);
clientTable[client->index].resources = NULL;
clientTable[client->index].buckets = 0;
}
diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c
index 708b67aa1..f4c10f11d 100644
--- a/nx-X11/programs/Xserver/dix/window.c
+++ b/nx-X11/programs/Xserver/dix/window.c
@@ -344,7 +344,7 @@ AllocateWindow(ScreenPtr pScreen)
register unsigned size;
register int i;
- pWin = (WindowPtr)xalloc(pScreen->totalWindowSize);
+ pWin = (WindowPtr)malloc(pScreen->totalWindowSize);
if (pWin)
{
ppriv = (DevUnion *)(pWin + 1);
@@ -403,7 +403,7 @@ CreateRootWindow(ScreenPtr pScreen)
pWin->parent = NullWindow;
SetWindowToDefaults(pWin);
- pWin->optional = (WindowOptRec *) xalloc (sizeof (WindowOptRec));
+ pWin->optional = (WindowOptRec *) malloc (sizeof (WindowOptRec));
if (!pWin->optional)
return FALSE;
@@ -682,7 +682,7 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w,
{
if (!MakeWindowOptional (pWin))
{
- xfree (pWin);
+ free (pWin);
*error = BadAlloc;
return NullWindow;
}
@@ -864,7 +864,7 @@ CrushTree(WindowPtr pWin)
(*UnrealizeWindow)(pChild);
}
FreeWindowResources(pChild);
- xfree(pChild);
+ free(pChild);
if ( (pChild = pSib) )
break;
pChild = pParent;
@@ -916,7 +916,7 @@ DeleteWindow(void * value, XID wid)
if (pWin->prevSib)
pWin->prevSib->nextSib = pWin->nextSib;
}
- xfree(pWin);
+ free(pWin);
return Success;
}
#endif /* NXAGENT_SERVER */
@@ -3147,7 +3147,7 @@ HandleSaveSet(register ClientPtr client)
MapWindow(pWin, client);
}
}
- xfree(client->saveSet);
+ free(client->saveSet);
client->numSaved = 0;
client->saveSet = (SaveSetElt *)NULL;
}
@@ -3445,12 +3445,12 @@ TileScreenSaver(int i, int kind)
cm.height=16;
cm.xhot=8;
cm.yhot=8;
- srcbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
- mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
+ srcbits = (unsigned char *)malloc( BitmapBytePad(32)*16);
+ mskbits = (unsigned char *)malloc( BitmapBytePad(32)*16);
if (!srcbits || !mskbits)
{
- xfree(srcbits);
- xfree(mskbits);
+ free(srcbits);
+ free(mskbits);
cursor = 0;
}
else
@@ -3471,8 +3471,8 @@ TileScreenSaver(int i, int kind)
}
else
{
- xfree (srcbits);
- xfree (mskbits);
+ free (srcbits);
+ free (mskbits);
}
}
@@ -3595,7 +3595,7 @@ MakeWindowOptional (register WindowPtr pWin)
if (pWin->optional)
return TRUE;
- optional = (WindowOptPtr) xalloc (sizeof (WindowOptRec));
+ optional = (WindowOptPtr) malloc (sizeof (WindowOptRec));
if (!optional)
return FALSE;
optional->dontPropagateMask = DontPropagateMasks[pWin->dontPropagate];
@@ -3660,7 +3660,7 @@ DisposeWindowOptional (register WindowPtr pWin)
}
else
pWin->cursorIsNone = TRUE;
- xfree (pWin->optional);
+ free (pWin->optional);
pWin->optional = NULL;
}
diff --git a/nx-X11/programs/Xserver/fb/fballpriv.c b/nx-X11/programs/Xserver/fb/fballpriv.c
index c1cd834f1..638e71621 100644
--- a/nx-X11/programs/Xserver/fb/fballpriv.c
+++ b/nx-X11/programs/Xserver/fb/fballpriv.c
@@ -83,7 +83,7 @@ fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex)
{
FbScreenPrivPtr pScreenPriv;
- pScreenPriv = (FbScreenPrivPtr) xalloc (sizeof (FbScreenPrivRec));
+ pScreenPriv = (FbScreenPrivPtr) malloc (sizeof (FbScreenPrivRec));
if (!pScreenPriv)
return FALSE;
pScreen->devPrivates[fbScreenPrivateIndex].ptr = (void *) pScreenPriv;
diff --git a/nx-X11/programs/Xserver/fb/fbcmap.c b/nx-X11/programs/Xserver/fb/fbcmap.c
index a7c8ca638..656cafbb8 100644
--- a/nx-X11/programs/Xserver/fb/fbcmap.c
+++ b/nx-X11/programs/Xserver/fb/fbcmap.c
@@ -390,7 +390,7 @@ fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
{
fbVisualsPtr new, *prev, v;
- new = (fbVisualsPtr) xalloc (sizeof *new);
+ new = (fbVisualsPtr) malloc (sizeof *new);
if (!new)
return FALSE;
if (!redMask || !greenMask || !blueMask)
@@ -487,12 +487,12 @@ fbInitVisuals (VisualPtr *visualp,
ndepth++;
nvisual += visuals->count;
}
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
+ depth = (DepthPtr) malloc (ndepth * sizeof (DepthRec));
+ visual = (VisualPtr) malloc (nvisual * sizeof (VisualRec));
if (!depth || !visual)
{
- xfree (depth);
- xfree (visual);
+ free (depth);
+ free (visual);
return FALSE;
}
*depthp = depth;
@@ -508,7 +508,7 @@ fbInitVisuals (VisualPtr *visualp,
vid = NULL;
if (nvtype)
{
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
+ vid = (VisualID *) malloc (nvtype * sizeof (VisualID));
if (!vid)
return FALSE;
}
@@ -549,7 +549,7 @@ fbInitVisuals (VisualPtr *visualp,
vid++;
visual++;
}
- xfree (visuals);
+ free (visuals);
}
fbVisuals = NULL;
visual = *visualp;
diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c
index f68811ebb..e936fcc9a 100644
--- a/nx-X11/programs/Xserver/fb/fbcopy.c
+++ b/nx-X11/programs/Xserver/fb/fbcopy.c
@@ -244,7 +244,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
height = pbox->y2 - pbox->y1;
tmpStride = ((width + FB_STIP_MASK) >> FB_STIP_SHIFT);
- tmp = xalloc (tmpStride * height * sizeof (FbStip));
+ tmp = malloc (tmpStride * height * sizeof (FbStip));
if (!tmp)
return;
@@ -282,7 +282,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
pPriv->and, pPriv->xor,
pPriv->bgand, pPriv->bgxor);
- xfree (tmp);
+ free (tmp);
}
pbox++;
}
diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c
index 49623ba4f..a98a131c9 100644
--- a/nx-X11/programs/Xserver/fb/fboverlay.c
+++ b/nx-X11/programs/Xserver/fb/fboverlay.c
@@ -363,7 +363,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
fbOverlayGeneration = serverGeneration;
}
- pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec));
+ pScrPriv = malloc (sizeof (FbOverlayScrPrivRec));
if (!pScrPriv)
return FALSE;
diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c
index 99c03862b..c562da221 100644
--- a/nx-X11/programs/Xserver/fb/fbpixmap.c
+++ b/nx-X11/programs/Xserver/fb/fbpixmap.c
@@ -104,7 +104,7 @@ fbDestroyPixmap (PixmapPtr pPixmap)
{
if(--pPixmap->refcnt)
return TRUE;
- xfree(pPixmap);
+ free(pPixmap);
return TRUE;
}
@@ -309,7 +309,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->extents.y2 = RegionEnd(pReg)->y2;
if (pReg->data->numRects == 1)
{
- xfree(pReg->data);
+ free(pReg->data);
pReg->data = (RegDataPtr)NULL;
}
}
diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c
index 51f21ed21..c22309a93 100644
--- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c
+++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c
@@ -271,13 +271,13 @@ xxCreateScreenResources(ScreenPtr pScreen)
if (pScrPriv->addr)
pBits = pScrPriv->addr;
else
- pBits = xalloc(pScreen->width * pScreen->height
+ pBits = malloc(pScreen->width * pScreen->height
* (BitsPerPixel(depth) >> 3));
if (!pBits) return FALSE;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
if (!pPixmap) {
- xfree(pBits);
+ free(pBits);
return FALSE;
}
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
@@ -285,7 +285,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
BitsPerPixel(depth),
PixmapBytePad(pScreen->width, depth),
pBits)) {
- xfree(pBits);
+ free(pBits);
return FALSE;
}
if (pScreen->rootDepth == pScrPriv->myDepth) {
@@ -295,7 +295,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
PixmapBytePad(pScreen->width,
pScrPriv->depth),
0)) {
- xfree(pBits);
+ free(pBits);
return FALSE;
}
}
@@ -328,9 +328,9 @@ xxCloseScreen (int iScreen, ScreenPtr pScreen)
unwrap (pScrPriv,pScreen, CloseScreen);
ret = pScreen->CloseScreen(iScreen,pScreen);
- xfree(pScrPriv->pBits);
- xfree(pScrPriv->InstalledCmaps);
- xfree(pScrPriv);
+ free(pScrPriv->pBits);
+ free(pScrPriv->InstalledCmaps);
+ free(pScrPriv);
return TRUE;
}
@@ -370,11 +370,11 @@ xxInitColormapPrivate(ColormapPtr pmap)
if (xxMyVisual(pmap->pScreen,pmap->pVisual->vid)) {
DBG("CreateColormap\n");
- pCmapPriv = (xxCmapPrivPtr) xalloc (sizeof (xxCmapPrivRec));
+ pCmapPriv = (xxCmapPrivPtr) malloc (sizeof (xxCmapPrivRec));
if (!pCmapPriv)
return FALSE;
pmap->devPrivates[xxColormapPrivateIndex].ptr = (void *) pCmapPriv;
- cmap = xalloc(sizeof (CARD32) * (1 << pScrPriv->myDepth));
+ cmap = malloc(sizeof (CARD32) * (1 << pScrPriv->myDepth));
if (!cmap)
return FALSE;
@@ -456,8 +456,8 @@ xxDestroyColormap(ColormapPtr pmap)
tmpCmapPriv = tmpCmapPriv->next;
}
- xfree(pCmapPriv->cmap);
- xfree(pCmapPriv);
+ free(pCmapPriv->cmap);
+ free(pCmapPriv);
}
unwrap(pScrPriv,pmap->pScreen, DestroyColormap);
@@ -1109,7 +1109,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
if (!AllocateGCPrivate (pScreen, xxGCPrivateIndex, sizeof (xxGCPrivRec)))
return FALSE;
- pScrPriv = (xxScrPrivPtr) xalloc (sizeof (xxScrPrivRec));
+ pScrPriv = (xxScrPrivPtr) malloc (sizeof (xxScrPrivRec));
if (!pScrPriv)
return FALSE;
@@ -1150,7 +1150,7 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy
pScrPriv->sync = sync;
pScreen->maxInstalledCmaps += MAX_NUM_XX_INSTALLED_CMAPS;
- pScrPriv->InstalledCmaps = xcalloc(MAX_NUM_XX_INSTALLED_CMAPS,
+ pScrPriv->InstalledCmaps = calloc(MAX_NUM_XX_INSTALLED_CMAPS,
sizeof(ColormapPtr));
if (!pScrPriv->InstalledCmaps)
return FALSE;
diff --git a/nx-X11/programs/Xserver/fb/fbscreen.c b/nx-X11/programs/Xserver/fb/fbscreen.c
index 342fd5784..0600cebfe 100644
--- a/nx-X11/programs/Xserver/fb/fbscreen.c
+++ b/nx-X11/programs/Xserver/fb/fbscreen.c
@@ -36,12 +36,12 @@ fbCloseScreen (int index, ScreenPtr pScreen)
DepthPtr depths = pScreen->allowedDepths;
for (d = 0; d < pScreen->numDepths; d++)
- xfree (depths[d].vids);
- xfree (depths);
- xfree (pScreen->visuals);
- xfree (pScreen->devPrivate);
+ free (depths[d].vids);
+ free (depths);
+ free (pScreen->visuals);
+ free (pScreen->devPrivate);
#ifdef FB_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
+ free (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
#endif
return TRUE;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 6e6d61772..895de1ef8 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -355,14 +355,14 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (nxagentOptionFile != NULL)
{
- xfree(nxagentOptionFile);
+ free(nxagentOptionFile);
nxagentOptionFile = NULL;
}
if ((size = strlen(argv[i])) < 1024)
{
- if ((nxagentOptionFile = xalloc(size + 1)) == NULL)
+ if ((nxagentOptionFile = malloc(size + 1)) == NULL)
{
FatalError("malloc failed");
}
@@ -719,14 +719,14 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (nxagentKeyboard != NULL)
{
- xfree(nxagentKeyboard);
+ free(nxagentKeyboard);
nxagentKeyboard = NULL;
}
if ((size = strlen(argv[i])) < 256)
{
- if ((nxagentKeyboard = xalloc(size + 1)) == NULL)
+ if ((nxagentKeyboard = malloc(size + 1)) == NULL)
{
FatalError("malloc failed");
}
@@ -1537,7 +1537,7 @@ void nxagentProcessOptionsFile()
goto nxagentProcessOptionsFileClose;
}
- if ((data = xalloc(sizeOfFile + 1)) == NULL)
+ if ((data = malloc(sizeOfFile + 1)) == NULL)
{
fprintf(stderr, "Warning: Memory allocation failed processing file '%s'.\n",
validateString(nxagentOptionFile));
@@ -1591,7 +1591,7 @@ nxagentProcessOptionsFileFree:
if (data != NULL)
{
- Xfree(data);
+ free(data);
}
nxagentProcessOptionsFileClose:
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index a0dfbf602..2fb53d440 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -745,7 +745,7 @@ void nxagentCollectPropertyEvent(int resource)
if (pszReturnData != NULL)
{
- Xfree(pszReturnData);
+ free(pszReturnData);
}
return;
@@ -787,7 +787,7 @@ void nxagentCollectPropertyEvent(int resource)
if (pszReturnData != NULL)
{
- Xfree(pszReturnData);
+ free(pszReturnData);
}
return;
@@ -1487,11 +1487,11 @@ int nxagentInitClipboard(WindowPtr pWin)
if (lastSelectionOwner != NULL)
{
- xfree(lastSelectionOwner);
+ free(lastSelectionOwner);
lastSelectionOwner = NULL;
}
- lastSelectionOwner = (SelectionOwner *) xalloc(2 * sizeof(SelectionOwner));
+ lastSelectionOwner = (SelectionOwner *) malloc(2 * sizeof(SelectionOwner));
if (lastSelectionOwner == NULL)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
index fe3b6ce1d..3905e289b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c
@@ -77,7 +77,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pVisual = pCmap->pVisual;
ncolors = pVisual->ColormapEntries;
- pCmap->devPriv = (void *)xalloc(sizeof(nxagentPrivColormap));
+ pCmap->devPriv = (void *)malloc(sizeof(nxagentPrivColormap));
if (((visual = nxagentVisual(pVisual))) == NULL)
{
@@ -103,7 +103,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
switch (class) {
case StaticGray: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
+ colors = (XColor *)malloc(ncolors * sizeof(XColor));
for (i = 0; i < ncolors; i++)
colors[i].pixel = i;
XQueryColors(nxagentDisplay, nxagentColormap(pCmap), colors, ncolors);
@@ -112,11 +112,11 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].red;
pCmap->red[i].co.local.blue = colors[i].red;
}
- xfree(colors);
+ free(colors);
break;
case StaticColor: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
+ colors = (XColor *)malloc(ncolors * sizeof(XColor));
for (i = 0; i < ncolors; i++)
colors[i].pixel = i;
XQueryColors(nxagentDisplay, nxagentColormap(pCmap), colors, ncolors);
@@ -125,11 +125,11 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].green;
pCmap->red[i].co.local.blue = colors[i].blue;
}
- xfree(colors);
+ free(colors);
break;
case TrueColor: /* read only */
- colors = (XColor *)xalloc(ncolors * sizeof(XColor));
+ colors = (XColor *)malloc(ncolors * sizeof(XColor));
red = green = blue = 0L;
redInc = lowbit(pVisual->redMask);
greenInc = lowbit(pVisual->greenMask);
@@ -149,7 +149,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->green[i].co.local.green = colors[i].green;
pCmap->blue[i].co.local.blue = colors[i].blue;
}
- xfree(colors);
+ free(colors);
break;
case GrayScale: /* read and write */
@@ -168,7 +168,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
void nxagentDestroyColormap(ColormapPtr pCmap)
{
XFreeColormap(nxagentDisplay, nxagentColormap(pCmap));
- xfree(pCmap->devPriv);
+ free(pCmap->devPriv);
}
#define SEARCH_PREDICATE \
@@ -229,13 +229,13 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
nxagentInstalledColormapWindows icws;
int numWindows;
- icws.cmapIDs = (Colormap *)xalloc(pScreen->maxInstalledCmaps *
+ icws.cmapIDs = (Colormap *)malloc(pScreen->maxInstalledCmaps *
sizeof(Colormap));
icws.numCmapIDs = nxagentListInstalledColormaps(pScreen, icws.cmapIDs);
icws.numWindows = 0;
WalkTree(pScreen, nxagentCountInstalledColormapWindows, (void *)&icws);
if (icws.numWindows) {
- icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window));
+ icws.windows = (Window *)malloc((icws.numWindows + 1) * sizeof(Window));
icws.index = 0;
WalkTree(pScreen, nxagentGetInstalledColormapWindows, (void *)&icws);
icws.windows[icws.numWindows] = nxagentDefaultWindows[pScreen->myNum];
@@ -246,22 +246,22 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
numWindows = 0;
}
- xfree(icws.cmapIDs);
+ free(icws.cmapIDs);
if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
if (nxagentOldInstalledColormapWindows)
- xfree(nxagentOldInstalledColormapWindows);
+ free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64
{
int i;
- Window64 *windows = (Window64 *)xalloc(numWindows * sizeof(Window64));
+ Window64 *windows = (Window64 *)malloc(numWindows * sizeof(Window64));
for(i = 0; i < numWindows; ++i)
windows[i] = icws.windows[i];
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
windows, numWindows);
- xfree(windows);
+ free(windows);
}
#else
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
@@ -310,13 +310,13 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#endif /* DUMB_WINDOW_MANAGERS */
}
else
- if (icws.windows) xfree(icws.windows);
+ if (icws.windows) free(icws.windows);
}
void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen)
{
if (nxagentOldInstalledColormapWindows)
- xfree(nxagentOldInstalledColormapWindows);
+ free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64
{
@@ -437,7 +437,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
#ifdef _XSERVER64
{
int i;
- XColor *pColors64 = (XColor *)xalloc(nColors * sizeof(XColor) );
+ XColor *pColors64 = (XColor *)malloc(nColors * sizeof(XColor) );
for(i = 0; i < nColors; ++i)
{
@@ -448,7 +448,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
pColors64[i].flags = pColors[i].flags;
}
XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors);
- xfree(pColors64);
+ free(pColors64);
}
#else
XStoreColors(nxagentDisplay, nxagentColormap(pCmap),
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
index 62095d5b3..932f7495f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
@@ -231,7 +231,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
bg_color.green = pCursor->backGreen;
bg_color.blue = pCursor->backBlue;
- pCursor->devPriv[pScreen->myNum] = (void *) xalloc(sizeof(nxagentPrivCursor));
+ pCursor->devPriv[pScreen->myNum] = (void *) malloc(sizeof(nxagentPrivCursor));
nxagentCursorPriv(pCursor, pScreen)->cursor =
XCreatePixmapCursor(nxagentDisplay, source, mask, &fg_color,
@@ -267,7 +267,7 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
nxagentCursor(pCursor, pScreen) = None;
}
- xfree(nxagentCursorPriv(pCursor, pScreen));
+ free(nxagentCursorPriv(pCursor, pScreen));
return True;
}
@@ -366,7 +366,7 @@ void nxagentReconnectCursor(void * p0, XID x1, void * p2)
}
else
{
- xfree(nxagentCursorPriv(pCursor, nxagentDefaultScreen));
+ free(nxagentCursorPriv(pCursor, nxagentDefaultScreen));
if (!nxagentRealizeCursor(nxagentDefaultScreen, pCursor))
{
fprintf(stderr, "nxagentReconnectCursor: nxagentRealizeCursor failed\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 31ea7c2a0..15d1d2206 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -1272,7 +1272,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
nxagentInitVisuals();
nxagentNumDefaultColormaps = nxagentNumVisuals;
- nxagentDefaultColormaps = (Colormap *)xalloc(nxagentNumDefaultColormaps *
+ nxagentDefaultColormaps = (Colormap *)malloc(nxagentNumDefaultColormaps *
sizeof(Colormap));
for (i = 0; i < nxagentNumDefaultColormaps; i++)
@@ -1651,7 +1651,7 @@ void nxagentInitPixmapFormats()
XXX: Some X server doesn't list 1 among available depths...
*/
- nxagentPixmapFormats = xalloc((nxagentNumDepths + 1) * sizeof(XPixmapFormatValues));
+ nxagentPixmapFormats = malloc((nxagentNumDepths + 1) * sizeof(XPixmapFormatValues));
for (i = 1; i <= MAXDEPTH; i++)
{
@@ -1814,13 +1814,13 @@ void nxagentCloseDisplay()
* traffic
*/
- xfree(nxagentDefaultColormaps);
+ free(nxagentDefaultColormaps);
nxagentDefaultColormaps = NULL;
XFree(nxagentVisuals);
nxagentVisuals = NULL;
- xfree(nxagentDepths);
+ free(nxagentDepths);
nxagentDepths = NULL;
XFree(nxagentPixmapFormats);
@@ -2060,10 +2060,10 @@ void nxagentBackupDisplayInfo(void)
nxagentNumVisualsRecBackup = nxagentNumVisuals;
if (nxagentVisualHasBeenIgnored)
{
- xfree(nxagentVisualHasBeenIgnored);
+ free(nxagentVisualHasBeenIgnored);
nxagentVisualHasBeenIgnored = NULL;
}
- nxagentVisualHasBeenIgnored = xalloc(nxagentNumVisuals * sizeof(Bool));
+ nxagentVisualHasBeenIgnored = malloc(nxagentNumVisuals * sizeof(Bool));
nxagentDefaultDepthRecBackup = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay));
nxagentDisplayWidthRecBackup = DisplayWidth(nxagentDisplay, DefaultScreen(nxagentDisplay));
nxagentDisplayHeightRecBackup = DisplayHeight(nxagentDisplay, DefaultScreen(nxagentDisplay));
@@ -2074,17 +2074,17 @@ void nxagentBackupDisplayInfo(void)
void nxagentCleanupBackupDisplayInfo(void)
{
- xfree(nxagentDepthsRecBackup);
+ free(nxagentDepthsRecBackup);
nxagentNumDepthsRecBackup = 0;
nxagentNumDefaultColormapsRecBackup = 0;
- xfree(nxagentVisualsRecBackup);
+ free(nxagentVisualsRecBackup);
nxagentNumVisualsRecBackup = 0;
if (nxagentVisualHasBeenIgnored)
{
- xfree(nxagentVisualHasBeenIgnored);
+ free(nxagentVisualHasBeenIgnored);
nxagentVisualHasBeenIgnored = NULL;
}
@@ -2107,7 +2107,7 @@ void nxagentCleanupBackupDisplayInfo(void)
}
else
{
- xfree(nxagentBitmapGCBackup);
+ free(nxagentBitmapGCBackup);
}
nxagentBitmapGCBackup = NULL;
@@ -2549,7 +2549,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentNumDefaultColormaps = nxagentNumVisuals;
- nxagentDefaultColormaps = (Colormap *) xrealloc(nxagentDefaultColormaps,
+ nxagentDefaultColormaps = (Colormap *) realloc(nxagentDefaultColormaps,
nxagentNumDefaultColormaps * sizeof(Colormap));
if (nxagentDefaultColormaps == NULL)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index 377e119ab..bf88db38c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -223,7 +223,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask
length = nxagentImageLength(width, height, format, leftPad, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentSynchronizeDrawableData: WARNING! Failed to allocate memory for the operation.\n");
@@ -359,7 +359,7 @@ nxagentSynchronizeDrawableDataFree:
if (data != NULL)
{
- xfree(data);
+ free(data);
}
nxagentSynchronizeDrawableDataEnd:
@@ -860,7 +860,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (cmpData != NULL)
{
- xfree(cmpData);
+ free(cmpData);
}
}
}
@@ -1060,7 +1060,7 @@ nxagentSynchronizeRegionFree:
if (data != NULL)
{
- xfree(data);
+ free(data);
}
RegionUninit(&exposeRegion);
@@ -2129,7 +2129,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
format = (depth == 1) ? XYPixmap : ZPixmap;
length = nxagentImageLength(1, 1, format, leftPad, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentGetColor: WARNING! Failed to allocate memory for the operation.\n");
@@ -2161,7 +2161,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
fprintf(stderr, "nxagentGetColor: WARNING! Failed to create the XImage.\n");
#endif
- xfree(data);
+ free(data);
return -1;
}
@@ -2374,7 +2374,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
{
pBox = RegionRects(pRegion);
- pRects = xalloc(nrects * sizeof(XRectangle));
+ pRects = malloc(nrects * sizeof(XRectangle));
for (i = 0; i < nrects; i++)
{
@@ -2387,7 +2387,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
XFillRectangles(nxagentDisplay, nxagentDrawable(pDrawable), nxagentGC(pGC),
pRects, nrects);
- xfree(pRects);
+ free(pRects);
}
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 8f692eb85..2ef471ab1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -196,11 +196,11 @@ void nxagentFreeFontCache(void)
nxagentFreeFont(CACHE_FSTRUCT(i));
}
- xfree(CACHE_NAME(i));
- xfree(CACHE_ENTRY(i));
+ free(CACHE_NAME(i));
+ free(CACHE_ENTRY(i));
}
- xfree(CACHE_ENTRY_PTR);
+ free(CACHE_ENTRY_PTR);
CACHE_ENTRY_PTR = NULL;
CACHE_INDEX = 0;
CACHE_SIZE = 0;
@@ -306,7 +306,7 @@ void nxagentListRemoteAddName(const char *name, int status)
if (nxagentRemoteFontList.length == nxagentRemoteFontList.listSize)
{
- nxagentRemoteFontList.list = xrealloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr)
+ nxagentRemoteFontList.list = realloc(nxagentRemoteFontList.list, sizeof(nxagentFontRecPtr)
* (nxagentRemoteFontList.listSize + 1000));
if (nxagentRemoteFontList.list == NULL)
@@ -330,9 +330,9 @@ void nxagentListRemoteAddName(const char *name, int status)
(nxagentRemoteFontList.length - pos) * sizeof(nxagentFontRecPtr));
}
- if ((nxagentRemoteFontList.list[pos] = xalloc(sizeof(nxagentFontRec))))
+ if ((nxagentRemoteFontList.list[pos] = malloc(sizeof(nxagentFontRec))))
{
- nxagentRemoteFontList.list[pos]->name = xalloc(strlen(name) +1);
+ nxagentRemoteFontList.list[pos]->name = malloc(strlen(name) +1);
if (nxagentRemoteFontList.list[pos]->name == NULL)
{
fprintf(stderr, "Font: remote list name memory allocation failed!.\n");
@@ -364,10 +364,10 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
{
if (listRec -> list[l])
{
- xfree(listRec -> list[l] -> name);
+ free(listRec -> list[l] -> name);
listRec -> list[l] -> name = NULL;
- xfree(listRec -> list[l]);
+ free(listRec -> list[l]);
listRec -> list[l] = NULL;
}
}
@@ -538,7 +538,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
name = origName;
}
- priv = (void *)xalloc(sizeof(nxagentPrivFont));
+ priv = (void *)malloc(sizeof(nxagentPrivFont));
FontSetPrivate(pFont, nxagentFontPrivateIndex, priv);
nxagentFontPriv(pFont) -> mirrorID = 0;
@@ -569,7 +569,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (CACHE_INDEX == CACHE_SIZE)
{
- CACHE_ENTRY_PTR = xrealloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100));
+ CACHE_ENTRY_PTR = realloc(CACHE_ENTRY_PTR, sizeof(nxCacheFontEntryRecPtr) * (CACHE_SIZE + 100));
if (CACHE_ENTRY_PTR == NULL)
{
@@ -579,14 +579,14 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
CACHE_SIZE += 100;
}
- CACHE_ENTRY(CACHE_INDEX) = xalloc(sizeof(nxCacheFontEntryRec));
+ CACHE_ENTRY(CACHE_INDEX) = malloc(sizeof(nxCacheFontEntryRec));
if (CACHE_ENTRY(CACHE_INDEX) == NULL)
{
return False;
}
- CACHE_NAME(CACHE_INDEX) = xalloc(strlen(name) + 1);
+ CACHE_NAME(CACHE_INDEX) = malloc(strlen(name) + 1);
if (CACHE_NAME(CACHE_INDEX) == NULL)
{
@@ -686,7 +686,7 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (nxagentFontPriv(pFont) -> mirrorID)
FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE);
- xfree(nxagentFontPriv(pFont));
+ free(nxagentFontPriv(pFont));
FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL);
}
@@ -753,7 +753,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
fprintf(stderr, "nxagentLoadBestQueryFont: Searching font '%s' .\n", fontName);
#endif
- substFontBuf = (char *) xalloc(sizeof(char) * 512);
+ substFontBuf = (char *) malloc(sizeof(char) * 512);
numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS + 1, "-");
@@ -1640,7 +1640,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name);
#endif
- Xfree(fs);
+ free(fs);
return (XFontStruct *) NULL;
}
@@ -1666,7 +1666,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
register long nbytes;
nbytes = pFont -> info.nprops * sizeof(XFontProp);
- fs -> properties = (XFontProp *) Xalloc((unsigned) nbytes);
+ fs -> properties = (XFontProp *) malloc((unsigned) nbytes);
if (fs -> properties == NULL)
{
@@ -1674,7 +1674,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Failed allocation of XFontProp.");
#endif
- Xfree((char *) fs);
+ free((char *) fs);
return (XFontStruct *) NULL;
}
@@ -1714,13 +1714,13 @@ int nxagentFreeFont(XFontStruct *fs)
#ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics(fs);
#else
- Xfree ((char *) fs->per_char);
+ free ((char *) fs->per_char);
#endif
}
if (fs -> properties)
{
- Xfree (fs->properties);
+ free (fs->properties);
}
XFree(fs);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c
index 7450c1e6c..1c1a77f37 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GC.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c
@@ -673,7 +673,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{
nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) xalloc(size);
+ pRects = (XRectangle *) malloc(size);
pBox = RegionRects((RegionPtr)pValue);
for (i = nRects; i-- > 0;)
@@ -686,7 +686,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y,
pRects, nRects, Unsorted);
- xfree((char *) pRects);
+ free((char *) pRects);
}
break;
@@ -770,7 +770,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
- xfree(pValue);
+ free(pValue);
pValue = pGC->clientClip;
@@ -904,7 +904,7 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t)
(void *) t, (void *) t -> gc);
#endif
- xfree(t -> gc);
+ free(t -> gc);
free(t);
}
@@ -918,7 +918,7 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
if (nxagentGC(t -> pGC))
{
- xfree(nxagentGC(t -> pGC));
+ free(nxagentGC(t -> pGC));
}
nxagentGC(t -> pGC) = t -> gc;
@@ -1280,7 +1280,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
{
nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) xalloc(size);
+ pRects = (XRectangle *) malloc(size);
pBox = RegionRects((RegionPtr)pValue);
for (i = nRects; i-- > 0;) {
pRects[i].x = pBox[i].x1;
@@ -1298,7 +1298,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y,
pRects, nRects, Unsorted);
- xfree((char *) pRects);
+ free((char *) pRects);
}
else
{
@@ -1369,7 +1369,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
- xfree(pValue);
+ free(pValue);
pValue = pGC->clientClip;
type = CT_REGION;
@@ -1613,7 +1613,7 @@ GCPtr nxagentCreateGraphicContext(int depth)
* to spread the list and add a new GC.
*/
- nxagentGCs = xrealloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec));
+ nxagentGCs = realloc(nxagentGraphicContexts, (nxagentGraphicContextsSize + 1) * sizeof(nxagentGraphicContextsRec));
if (nxagentGCs == NULL)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
index 634bbf2ce..a50a830f9 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
@@ -754,7 +754,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
length = nxagentImageLength(width, height, format, leftPad, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentCopyArea: WARNING! Failed to allocate memory for the operation.\n");
@@ -779,7 +779,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx, srcy, width, height);
#endif
- xfree(data);
+ free(data);
/*
* If the source is a shared memory pixmap, the
@@ -974,7 +974,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
length = nxagentImageLength(width, height, format, leftPad, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef DEBUG
fprintf(stderr, "nxagentCopyPlane: WARNING! Failed to allocate memory for the operation.\n");
@@ -999,7 +999,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx, srcy, width, height);
#endif
- xfree(data);
+ free(data);
/*
* If the source is a shared memory pixmap, the
@@ -1467,7 +1467,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
mode = CoordModePrevious;
- newPoints = xalloc(nPoints * sizeof(xPoint));
+ newPoints = malloc(nPoints * sizeof(xPoint));
/*
* The first point is always relative
@@ -1539,7 +1539,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
if (newPoints != NULL)
{
- xfree(newPoints);
+ free(newPoints);
}
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c
index a158a11db..8cc8962cc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c
@@ -447,7 +447,7 @@ FIXME: Here the split trap is always set and so the caching of
if (nxagentUnpackAlpha[resource] != NULL)
{
- Xfree(nxagentUnpackAlpha[resource] -> data);
+ free(nxagentUnpackAlpha[resource] -> data);
}
else if ((nxagentUnpackAlpha[resource] = Xmalloc(sizeof(UnpackAlphaRec))) == NULL)
{
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
fprintf(stderr, "nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.\n");
#endif
- Xfree(data);
+ free(data);
return;
}
@@ -475,7 +475,7 @@ FIXME: Here the split trap is always set and so the caching of
resource, size);
#endif
- Xfree(data);
+ free(data);
}
}
@@ -1561,7 +1561,7 @@ nxagentPutSubImageEnd:
if (packedChecksum != NULL)
{
- Xfree(packedChecksum);
+ free(packedChecksum);
}
if (packedImage != NULL)
@@ -1569,13 +1569,13 @@ nxagentPutSubImageEnd:
if (packedImage -> data != NULL &&
packedImage -> data != plainImage -> data)
{
- Xfree(packedImage -> data);
+ free(packedImage -> data);
}
- Xfree(packedImage);
+ free(packedImage);
}
- Xfree(plainImage);
+ free(plainImage);
}
void nxagentGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
@@ -1629,9 +1629,9 @@ void nxagentResetAlphaCache()
{
if (nxagentUnpackAlpha[i])
{
- Xfree(nxagentUnpackAlpha[i] -> data);
+ free(nxagentUnpackAlpha[i] -> data);
- Xfree(nxagentUnpackAlpha[i]);
+ free(nxagentUnpackAlpha[i]);
nxagentUnpackAlpha[i] = NULL;
}
@@ -1711,7 +1711,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if (newImage -> data == NULL)
{
- Xfree(newImage);
+ free(newImage);
#ifdef PANIC
fprintf(stderr, "nxagentScaleImage: PANIC! Failed to create the target image data.\n");
@@ -1781,10 +1781,10 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if (image -> obdata != NULL)
{
- Xfree((char *) image -> obdata);
+ free((char *) image -> obdata);
}
- Xfree((char *) image);
+ free((char *) image);
*pImage = newImage;
@@ -1808,7 +1808,7 @@ char *nxagentAllocateImageData(int width, int height, int depth, int *length, in
data = NULL;
- if ((data = xalloc(*length)) == NULL)
+ if ((data = malloc(*length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentAllocateImageData: WARNING! Failed to allocate [%d] bytes of memory.\n", *length);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 852771492..e85cdfdb6 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -757,7 +757,7 @@ N/A
}
len = (max_keycode - min_keycode + 1) * mapWidth;
- keymap = (KeySym *)xalloc(len * sizeof(KeySym));
+ keymap = (KeySym *)malloc(len * sizeof(KeySym));
for(i = 0; i < len; ++i)
keymap[i] = keymap64[i];
XFree(keymap64);
@@ -1138,7 +1138,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#ifdef _XSERVER64
- xfree(keymap);
+ free(keymap);
#else
XFree(keymap);
#endif
@@ -1296,7 +1296,7 @@ int nxagentResetKeyboard(void)
savedBellPercent, savedBellPitch, savedBellDuration);
#endif
- devBackup = xalloc(sizeof(DeviceIntRec));
+ devBackup = malloc(sizeof(DeviceIntRec));
if (devBackup == NULL)
{
@@ -1473,17 +1473,17 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
}
#endif
- xfree(dev->key->curKeySyms.map);
- xfree(dev->key->modifierKeyMap);
- xfree(dev->key);
+ free(dev->key->curKeySyms.map);
+ free(dev->key->modifierKeyMap);
+ free(dev->key);
dev->key=NULL;
}
if (dev->focus)
{
- xfree(dev->focus->trace);
- xfree(dev->focus);
+ free(dev->focus->trace);
+ free(dev->focus);
dev->focus=NULL;
}
@@ -1494,7 +1494,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (k->xkb_sli)
XkbFreeSrvLedInfo(k->xkb_sli);
#endif
- xfree(k);
+ free(k);
}
#ifdef DEBUG
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index b68f01b8d..215d06b53 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -197,14 +197,14 @@ void
InitSelections()
{
if (CurrentSelections)
- xfree(CurrentSelections);
+ free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
#ifdef NXAGENT_CLIPBOARD
{
Selection *newsels;
- newsels = (Selection *)xalloc(2 * sizeof(Selection));
+ newsels = (Selection *)malloc(2 * sizeof(Selection));
if (!newsels)
return;
NumCurrentSelections += 2;
@@ -750,9 +750,9 @@ ProcSetSelectionOwner(register ClientPtr client)
Selection *newsels;
if (i == 0)
- newsels = (Selection *)xalloc(sizeof(Selection));
+ newsels = (Selection *)malloc(sizeof(Selection));
else
- newsels = (Selection *)xrealloc(CurrentSelections,
+ newsels = (Selection *)realloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
if (!newsels)
return BadAlloc;
@@ -1316,7 +1316,7 @@ CloseDownClient(register ClientPtr client)
#ifdef SMART_SCHEDULE
SmartLastClient = NullClient;
#endif
- xfree(client);
+ free(client);
while (!clients[currentMaxClients-1])
currentMaxClients--;
@@ -1338,7 +1338,7 @@ InitClientPrivates(ClientPtr client)
ppriv = (DevUnion *)(client + 1);
else
{
- ppriv = (DevUnion *)xalloc(totalClientSize - sizeof(ClientRec));
+ ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec));
if (!ppriv)
return 0;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
index 77f21e495..2603988b2 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -227,7 +227,7 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
if (err == FontNameAlias && alias) {
newlen = strlen(alias);
- newname = (char *) xrealloc(c->fontname, newlen);
+ newname = (char *) realloc(c->fontname, newlen);
if (!newname) {
err = AllocError;
break;
@@ -326,9 +326,9 @@ bail:
for (i = 0; i < c->num_fpes; i++) {
FreeFPE(c->fpe_list[i]);
}
- xfree(c->fpe_list);
- xfree(c->fontname);
- xfree(c);
+ free(c->fpe_list);
+ free(c->fontname);
+ free(c);
return TRUE;
}
@@ -441,8 +441,8 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) xfree(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ if (resolved) free(resolved);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
}
@@ -496,8 +496,8 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ free(c->savedName);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
c->savedNameLen = namelen;
@@ -614,11 +614,11 @@ bail:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
+ free(c->fpe_list);
+ if (c->savedName) free(c->savedName);
FreeFontNames(names);
- xfree(c);
- if (resolved) xfree(resolved);
+ free(c);
+ if (resolved) free(resolved);
return TRUE;
}
@@ -638,19 +638,19 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
if (length > XLFDMAXFONTNAMELEN)
return BadAlloc;
- if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
+ if (!(c = (LFclosurePtr) malloc(sizeof *c)))
return BadAlloc;
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
- xfree(c);
+ free(c);
return BadAlloc;
}
c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames);
if (!c->names)
{
- xfree(c->fpe_list);
- xfree(c);
+ free(c->fpe_list);
+ free(c);
return BadAlloc;
}
memmove( c->current.pattern, pattern, length);
@@ -785,8 +785,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ free(c->savedName);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
aliascount = 20;
@@ -846,7 +846,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
reply = c->reply;
if (c->length < length)
{
- reply = (xListFontsWithInfoReply *) xrealloc(c->reply, length);
+ reply = (xListFontsWithInfoReply *) realloc(c->reply, length);
if (!reply)
{
err = AllocError;
@@ -886,8 +886,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
(void) WriteToClient(client, namelen, name);
if (pFontInfo == &fontInfo)
{
- xfree(fontInfo.props);
- xfree(fontInfo.isStringProp);
+ free(fontInfo.props);
+ free(fontInfo.isStringProp);
}
--c->current.max_names;
}
@@ -910,10 +910,10 @@ bail:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->reply);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
- xfree(c);
+ free(c->reply);
+ free(c->fpe_list);
+ if (c->savedName) free(c->savedName);
+ free(c);
return TRUE;
}
@@ -1085,8 +1085,8 @@ nxdoListFontsAndAliases(client, fss)
return TRUE;
}
if (err == FontNameAlias) {
- if (resolved) xfree(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ if (resolved) free(resolved);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
{
memmove(resolved, tmpname, resolvedlen);
@@ -1154,8 +1154,8 @@ nxdoListFontsAndAliases(client, fss)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
- xfree(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ free(c->savedName);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
{
memmove(c->savedName, name, namelen);
@@ -1249,12 +1249,12 @@ finish:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- if (c->savedName) xfree(c->savedName);
+ free(c->fpe_list);
+ if (c->savedName) free(c->savedName);
FreeFontNames(c->names);
- xfree(c);
- xfree(fss);
- if (resolved) xfree(resolved);
+ free(c);
+ free(fss);
+ if (resolved) free(resolved);
return doOpenFont(client, oc);
}
@@ -1275,11 +1275,11 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
#ifdef FONTDEBUG
char *f;
- f = (char *)xalloc(lenfname + 1);
+ f = (char *)malloc(lenfname + 1);
memmove(f, pfontname, lenfname);
f[lenfname] = '\0';
ErrorF("OpenFont: fontname is \"%s\"\n", f);
- xfree(f);
+ free(f);
#endif
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
return BadName;
@@ -1312,27 +1312,27 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
return Success;
}
}
- if (!(fss = (nxFsPtr) xalloc(sizeof(nxFs))))
+ if (!(fss = (nxFsPtr) malloc(sizeof(nxFs))))
return BadAlloc;
- if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
+ if (!(c = (LFclosurePtr) malloc(sizeof *c)))
{
- xfree(fss);
+ free(fss);
return BadAlloc;
}
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
- xfree(c);
- xfree(fss);
+ free(c);
+ free(fss);
return BadAlloc;
}
c->names = MakeFontNamesRecord(100);
if (!c->names)
{
- xfree(c->fpe_list);
- xfree(c);
- xfree(fss);
+ free(c->fpe_list);
+ free(c);
+ free(fss);
return BadAlloc;
}
memmove( c->current.pattern, pfontname, lenfname);
@@ -1351,26 +1351,26 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
c->slept = FALSE;
c->savedName = 0;
- oc = (OFclosurePtr) xalloc(sizeof(OFclosureRec));
+ oc = (OFclosurePtr) malloc(sizeof(OFclosureRec));
if (!oc)
{
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- xfree(c);
- xfree(fss);
+ free(c->fpe_list);
+ free(c);
+ free(fss);
return BadAlloc;
}
- oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */
+ oc->fontname = (char *) malloc(256);/* I don't want to deal with future reallocs errors */
oc->origFontName = pfontname;
oc->origFontNameLen = lenfname;
if (!oc->fontname) {
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- xfree(c);
- xfree(oc);
- xfree(fss);
+ free(c->fpe_list);
+ free(c);
+ free(oc);
+ free(fss);
return BadAlloc;
}
/*
@@ -1378,15 +1378,15 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
* while we're blocking, the request still appears atomic
*/
oc->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!oc->fpe_list) {
- xfree(oc->fontname);
- xfree(oc);
+ free(oc->fontname);
+ free(oc);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
- xfree(c->fpe_list);
- xfree(c);
- xfree(fss);
+ free(c->fpe_list);
+ free(c);
+ free(fss);
return BadAlloc;
}
memmove(oc->fontname, pfontname, lenfname);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
index be42ea110..d19e161ac 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c
@@ -363,7 +363,7 @@ XYToWindow(int x, int y)
{
spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */
- spriteTrace = (WindowPtr *)xrealloc(
+ spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
index 4359a552b..f2885d39c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
@@ -65,7 +65,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph);
if (gr->glyph && gr->glyph != DeletedGlyph)
{
- xfree (glyph);
+ free (glyph);
glyph = gr->glyph;
}
else
@@ -175,7 +175,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
++newHash.tableEntries;
}
}
- xfree (hash->table);
+ free (hash->table);
}
*hash = newHash;
if (global)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
index 33492a6d6..430fb6baf 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
@@ -101,7 +101,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
pScreen = screenInfo.screens[0];
nby = BitmapBytePad(cm->width) * (long)cm->height;
- pbits = (char *)xalloc(nby);
+ pbits = (char *)malloc(nby);
if (!pbits)
return BadAlloc;
/* zeroing the (pad) bits seems to help some ddx cursor handling */
@@ -115,7 +115,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
fbDestroyPixmap(ppix);
if (pGC)
FreeScratchGC(pGC);
- xfree(pbits);
+ free(pbits);
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c
index bdc0bc316..15798bc77 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c
@@ -87,7 +87,7 @@ miGlyphs (CARD8 op,
}
else
{
- nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec));
+ nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec));
miGlyphExtents (nlist, list, glyphs, &extents);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
index 1ef445af5..8db856d0a 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
@@ -80,7 +80,7 @@ miTrapezoids (CARD8 op,
}
else
{
- nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec));
+ nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec));
miTrapezoidBounds (ntrap, traps, &bounds);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c
index a47e158df..83133cb36 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c
@@ -87,7 +87,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
nxagentPictureCreateDefaultFormats(pScreen, formats, &nformats);
- pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec));
+ pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec));
if (!pFormats)
return 0;
memset (pFormats, '\0', nformats * sizeof (PictFormatRec));
@@ -190,7 +190,7 @@ AllocatePicture (ScreenPtr pScreen)
unsigned int size;
int i;
- pPicture = (PicturePtr) xalloc (ps->totalPictureSize);
+ pPicture = (PicturePtr) malloc (ps->totalPictureSize);
if (!pPicture)
return 0;
ppriv = (DevUnion *)(pPicture + 1);
@@ -281,10 +281,10 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
@@ -318,7 +318,7 @@ static PicturePtr createSourcePicture(void)
picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec);
- pPicture = (PicturePtr) xalloc(totalPictureSize);
+ pPicture = (PicturePtr) malloc(totalPictureSize);
if (pPicture != NULL)
{
@@ -361,12 +361,12 @@ FreePicture (void * value,
nxagentDestroyPicture(pPicture);
if (pPicture->transform)
- xfree (pPicture->transform);
+ free (pPicture->transform);
if (!pPicture->pDrawable) {
if (pPicture->pSourcePict) {
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
- xfree(pPicture->pSourcePict->linear.stops);
- xfree(pPicture->pSourcePict);
+ free(pPicture->pSourcePict->linear.stops);
+ free(pPicture->pSourcePict);
}
} else {
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
@@ -397,7 +397,7 @@ FreePicture (void * value,
(*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
}
}
- xfree (pPicture);
+ free (pPicture);
}
return Success;
}
@@ -502,7 +502,7 @@ Bool nxagentReconnectAllPictFormat(void *p)
}
}
- xfree(formats);
+ free(formats);
/* TODO: Perhaps do i have to do PictureFinishInit ?. */
/* TODO: We have to check for new Render protocol version. */
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
index 2458c12d0..154d85b41 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -227,13 +227,13 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (!pWin->optional && !MakeWindowOptional (pWin))
return(BadAlloc);
- pProp = (PropertyPtr)xalloc(sizeof(PropertyRec));
+ pProp = (PropertyPtr)malloc(sizeof(PropertyRec));
if (!pProp)
return(BadAlloc);
- data = (void *)xalloc(totalSize);
+ data = (void *)malloc(totalSize);
if (!data && len)
{
- xfree(pProp);
+ free(pProp);
return(BadAlloc);
}
pProp->propertyName = property;
@@ -261,7 +261,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
{
if (totalSize != pProp->size * (pProp->format >> 3))
{
- data = (void *)xrealloc(pProp->data, totalSize);
+ data = (void *)realloc(pProp->data, totalSize);
if (!data && len)
return(BadAlloc);
pProp->data = data;
@@ -278,7 +278,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModeAppend)
{
- data = (void *)xrealloc(pProp->data,
+ data = (void *)realloc(pProp->data,
sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
@@ -290,13 +290,13 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
}
else if (mode == PropModePrepend)
{
- data = (void *)xalloc(sizeInBytes * (len + pProp->size));
+ data = (void *)malloc(sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
memmove(&((char *)data)[totalSize], (char *)pProp->data,
(int)(pProp->size * sizeInBytes));
memmove((char *)data, (char *)value, totalSize);
- xfree(pProp->data);
+ free(pProp->data);
pProp->data = data;
pProp->size += len;
}
@@ -521,8 +521,8 @@ ProcGetProperty(ClientPtr client)
}
else
prevProp->next = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
+ free(pProp->data);
+ free(pProp);
}
return(client->noClientException);
}
@@ -636,8 +636,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
}
else
prevProp->next = pProp->next;
- xfree(pProp->data);
- xfree(pProp);
+ free(pProp->data);
+ free(pProp);
}
return(Success);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index 93760f482..d14b47866 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -224,7 +224,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
ndepth * sizeof (xPictDepth) +
nvisual * sizeof (xPictVisual) +
numSubpixel * sizeof (CARD32));
- reply = (xRenderQueryPictFormatsReply *) xalloc (rlength);
+ reply = (xRenderQueryPictFormatsReply *) malloc (rlength);
if (!reply)
return BadAlloc;
memset(reply, 0, rlength);
@@ -362,7 +362,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
swapl (&reply->numSubpixel, n);
}
WriteToClient(client, rlength, (char *) reply);
- xfree (reply);
+ free (reply);
return client->noClientException;
}
@@ -712,7 +712,7 @@ ProcRenderTrapezoids (ClientPtr client)
{
if (pFormat != NULL)
{
- nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec));
+ nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec));
miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents);
}
@@ -730,7 +730,7 @@ ProcRenderTrapezoids (ClientPtr client)
if (nxagentTrapezoidExtents != NullBox)
{
- xfree(nxagentTrapezoidExtents);
+ free(nxagentTrapezoidExtents);
nxagentTrapezoidExtents = NullBox;
}
@@ -996,7 +996,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
return BadAlloc;
}
- elementsBase = xalloc(nlist * sizeof(XGlyphElt8));
+ elementsBase = malloc(nlist * sizeof(XGlyphElt8));
if (!elementsBase)
return BadAlloc;
@@ -1098,7 +1098,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
* after the X requests.
*/
- nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec));
+ nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec));
miGlyphExtents(nlist, listsBase, glyphsBase, nxagentGlyphsExtents);
@@ -1132,7 +1132,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase);
}
- xfree(nxagentGlyphsExtents);
+ free(nxagentGlyphsExtents);
nxagentGlyphsExtents = NullBox;
if (glyphsBase != glyphsLocal)
@@ -1140,7 +1140,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
if (listsBase != listsLocal)
DEALLOCATE_LOCAL (listsBase);
- xfree(elementsBase);
+ free(elementsBase);
return client->noClientException;
}
@@ -1219,23 +1219,23 @@ ProcRenderCreateCursor (ClientPtr client)
if ( stuff->x > width
|| stuff->y > height )
return (BadMatch);
- argbbits = xalloc (width * height * sizeof (CARD32));
+ argbbits = malloc (width * height * sizeof (CARD32));
if (!argbbits)
return (BadAlloc);
stride = BitmapBytePad(width);
nbytes_mono = stride*height;
- srcbits = (unsigned char *)xalloc(nbytes_mono);
+ srcbits = (unsigned char *)malloc(nbytes_mono);
if (!srcbits)
{
- xfree (argbbits);
+ free (argbbits);
return (BadAlloc);
}
- mskbits = (unsigned char *)xalloc(nbytes_mono);
+ mskbits = (unsigned char *)malloc(nbytes_mono);
if (!mskbits)
{
- xfree(argbbits);
- xfree(srcbits);
+ free(argbbits);
+ free(srcbits);
return (BadAlloc);
}
bzero ((char *) mskbits, nbytes_mono);
@@ -1257,26 +1257,26 @@ ProcRenderCreateCursor (ClientPtr client)
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return (BadImplementation);
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
if (!pPixmap)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return (BadAlloc);
}
pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
client, &error);
if (!pPicture)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return error;
}
(*pScreen->DestroyPixmap) (pPixmap);
@@ -1360,7 +1360,7 @@ ProcRenderCreateCursor (ClientPtr client)
}
else
{
- xfree (argbbits);
+ free (argbbits);
argbbits = 0;
}
@@ -1477,7 +1477,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
if (client->req_len & 1)
return BadLength;
ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1;
- cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
+ cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
if (!cursors)
return BadAlloc;
deltas = (CARD32 *) (cursors + ncursor);
@@ -1488,7 +1488,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
RT_CURSOR, SecurityReadAccess);
if (!cursors[i])
{
- xfree (cursors);
+ free (cursors);
client->errorValue = elt->cursor;
return BadCursor;
}
@@ -1496,7 +1496,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
elt++;
}
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor);
- xfree (cursors);
+ free (cursors);
if (ret != Success)
return ret;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c
index 38bc05e51..eb48c5094 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c
@@ -257,7 +257,7 @@ AddResource(XID id, RESTYPE type, void * value)
(rrec->hashsize < MAXHASHSIZE))
RebuildTable(client);
head = &rrec->resources[Hash(client, id)];
- res = (ResourcePtr)xalloc(sizeof(ResourceRec));
+ res = (ResourcePtr)malloc(sizeof(ResourceRec));
if (!res)
{
(*DeleteFuncs[type & TypeMask])(value, id);
@@ -313,7 +313,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
#endif
if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
- xfree(res);
+ free(res);
if (*eltptr != elements)
prev = head; /* prev may no longer be valid */
gotOne = TRUE;
@@ -349,7 +349,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
#endif
if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id);
- xfree(res);
+ free(res);
break;
}
else
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index 1ce72cbbe..86b9e0d24 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -234,12 +234,12 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
length = nxagentImageLength(sw, sh, format, 0, depth);
- if ((newdata = xalloc(length)) != NULL)
+ if ((newdata = malloc(length)) != NULL)
{
fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata);
(*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata);
- xfree(newdata);
+ free(newdata);
}
else
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index 28aafd644..0071a15d0 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -336,7 +336,7 @@ DeleteWindow(void * value, XID wid)
nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen);
}
- xfree(pWin);
+ free(pWin);
return Success;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index f429f1499..931c564dc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -487,7 +487,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
FreeResource(pPixmapPriv -> mid, RT_NONE);
}
- xfree(pPixmap);
+ free(pPixmap);
return True;
}
@@ -1251,7 +1251,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentFBTrap = 1;
- if ((data = xalloc(length)) != NULL)
+ if ((data = malloc(length)) != NULL)
{
fbGetImage(nxagentVirtualDrawable(pDrawable), xPict, yPict,
width, height, format, 0xffffffff, data);
@@ -1259,7 +1259,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentPutImage(pDrawable, pGC, depth, xPict, yPict,
width, height, 0, format, data);
- xfree(data);
+ free(data);
}
#ifdef WARNING
else
@@ -1373,7 +1373,7 @@ FIXME: If the pixmap has a different depth from the window, the
length = nxagentImageLength(width, height, format, 0, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentPixmapOnShadowDisplay: WARNING! Failed to allocate memory for the operation.\n");
@@ -1409,7 +1409,7 @@ FIXME: If the pixmap has a different depth from the window, the
if (data != NULL)
{
- xfree(data);
+ free(data);
}
return False;
@@ -1535,7 +1535,7 @@ Bool nxagentFbOnShadowDisplay()
length = nxagentImageLength(width, height, format, 0, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
fprintf(stderr, "nxagentFbOnShadowDisplay: WARNING! Failed to allocate memory for the operation.\n");
@@ -1571,7 +1571,7 @@ Bool nxagentFbOnShadowDisplay()
if (data)
{
- xfree(data);
+ free(data);
}
return False;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index 00d434bf4..74c7587c7 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -329,17 +329,17 @@ void nxagentInitReconnector(void)
{
nxagentReconnectTrap = 0;
- reconnectLossyLevel[DISPLAY_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[SCREEN_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[FONT_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[PIXMAP_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[GC_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[CURSOR_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[COLORMAP_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[WINDOW_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[GLYPHSET_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[PICTFORMAT_STEP] = xalloc(sizeof(int));
- reconnectLossyLevel[PICTURE_STEP] = xalloc(sizeof(int));
+ reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[FONT_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[PIXMAP_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[GC_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[CURSOR_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[COLORMAP_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[WINDOW_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[GLYPHSET_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[PICTFORMAT_STEP] = malloc(sizeof(int));
+ reconnectLossyLevel[PICTURE_STEP] = malloc(sizeof(int));
}
void nxagentDisconnectSession(void)
@@ -434,7 +434,7 @@ Bool nxagentReconnectSession(void)
size = strlen(nxagentKeyboard);
- if ((nxagentOldKeyboard = xalloc(size + 1)) != NULL)
+ if ((nxagentOldKeyboard = malloc(size + 1)) != NULL)
{
strncpy(nxagentOldKeyboard, nxagentKeyboard, size);
@@ -444,7 +444,7 @@ Bool nxagentReconnectSession(void)
if (nxagentKeyboard)
{
- xfree(nxagentKeyboard);
+ free(nxagentKeyboard);
nxagentKeyboard = NULL;
}
@@ -609,7 +609,7 @@ Bool nxagentReconnectSession(void)
if (nxagentOldKeyboard != NULL)
{
- xfree(nxagentOldKeyboard);
+ free(nxagentOldKeyboard);
nxagentOldKeyboard = NULL;
}
@@ -734,7 +734,7 @@ nxagentReconnectError:
if (nxagentOldKeyboard != NULL)
{
- xfree(nxagentOldKeyboard);
+ free(nxagentOldKeyboard);
nxagentOldKeyboard = NULL;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 8c822319d..4c9edb849 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Render.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c
@@ -270,11 +270,11 @@ void nxagentRenderExtensionInit()
int nxagentCursorSaveRenderInfo(ScreenPtr pScreen, CursorPtr pCursor)
{
- pCursor -> devPriv[pScreen -> myNum] = xalloc(sizeof(nxagentPrivCursor));
+ pCursor -> devPriv[pScreen -> myNum] = malloc(sizeof(nxagentPrivCursor));
if (nxagentCursorPriv(pCursor, pScreen) == NULL)
{
- FatalError("xalloc failed");
+ FatalError("malloc failed");
}
nxagentCursorUsesRender(pCursor, pScreen) = 1;
@@ -2249,7 +2249,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
if (sizeImages > 0)
{
- normalizedImages = xalloc(sizeImages);
+ normalizedImages = malloc(sizeImages);
if (normalizedImages != NULL)
{
@@ -2284,7 +2284,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
if (normalizedImages != images)
{
- xfree(normalizedImages);
+ free(normalizedImages);
}
#ifdef DEBUG
@@ -2392,7 +2392,7 @@ FIXME: Is this useful or just a waste of bandwidth?
nparams);
#endif
- Xfree(szFilter);
+ free(szFilter);
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
index 49877f9d7..d5c6e71c9 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
@@ -305,7 +305,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
XID values[2];
Mask mask;
- toplevel = xalloc(sizeof(WindowPtr) * nchildren);
+ toplevel = malloc(sizeof(WindowPtr) * nchildren);
ntoplevel = 0;
for(i = 0; i < nchildren; i++)
@@ -389,7 +389,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
#endif
- xfree(toplevel);
+ free(toplevel);
return;
}
@@ -797,7 +797,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (freeMem)
{
- xfree(output);
+ free(output);
}
return export;
@@ -1104,7 +1104,7 @@ void nxagentImportProperty(Window window,
if (freeMem)
{
- xfree(output);
+ free(output);
}
return;
@@ -1156,7 +1156,7 @@ void nxagentRemovePropertyFromList()
nxagentPropertyList.last = NULL;
}
- xfree(tmp);
+ free(tmp);
}
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index de8c97532..152040fbd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -1149,13 +1149,13 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
* Initialize the depths.
*/
- depths = (DepthPtr) xalloc(nxagentNumDepths * sizeof(DepthRec));
+ depths = (DepthPtr) malloc(nxagentNumDepths * sizeof(DepthRec));
for (i = 0; i < nxagentNumDepths; i++)
{
depths[i].depth = nxagentDepths[i];
depths[i].numVids = 0;
- depths[i].vids = (VisualID *) xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
+ depths[i].vids = (VisualID *) malloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
}
/*
@@ -1170,7 +1170,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
numVisuals = 0;
numDepths = nxagentNumDepths;
- visuals = (VisualPtr) xalloc(nxagentNumVisuals * sizeof(VisualRec));
+ visuals = (VisualPtr) malloc(nxagentNumVisuals * sizeof(VisualRec));
for (i = 0; i < nxagentNumVisuals; i++)
{
@@ -1250,7 +1250,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
depths[depthIndex].depth = nxagentVisuals[i].depth;
depths[depthIndex].numVids = 0;
- depths[depthIndex].vids = (VisualID *) xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
+ depths[depthIndex].vids = (VisualID *) malloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
numDepths++;
}
@@ -1302,7 +1302,7 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
"[%d] bitsPerPixel [%d] sizeInBytes [%d]\n", rootDepth, bitsPerPixel, sizeInBytes);
#endif
- pFrameBufferBits = (char *) Xalloc(sizeInBytes);
+ pFrameBufferBits = (char *) malloc(sizeInBytes);
if (!pFrameBufferBits)
{
@@ -1358,8 +1358,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
* by fbScreenInit with our own.
*/
- xfree(pScreen -> visuals);
- xfree(pScreen -> allowedDepths);
+ free(pScreen -> visuals);
+ free(pScreen -> allowedDepths);
pScreen -> visuals = visuals;
pScreen -> allowedDepths = depths;
@@ -2079,18 +2079,18 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen)
for (i = 0; i < pScreen->numDepths; i++)
{
- xfree(pScreen->allowedDepths[i].vids);
+ free(pScreen->allowedDepths[i].vids);
}
/*
* Free the frame buffer.
*/
- xfree(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr);
+ free(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr);
- xfree(pScreen->allowedDepths);
- xfree(pScreen->visuals);
- xfree(pScreen->devPrivate);
+ free(pScreen->allowedDepths);
+ free(pScreen->visuals);
+ free(pScreen->devPrivate);
/*
* Reset the geometry and alpha information
@@ -3065,15 +3065,15 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
if (tBuffer)
{
- xfree(tBuffer);
+ free(tBuffer);
}
- tBuffer = xalloc(length);
+ tBuffer = malloc(length);
if (tBuffer == NULL)
{
#ifdef PANIC
- fprintf(stderr, "nxagentShadowPoll: xalloc failed.\n");
+ fprintf(stderr, "nxagentShadowPoll: malloc failed.\n");
#endif
return -1;
@@ -3125,7 +3125,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
if (tBuffer)
{
- xfree(tBuffer);
+ free(tBuffer);
}
RegionUninit(&updateRegion);
@@ -3166,7 +3166,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
length = nxagentImageLength(width, height, ZPixmap, 0, nxagentShadowDepth);
- cBuffer = xalloc(length);
+ cBuffer = malloc(length);
icBuffer = cBuffer;
pVisual = nxagentImageVisual((DrawablePtr) nxagentShadowPixmapPtr, nxagentShadowDepth);
@@ -3346,7 +3346,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
if (cBuffer != NULL)
{
- xfree(cBuffer);
+ free(cBuffer);
}
}
@@ -3423,7 +3423,7 @@ FIXME: The port information is not used at the moment and produces a
#endif
- local_buf = (char *) xalloc(strlen((char*)pszReturnData) + 100);
+ local_buf = (char *) malloc(strlen((char*)pszReturnData) + 100);
if (local_buf)
{
@@ -3529,7 +3529,7 @@ FIXME: The port information is not used at the moment and produces a
strlen(local_buf), local_buf, 1);
}
- xfree(local_buf);
+ free(local_buf);
}
}
}
@@ -3769,9 +3769,9 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
number = 1;
if (screeninfo) {
- xfree(screeninfo);
+ free(screeninfo);
}
- if (!(screeninfo = xalloc(sizeof(XineramaScreenInfo)))) {
+ if (!(screeninfo = malloc(sizeof(XineramaScreenInfo)))) {
return FALSE;
}
@@ -4061,7 +4061,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
/* release allocated memory */
if (screeninfo) {
- xfree(screeninfo);
+ free(screeninfo);
screeninfo = NULL;
}
@@ -4157,7 +4157,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
nRects = RegionNumRects(&cleanRegion);
size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) xalloc(size);
+ pRects = (XRectangle *) malloc(size);
pBox = RegionRects(&cleanRegion);
for (i = nRects; i-- > 0;)
@@ -4170,7 +4170,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted);
- xfree((char *) pRects);
+ free((char *) pRects);
extents = *RegionExtents(&cleanRegion);
@@ -4303,7 +4303,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
nRects = RegionNumRects(clipRegion);
size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) xalloc(size);
+ pRects = (XRectangle *) malloc(size);
pBox = RegionRects(clipRegion);
for (i = nRects; i-- > 0;)
@@ -4316,7 +4316,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted);
- xfree(pRects);
+ free(pRects);
extents = *RegionExtents(clipRegion);
@@ -4511,10 +4511,10 @@ void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height)
length = nxagentImageLength(width, height, format, 0, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
- fprintf(stderr, "nxagentShowPixmap: xalloc failed.\n");
+ fprintf(stderr, "nxagentShowPixmap: malloc failed.\n");
#endif
return;
@@ -4537,7 +4537,7 @@ FIXME
if (data)
{
- xfree(data);
+ free(data);
}
return;
@@ -4573,7 +4573,7 @@ FIXME
if (data != NULL)
{
- xfree(data);
+ free(data);
}
/*
@@ -4607,10 +4607,10 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
length = nxagentImageLength(width, height, format, 0, depth);
- if ((data = xalloc(length)) == NULL)
+ if ((data = malloc(length)) == NULL)
{
#ifdef WARNING
- fprintf(stderr, "nxagentFbRestoreArea: xalloc failed.\n");
+ fprintf(stderr, "nxagentFbRestoreArea: malloc failed.\n");
#endif
return;
@@ -4628,7 +4628,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
if (data)
{
- xfree(data);
+ free(data);
}
return;
@@ -4691,7 +4691,7 @@ FIXME
FIXME
if (data)
{
- xfree(data);
+ free(data);
}
*/
}
diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h
index aff2952fa..aaff63811 100644
--- a/nx-X11/programs/Xserver/include/os.h
+++ b/nx-X11/programs/Xserver/include/os.h
@@ -52,8 +52,8 @@ SOFTWARE.
#define OS_H
#include "misc.h"
-#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
-#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((void *)(_ptr))
+#define ALLOCATE_LOCAL_FALLBACK(_size) malloc((unsigned long)(_size))
+#define DEALLOCATE_LOCAL_FALLBACK(_ptr) free((void *)(_ptr))
#include <nx-X11/Xalloca.h>
#ifndef IN_MODULE
#include <stdarg.h>
@@ -79,15 +79,11 @@ typedef void * FID;
typedef struct _FontPathRec *FontPathPtr;
typedef struct _NewClientRec *NewClientPtr;
-#ifndef xalloc
+#ifndef xnfalloc
#define xnfalloc(size) XNFalloc((unsigned long)(size))
#define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
#define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size))
-#define xalloc(size) Xalloc((unsigned long)(size))
-#define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
-#define xrealloc(ptr, size) Xrealloc((void *)(ptr), (unsigned long)(size))
-#define xfree(ptr) Xfree((void *)(ptr))
#define xstrdup(s) Xstrdup(s)
#define xnfstrdup(s) XNFstrdup(s)
#endif
@@ -229,14 +225,6 @@ extern int set_font_authorizations(
int * /*authlen */,
void * /* client */);
-#ifndef _HAVE_XALLOC_DECLS
-#define _HAVE_XALLOC_DECLS
-extern void * Xalloc(unsigned long /*amount*/);
-extern void * Xcalloc(unsigned long /*amount*/);
-extern void * Xrealloc(void * /*ptr*/, unsigned long /*amount*/);
-extern void Xfree(void * /*ptr*/);
-#endif
-
extern void * XNFalloc(unsigned long /*amount*/);
extern void * XNFcalloc(unsigned long /*amount*/);
extern void * XNFrealloc(void * /*ptr*/, unsigned long /*amount*/);
diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c
index 8db188a6e..9c3bcb7ad 100644
--- a/nx-X11/programs/Xserver/mi/miarc.c
+++ b/nx-X11/programs/Xserver/mi/miarc.c
@@ -450,7 +450,7 @@ miFreeArcCache (data, id)
{
cent->lrustamp = 0;
cent->lw = 0;
- xfree(cent->spdata);
+ free(cent->spdata);
cent->spdata = NULL;
}
}
@@ -911,8 +911,8 @@ miComputeWideEllipse(
if (!spdata || spdata->k != k)
{
if (spdata)
- xfree(spdata);
- spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) +
+ free(spdata);
+ spdata = (miArcSpanData *)malloc(sizeof(miArcSpanData) +
sizeof(miArcSpan) * (k + 2));
lruent->spdata = spdata;
if (!spdata)
@@ -1054,7 +1054,7 @@ miFillWideEllipse(
}
}
if (mustFree)
- xfree(spdata);
+ free(spdata);
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
DEALLOCATE_LOCAL(widths);
@@ -1396,7 +1396,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
arc.height = width;
arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
arc.angle2 = a;
- pArcPts = (SppPointPtr) xalloc (3 * sizeof (SppPointRec));
+ pArcPts = (SppPointPtr) malloc (3 * sizeof (SppPointRec));
if (!pArcPts)
return;
pArcPts[0].x = otherCorner.x;
@@ -1412,7 +1412,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
}
- xfree(pArcPts);
+ free(pArcPts);
return;
case JoinMiter:
/*
@@ -1543,7 +1543,7 @@ miRoundCap(
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
}
- xfree(pArcPts);
+ free(pArcPts);
}
/*
@@ -1641,10 +1641,10 @@ miDatan2 (double dy, double dx)
* This procedure allocates the space necessary to fit the arc points.
* Sometimes it's convenient for those points to be at the end of an existing
* array. (For example, if we want to leave a spare point to make sectors
- * instead of segments.) So we pass in the xalloc()ed chunk that contains the
+ * instead of segments.) So we pass in the malloc()ed chunk that contains the
* array and an index saying where we should start stashing the points.
* If there isn't an array already, we just pass in a null pointer and
- * count on xrealloc() to handle the null pointer correctly.
+ * count on realloc() to handle the null pointer correctly.
*/
static int
miGetArcPts(
@@ -1691,7 +1691,7 @@ miGetArcPts(
count++;
cdt = 2 * miDcos(dt);
- if (!(poly = (SppPointPtr) xrealloc((void *)*ppPts,
+ if (!(poly = (SppPointPtr) realloc((void *)*ppPts,
(cpt + count) * sizeof(SppPointRec))))
return(0);
*ppPts = poly;
@@ -1754,7 +1754,7 @@ addCap (
if (*ncapsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- cap = (miArcCapPtr) xrealloc (*capsp,
+ cap = (miArcCapPtr) realloc (*capsp,
newsize * sizeof (**capsp));
if (!cap)
return;
@@ -1785,7 +1785,7 @@ addJoin (
if (*njoinsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- join = (miArcJoinPtr) xrealloc (*joinsp,
+ join = (miArcJoinPtr) realloc (*joinsp,
newsize * sizeof (**joinsp));
if (!join)
return;
@@ -1815,7 +1815,7 @@ addArc (
if (*narcsp == *sizep)
{
newsize = *sizep + ADD_REALLOC_STEP;
- arc = (miArcDataPtr) xrealloc (*arcsp,
+ arc = (miArcDataPtr) realloc (*arcsp,
newsize * sizeof (**arcsp));
if (!arc)
return (miArcDataPtr)NULL;
@@ -1840,13 +1840,13 @@ miFreeArcs(
iphase--)
{
if (arcs[iphase].narcs > 0)
- xfree(arcs[iphase].arcs);
+ free(arcs[iphase].arcs);
if (arcs[iphase].njoins > 0)
- xfree(arcs[iphase].joins);
+ free(arcs[iphase].joins);
if (arcs[iphase].ncaps > 0)
- xfree(arcs[iphase].caps);
+ free(arcs[iphase].caps);
}
- xfree(arcs);
+ free(arcs);
}
/*
@@ -1933,7 +1933,7 @@ miComputeArcs (
data = (struct arcData *) ALLOCATE_LOCAL (narcs * sizeof (struct arcData));
if (!data)
return (miPolyArcPtr)NULL;
- arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
+ arcs = (miPolyArcPtr) malloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
if (!arcs)
{
DEALLOCATE_LOCAL(data);
@@ -3146,7 +3146,7 @@ realAllocSpan ()
register struct finalSpan *span;
register int i;
- newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk));
+ newChunk = (struct finalSpanChunk *) malloc (sizeof (struct finalSpanChunk));
if (!newChunk)
return (struct finalSpan *) NULL;
newChunk->next = chunks;
@@ -3169,11 +3169,11 @@ disposeFinalSpans (void)
for (chunk = chunks; chunk; chunk = next) {
next = chunk->next;
- xfree (chunk);
+ free (chunk);
}
chunks = 0;
freeFinalSpans = 0;
- xfree(finalSpans);
+ free(finalSpans);
finalSpans = 0;
}
@@ -3251,7 +3251,7 @@ realFindSpan (int y)
else
change = SPAN_REALLOC;
newSize = finalSize + change;
- newSpans = (struct finalSpan **) xalloc
+ newSpans = (struct finalSpan **) malloc
(newSize * sizeof (struct finalSpan *));
if (!newSpans)
return (struct finalSpan **)NULL;
@@ -3265,7 +3265,7 @@ realFindSpan (int y)
memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
(char *) finalSpans,
finalSize * sizeof (struct finalSpan *));
- xfree (finalSpans);
+ free (finalSpans);
}
if ((i = finalMiny - newMiny) > 0)
bzero ((char *)newSpans, i * sizeof (struct finalSpan *));
@@ -3610,7 +3610,7 @@ drawArc (
}
}
if (mustFree)
- xfree(spdata);
+ free(spdata);
}
static void
diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c
index b607af1c1..a651c021e 100644
--- a/nx-X11/programs/Xserver/mi/mibank.c
+++ b/nx-X11/programs/Xserver/mi/mibank.c
@@ -1709,7 +1709,7 @@ miBankCloseScreen(
if (pScreenPriv->pBanks[i])
RegionDestroy(pScreenPriv->pBanks[i]);
- Xfree(pScreenPriv->pBanks);
+ free(pScreenPriv->pBanks);
SCREEN_UNWRAP(CreateScreenResources);
SCREEN_UNWRAP(ModifyPixmapHeader);
@@ -1722,7 +1722,7 @@ miBankCloseScreen(
SCREEN_UNWRAP(CopyWindow);
SCREEN_UNWRAP(BackingStoreFuncs);
- Xfree(pScreenPriv);
+ free(pScreenPriv);
return (*pScreen->CloseScreen)(nIndex, pScreen);
}
@@ -2243,13 +2243,13 @@ miInitializeBanking(
(sizeof(miBankGCRec) - sizeof(RegionPtr))))
return FALSE;
- if (!(pScreenPriv = (miBankScreenPtr)Xcalloc(sizeof(miBankScreenRec))))
+ if (!(pScreenPriv = (miBankScreenPtr)calloc(1, sizeof(miBankScreenRec))))
return FALSE;
if (!(pScreenPriv->pBanks = /* Allocate and clear */
- (RegionPtr *)Xcalloc(nBanks * sizeof(RegionPtr))))
+ (RegionPtr *)calloc(1, nBanks * sizeof(RegionPtr))))
{
- Xfree(pScreenPriv);
+ free(pScreenPriv);
return FALSE;
}
@@ -2360,8 +2360,8 @@ miInitializeBanking(
if (pScreenPriv->pBanks[i])
RegionDestroy(pScreenPriv->pBanks[i]);
- Xfree(pScreenPriv->pBanks);
- Xfree(pScreenPriv);
+ free(pScreenPriv->pBanks);
+ free(pScreenPriv);
return FALSE;
}
diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c
index b19a15900..bded0850a 100644
--- a/nx-X11/programs/Xserver/mi/mibitblt.c
+++ b/nx-X11/programs/Xserver/mi/mibitblt.c
@@ -239,7 +239,7 @@ miCopyArea(pSrcDrawable, pDstDrawable,
ppt++->y = y++;
*pwidth++ = width;
}
- pbits = (unsigned int *)xalloc(height * PixmapBytePad(width,
+ pbits = (unsigned int *)malloc(height * PixmapBytePad(width,
pSrcDrawable->depth));
if (pbits)
{
@@ -258,7 +258,7 @@ miCopyArea(pSrcDrawable, pDstDrawable,
(*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
(int *)pwidthFirst, height, TRUE);
- xfree(pbits);
+ free(pbits);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
@@ -318,7 +318,7 @@ miGetPlane(
sy += pDraw->y;
widthInBytes = BitmapBytePad(w);
if(!result)
- result = (MiBits *)xalloc(h * widthInBytes);
+ result = (MiBits *)malloc(h * widthInBytes);
if (!result)
return (MiBits *)NULL;
bitsPerPixel = pDraw->bitsPerPixel;
@@ -622,7 +622,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable,
miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
box.x2 - box.x1, box.y2 - box.y1,
dstx + box.x1 - srcx, dsty + box.y1 - srcy);
- xfree(ptile);
+ free(ptile);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c
index a24e2cbcd..5001eae6f 100644
--- a/nx-X11/programs/Xserver/mi/mibstore.c
+++ b/nx-X11/programs/Xserver/mi/mibstore.c
@@ -373,7 +373,7 @@ miInitializeBackingStore (pScreen)
}
if (!AllocateGCPrivate(pScreen, miBSGCIndex, 0))
return;
- pScreenPriv = (miBSScreenPtr) xalloc (sizeof (miBSScreenRec));
+ pScreenPriv = (miBSScreenPtr) malloc (sizeof (miBSScreenRec));
if (!pScreenPriv)
return;
@@ -433,7 +433,7 @@ miBSCloseScreen (i, pScreen)
pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
pScreen->CreateGC = pScreenPriv->CreateGC;
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -903,7 +903,7 @@ miBSCreateGCPrivate (pGC)
{
miBSGCRec *pPriv;
- pPriv = (miBSGCRec *) xalloc (sizeof (miBSGCRec));
+ pPriv = (miBSGCRec *) malloc (sizeof (miBSGCRec));
if (!pPriv)
return FALSE;
pPriv->pBackingGC = NULL;
@@ -931,7 +931,7 @@ miBSDestroyGCPrivate (GCPtr pGC)
pGC->ops = pPriv->wrapOps;
if (pPriv->pBackingGC)
FreeGC (pPriv->pBackingGC, (GContext) 0);
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
}
}
@@ -2581,7 +2581,7 @@ miBSAllocate(pWin)
if (!(pBackingStore = (miBSWindowPtr)pWin->backStorage))
{
- pBackingStore = (miBSWindowPtr)xalloc(sizeof(miBSWindowRec));
+ pBackingStore = (miBSWindowPtr)malloc(sizeof(miBSWindowRec));
if (!pBackingStore)
return;
@@ -2685,7 +2685,7 @@ miBSFree(pWin)
RegionUninit(&pBackingStore->SavedRegion);
- xfree(pBackingStore);
+ free(pBackingStore);
pWin->backStorage = NULL;
}
}
@@ -3615,7 +3615,7 @@ miBSDestroyGC (pGC)
FUNC_EPILOGUE (pGC, pPriv);
- xfree(pPriv);
+ free(pPriv);
}
static void
diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c
index 15d3f7f46..1d79ade9b 100644
--- a/nx-X11/programs/Xserver/mi/micmap.c
+++ b/nx-X11/programs/Xserver/mi/micmap.c
@@ -393,7 +393,7 @@ miClearVisualTypes()
while ((v = miVisuals)) {
miVisuals = v->next;
- xfree(v);
+ free(v);
}
}
@@ -406,7 +406,7 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
miVisualsPtr new, *prev, v;
int count;
- new = (miVisualsPtr) xalloc (sizeof *new);
+ new = (miVisualsPtr) malloc (sizeof *new);
if (!new)
return FALSE;
if (!redMask || !greenMask || !blueMask)
@@ -560,14 +560,14 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
ndepth++;
nvisual += visuals->count;
}
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
- preferredCVCs = (int *)xalloc(ndepth * sizeof(int));
+ depth = (DepthPtr) malloc (ndepth * sizeof (DepthRec));
+ visual = (VisualPtr) malloc (nvisual * sizeof (VisualRec));
+ preferredCVCs = (int *)malloc(ndepth * sizeof(int));
if (!depth || !visual || !preferredCVCs)
{
- xfree (depth);
- xfree (visual);
- xfree (preferredCVCs);
+ free (depth);
+ free (visual);
+ free (preferredCVCs);
return FALSE;
}
*depthp = depth;
@@ -586,7 +586,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
vid = NULL;
if (nvtype)
{
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
+ vid = (VisualID *) malloc (nvtype * sizeof (VisualID));
if (!vid)
return FALSE;
}
@@ -628,7 +628,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
vid++;
visual++;
}
- xfree (visuals);
+ free (visuals);
}
miVisuals = NULL;
visual = *visualp;
@@ -684,7 +684,7 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
}
*rootDepthp = depth[i].depth;
*defaultVisp = depth[i].vids[j];
- xfree(preferredCVCs);
+ free(preferredCVCs);
return TRUE;
}
diff --git a/nx-X11/programs/Xserver/mi/midash.c b/nx-X11/programs/Xserver/mi/midash.c
index 5def4d9c8..59c6afdce 100644
--- a/nx-X11/programs/Xserver/mi/midash.c
+++ b/nx-X11/programs/Xserver/mi/midash.c
@@ -265,11 +265,11 @@ CheckDashStorage(
miDashPtr newppseg;
*pnsegMax += NSEGDELTA;
- newppseg = (miDashPtr)xrealloc(*ppseg,
+ newppseg = (miDashPtr)realloc(*ppseg,
(*pnsegMax)*sizeof(miDashRec));
if (!newppseg)
{
- xfree(*ppseg);
+ free(*ppseg);
return (miDashPtr)NULL;
}
*ppseg = newppseg;
diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c
index 6ffb9efea..4d5e055eb 100644
--- a/nx-X11/programs/Xserver/mi/midispcur.c
+++ b/nx-X11/programs/Xserver/mi/midispcur.c
@@ -126,7 +126,7 @@ miDCInitialize (pScreen, screenFuncs)
return FALSE;
miDCGeneration = serverGeneration;
}
- pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec));
+ pScreenPriv = (miDCScreenPtr) malloc (sizeof (miDCScreenRec));
if (!pScreenPriv)
return FALSE;
@@ -155,7 +155,7 @@ miDCInitialize (pScreen, screenFuncs)
if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs))
{
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return FALSE;
}
return TRUE;
@@ -187,7 +187,7 @@ miDCCloseScreen (index, pScreen)
tossPict (pScreenPriv->pRootPicture);
tossPict (pScreenPriv->pTempPicture);
#endif
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (index, pScreen);
}
@@ -250,7 +250,7 @@ miDCRealize (
GCPtr pGC;
XID gcvals[3];
- pPriv = (miDCCursorPtr) xalloc (sizeof (miDCCursorRec));
+ pPriv = (miDCCursorPtr) malloc (sizeof (miDCCursorRec));
if (!pPriv)
return (miDCCursorPtr)NULL;
#ifdef ARGB_CURSOR
@@ -263,7 +263,7 @@ miDCRealize (
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
@@ -273,14 +273,14 @@ miDCRealize (
pCursor->bits->height, 32);
if (!pPixmap)
{
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
pGC = GetScratchGC (32, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
ValidateGC (&pPixmap->drawable, pGC);
@@ -294,7 +294,7 @@ miDCRealize (
(*pScreen->DestroyPixmap) (pPixmap);
if (!pPriv->pPicture)
{
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv;
@@ -305,14 +305,14 @@ miDCRealize (
pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
if (!pPriv->sourceBits)
{
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
if (!pPriv->maskBits)
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
return (miDCCursorPtr)NULL;
}
pCursor->bits->devPriv[pScreen->myNum] = (void *) pPriv;
@@ -372,7 +372,7 @@ miDCUnrealizeCursor (pScreen, pCursor)
if (pPriv->pPicture)
FreePicture (pPriv->pPicture, 0);
#endif
- xfree ((void *) pPriv);
+ free ((void *) pPriv);
pCursor->bits->devPriv[pScreen->myNum] = (void *)NULL;
}
return TRUE;
diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c
index 167163686..58a00ddd1 100644
--- a/nx-X11/programs/Xserver/mi/migc.c
+++ b/nx-X11/programs/Xserver/mi/migc.c
@@ -71,7 +71,7 @@ miCreateGCOps(prototype)
GCOpsPtr ret;
/* XXX */ Must_have_memory = TRUE;
- ret = (GCOpsPtr) xalloc(sizeof(GCOps));
+ ret = (GCOpsPtr) malloc(sizeof(GCOps));
/* XXX */ Must_have_memory = FALSE;
if (!ret)
return 0;
@@ -85,7 +85,7 @@ miDestroyGCOps(ops)
GCOpsPtr ops;
{
if (ops->devPrivate.val)
- xfree(ops);
+ free(ops);
}
@@ -136,7 +136,7 @@ miChangeClip(pGC, type, pvalue, nrects)
pGC->clientClip = (void *) RegionFromRects(nrects,
(xRectangle *) pvalue,
type);
- xfree(pvalue);
+ free(pvalue);
}
pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE;
pGC->stateChanges |= GCClipMask;
diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c
index e89ce8fa0..3a85863ed 100644
--- a/nx-X11/programs/Xserver/mi/mioverlay.c
+++ b/nx-X11/programs/Xserver/mi/mioverlay.c
@@ -125,7 +125,7 @@ miInitOverlay(
sizeof(miOverlayWindowRec)))
return FALSE;
- if(!(pScreenPriv = xalloc(sizeof(miOverlayScreenRec))))
+ if(!(pScreenPriv = malloc(sizeof(miOverlayScreenRec))))
return FALSE;
pScreen->devPrivates[miOverlayScreenIndex].ptr = (void *)pScreenPriv;
@@ -178,7 +178,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen)
pScreen->UnrealizeWindow = pScreenPriv->UnrealizeWindow;
pScreen->RealizeWindow = pScreenPriv->RealizeWindow;
- xfree(pScreenPriv);
+ free(pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
@@ -196,7 +196,7 @@ miOverlayCreateWindow(WindowPtr pWin)
pWinPriv->tree = NULL;
if(!pWin->parent || !((*pScreenPriv->InOverlay)(pWin))) {
- if(!(pTree = (miOverlayTreePtr)xcalloc(1, sizeof(miOverlayTreeRec))))
+ if(!(pTree = (miOverlayTreePtr)calloc(1, sizeof(miOverlayTreeRec))))
return FALSE;
}
@@ -224,7 +224,7 @@ miOverlayCreateWindow(WindowPtr pWin)
RegionInit(&(pTree->borderClip), &fullBox, 1);
RegionInit(&(pTree->clipList), &fullBox, 1);
}
- } else xfree(pTree);
+ } else free(pTree);
}
return TRUE;
@@ -252,7 +252,7 @@ miOverlayDestroyWindow(WindowPtr pWin)
RegionUninit(&(pTree->borderClip));
RegionUninit(&(pTree->clipList));
- xfree(pTree);
+ free(pTree);
}
if(pScreenPriv->DestroyWindow) {
@@ -874,7 +874,7 @@ miOverlayHandleExposures(WindowPtr pWin)
(*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion);
RegionUninit(&mival->exposed);
}
- xfree(mival);
+ free(mival);
pTree->valdata = NULL;
if (pTree->firstChild) {
pTree = pTree->firstChild;
@@ -912,7 +912,7 @@ miOverlayHandleExposures(WindowPtr pWin)
}
RegionUninit(&val->after.borderExposed);
RegionUninit(&val->after.exposed);
- xfree(val);
+ free(val);
pChild->valdata = (ValidatePtr)NULL;
if (pChild->firstChild)
{
diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c
index 0320a5930..3e9fd0760 100644
--- a/nx-X11/programs/Xserver/mi/mipointer.c
+++ b/nx-X11/programs/Xserver/mi/mipointer.c
@@ -88,7 +88,7 @@ miPointerInitialize (pScreen, spriteFuncs, screenFuncs, waitForUpdate)
return FALSE;
miPointerGeneration = serverGeneration;
}
- pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec));
+ pScreenPriv = (miPointerScreenPtr) malloc (sizeof (miPointerScreenRec));
if (!pScreenPriv)
return FALSE;
pScreenPriv->spriteFuncs = spriteFuncs;
@@ -146,7 +146,7 @@ miPointerCloseScreen (index, pScreen)
if (pScreen == miPointer.pSpriteScreen)
miPointer.pSpriteScreen = 0;
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (index, pScreen);
}
diff --git a/nx-X11/programs/Xserver/mi/mipolyutil.c b/nx-X11/programs/Xserver/mi/mipolyutil.c
index be62250ee..f88d03d54 100644
--- a/nx-X11/programs/Xserver/mi/mipolyutil.c
+++ b/nx-X11/programs/Xserver/mi/mipolyutil.c
@@ -106,7 +106,7 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
if (*iSLLBlock > SLLSPERBLOCK-1)
{
tmpSLLBlock =
- (ScanLineListBlock *)xalloc(sizeof(ScanLineListBlock));
+ (ScanLineListBlock *)malloc(sizeof(ScanLineListBlock));
if (!tmpSLLBlock)
return FALSE;
(*SLLBlock)->next = tmpSLLBlock;
@@ -395,7 +395,7 @@ miFreeStorage(pSLLBlock)
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
- xfree(pSLLBlock);
+ free(pSLLBlock);
pSLLBlock = tmpSLLBlock;
}
}
diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c
index 44834db50..084597392 100644
--- a/nx-X11/programs/Xserver/mi/mipushpxl.c
+++ b/nx-X11/programs/Xserver/mi/mipushpxl.c
@@ -113,7 +113,7 @@ miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
#endif
- pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx));
+ pwLineStart = (MiBits *)malloc(BitmapBytePad(dx));
if (!pwLineStart)
return;
ipt = 0;
@@ -252,7 +252,7 @@ miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
}
}
}
- xfree(pwLineStart);
+ free(pwLineStart);
/* Flush any remaining spans */
if (ipt)
{
diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c
index da80932ad..f2b009fcd 100644
--- a/nx-X11/programs/Xserver/mi/miscrinit.c
+++ b/nx-X11/programs/Xserver/mi/miscrinit.c
@@ -180,7 +180,7 @@ miCreateScreenResources(pScreen)
{
value = pScrInitParms->pbits;
}
- xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
+ free(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
pScreen->devPrivate = value; /* pPixmap or pbits */
return TRUE;
}
@@ -197,7 +197,7 @@ miScreenDevPrivateInit(pScreen, width, pbits)
* to the screen, until CreateScreenResources can put them in the
* screen pixmap.
*/
- pScrInitParms = (miScreenInitParmsPtr)xalloc(sizeof(miScreenInitParmsRec));
+ pScrInitParms = (miScreenInitParmsPtr)malloc(sizeof(miScreenInitParmsRec));
if (!pScrInitParms)
return FALSE;
pScrInitParms->pbits = pbits;
diff --git a/nx-X11/programs/Xserver/mi/mispans.c b/nx-X11/programs/Xserver/mi/mispans.c
index 48252f323..ef2dc269f 100644
--- a/nx-X11/programs/Xserver/mi/mispans.c
+++ b/nx-X11/programs/Xserver/mi/mispans.c
@@ -155,12 +155,12 @@ void miSubtractSpans (spanGroup, sub)
int *newwid;
#define EXTRA 8
- newPt = (DDXPointPtr) xrealloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec));
+ newPt = (DDXPointPtr) realloc (spans->points, (spans->count + EXTRA) * sizeof (DDXPointRec));
if (!newPt)
break;
spansPt = newPt + (spansPt - spans->points);
spans->points = newPt;
- newwid = (int *) xrealloc (spans->widths, (spans->count + EXTRA) * sizeof (int));
+ newwid = (int *) realloc (spans->widths, (spans->count + EXTRA) * sizeof (int));
if (!newwid)
break;
spansWid = newwid + (spansWid - spans->widths);
@@ -198,7 +198,7 @@ void miAppendSpans(spanGroup, otherGroup, spans)
if (spanGroup->size == spanGroup->count) {
spanGroup->size = (spanGroup->size + 8) * 2;
spanGroup->group = (Spans *)
- xrealloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
+ realloc(spanGroup->group, sizeof(Spans) * spanGroup->size);
}
spanGroup->group[spanGroup->count] = *spans;
@@ -216,15 +216,15 @@ void miAppendSpans(spanGroup, otherGroup, spans)
}
else
{
- xfree (spans->points);
- xfree (spans->widths);
+ free (spans->points);
+ free (spans->widths);
}
} /* AppendSpans */
void miFreeSpanGroup(spanGroup)
SpanGroup *spanGroup;
{
- if (spanGroup->group != NULL) xfree(spanGroup->group);
+ if (spanGroup->group != NULL) free(spanGroup->group);
}
static void QuickSortSpansX(
@@ -376,8 +376,8 @@ miDisposeSpanGroup (spanGroup)
for (i = 0; i < spanGroup->count; i++)
{
spans = spanGroup->group + i;
- xfree (spans->points);
- xfree (spans->widths);
+ free (spans->points);
+ free (spans->widths);
}
}
@@ -404,8 +404,8 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
spans = spanGroup->group;
(*pGC->ops->FillSpans)
(pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
+ free(spans->points);
+ free(spans->widths);
}
else
{
@@ -418,15 +418,15 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
ylength = spanGroup->ymax - ymin + 1;
/* Allocate Spans for y buckets */
- yspans = (Spans *) xalloc(ylength * sizeof(Spans));
- ysizes = (int *) xalloc(ylength * sizeof (int));
+ yspans = (Spans *) malloc(ylength * sizeof(Spans));
+ ysizes = (int *) malloc(ylength * sizeof (int));
if (!yspans || !ysizes)
{
if (yspans)
- xfree (yspans);
+ free (yspans);
if (ysizes)
- xfree (ysizes);
+ free (ysizes);
miDisposeSpanGroup (spanGroup);
return;
}
@@ -456,10 +456,10 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
DDXPointPtr newpoints;
int *newwidths;
ysizes[index] = (ysizes[index] + 8) * 2;
- newpoints = (DDXPointPtr) xrealloc(
+ newpoints = (DDXPointPtr) realloc(
newspans->points,
ysizes[index] * sizeof(DDXPointRec));
- newwidths = (int *) xrealloc(
+ newwidths = (int *) realloc(
newspans->widths,
ysizes[index] * sizeof(int));
if (!newpoints || !newwidths)
@@ -468,11 +468,11 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
for (i = 0; i < ylength; i++)
{
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
+ free (yspans[i].points);
+ free (yspans[i].widths);
}
- xfree (yspans);
- xfree (ysizes);
+ free (yspans);
+ free (ysizes);
miDisposeSpanGroup (spanGroup);
return;
}
@@ -485,30 +485,30 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
} /* if y value of span in range */
} /* for j through spans */
count += spans->count;
- xfree(spans->points);
+ free(spans->points);
spans->points = NULL;
- xfree(spans->widths);
+ free(spans->widths);
spans->widths = NULL;
} /* for i thorough Spans */
/* Now sort by x and uniquify each bucket into the final array */
- points = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec));
- widths = (int *) xalloc(count * sizeof(int));
+ points = (DDXPointPtr) malloc(count * sizeof(DDXPointRec));
+ widths = (int *) malloc(count * sizeof(int));
if (!points || !widths)
{
int i;
for (i = 0; i < ylength; i++)
{
- xfree (yspans[i].points);
- xfree (yspans[i].widths);
+ free (yspans[i].points);
+ free (yspans[i].widths);
}
- xfree (yspans);
- xfree (ysizes);
+ free (yspans);
+ free (ysizes);
if (points)
- xfree (points);
+ free (points);
if (widths)
- xfree (widths);
+ free (widths);
return;
}
count = 0;
@@ -524,16 +524,16 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
widths[count] = yspans[i].widths[0];
count++;
}
- xfree(yspans[i].points);
- xfree(yspans[i].widths);
+ free(yspans[i].points);
+ free(yspans[i].widths);
}
}
(*pGC->ops->FillSpans) (pDraw, pGC, count, points, widths, TRUE);
- xfree(points);
- xfree(widths);
- xfree(yspans);
- xfree(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */
+ free(points);
+ free(widths);
+ free(yspans);
+ free(ysizes); /* use (DE)ALLOCATE_LOCAL for these? */
}
spanGroup->count = 0;
@@ -553,8 +553,8 @@ void miFillSpanGroup(pDraw, pGC, spanGroup)
for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
(*pGC->ops->FillSpans)
(pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
- xfree(spans->points);
- xfree(spans->widths);
+ free(spans->points);
+ free(spans->widths);
}
spanGroup->count = 0;
diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c
index c854984fc..b1555ec1b 100644
--- a/nx-X11/programs/Xserver/mi/misprite.c
+++ b/nx-X11/programs/Xserver/mi/misprite.c
@@ -169,7 +169,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
miSpriteGeneration = serverGeneration;
}
- pScreenPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec));
+ pScreenPriv = (miSpriteScreenPtr) malloc (sizeof (miSpriteScreenRec));
if (!pScreenPriv)
return FALSE;
@@ -182,7 +182,7 @@ miSpriteInitialize (pScreen, cursorFuncs, screenFuncs)
if (!miPointerInitialize (pScreen, &miSpritePointerFuncs, screenFuncs,TRUE))
{
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return FALSE;
}
for (pVisual = pScreen->visuals;
@@ -270,7 +270,7 @@ miSpriteCloseScreen (i, pScreen)
miSpriteIsUpFALSE (pScreen, pScreenPriv);
DamageDestroy (pScreenPriv->pDamage);
- xfree ((void *) pScreenPriv);
+ free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c
index fa9ef4591..b96db7cfa 100644
--- a/nx-X11/programs/Xserver/mi/miwideline.c
+++ b/nx-X11/programs/Xserver/mi/miwideline.c
@@ -127,13 +127,13 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
}
else
{
- spanRec.points = (DDXPointPtr) xalloc (overall_height * sizeof (*ppt));
+ spanRec.points = (DDXPointPtr) malloc (overall_height * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = (int *) xalloc (overall_height * sizeof (int));
+ spanRec.widths = (int *) malloc (overall_height * sizeof (int));
if (!spanRec.widths)
{
- xfree (spanRec.points);
+ free (spanRec.points);
return;
}
ppt = spanRec.points;
@@ -231,13 +231,13 @@ miFillRectPolyHelper (
}
else
{
- spanRec.points = (DDXPointPtr) xalloc (h * sizeof (*ppt));
+ spanRec.points = (DDXPointPtr) malloc (h * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = (int *) xalloc (h * sizeof (int));
+ spanRec.widths = (int *) malloc (h * sizeof (int));
if (!spanRec.widths)
{
- xfree (spanRec.points);
+ free (spanRec.points);
return;
}
ppt = spanRec.points;
@@ -1076,13 +1076,13 @@ miLineArc (
}
else
{
- points = (DDXPointPtr) xalloc (pGC->lineWidth * sizeof (DDXPointRec));
+ points = (DDXPointPtr) malloc (pGC->lineWidth * sizeof (DDXPointRec));
if (!points)
return;
- widths = (int *) xalloc (pGC->lineWidth * sizeof (int));
+ widths = (int *) malloc (pGC->lineWidth * sizeof (int));
if (!widths)
{
- xfree (points);
+ free (points);
return;
}
spanRec.points = points;
diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c
index aff7128c3..9e87e7095 100644
--- a/nx-X11/programs/Xserver/mi/miwindow.c
+++ b/nx-X11/programs/Xserver/mi/miwindow.c
@@ -471,7 +471,7 @@ miHandleValidateExposures(pWin)
RegionUninit(&val->after.borderExposed);
(*WindowExposures)(pChild, &val->after.exposed, NullRegion);
RegionUninit(&val->after.exposed);
- xfree(val);
+ free(val);
pChild->valdata = (ValidatePtr)NULL;
if (pChild->firstChild)
{
diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c
index 9f39b9650..8aca3edf7 100644
--- a/nx-X11/programs/Xserver/miext/cw/cw.c
+++ b/nx-X11/programs/Xserver/miext/cw/cw.c
@@ -641,7 +641,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
return;
#endif
- pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec));
+ pScreenPriv = (cwScreenPtr)malloc(sizeof(cwScreenRec));
if (!pScreenPriv)
return;
@@ -693,7 +693,7 @@ cwCloseScreen (int i, ScreenPtr pScreen)
cwFiniRender(pScreen);
#endif
- xfree((void *)pScreenPriv);
+ free((void *)pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
diff --git a/nx-X11/programs/Xserver/miext/cw/cw_render.c b/nx-X11/programs/Xserver/miext/cw/cw_render.c
index 74c52afb0..ac4230a03 100644
--- a/nx-X11/programs/Xserver/miext/cw/cw_render.c
+++ b/nx-X11/programs/Xserver/miext/cw/cw_render.c
@@ -74,7 +74,7 @@ cwCreatePicturePrivate (PicturePtr pPicture)
int error;
cwPicturePtr pPicturePrivate;
- pPicturePrivate = xalloc (sizeof (cwPictureRec));
+ pPicturePrivate = malloc (sizeof (cwPictureRec));
if (!pPicturePrivate)
return NULL;
@@ -84,7 +84,7 @@ cwCreatePicturePrivate (PicturePtr pPicture)
&error);
if (!pPicturePrivate->pBackingPicture)
{
- xfree (pPicturePrivate);
+ free (pPicturePrivate);
return NULL;
}
@@ -108,7 +108,7 @@ cwDestroyPicturePrivate (PicturePtr pPicture)
{
if (pPicturePrivate->pBackingPicture)
FreePicture (pPicturePrivate->pBackingPicture, 0);
- xfree (pPicturePrivate);
+ free (pPicturePrivate);
setCwPicture(pPicture, NULL);
}
}
diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c
index f28d95820..669f08ff5 100755
--- a/nx-X11/programs/Xserver/miext/damage/damage.c
+++ b/nx-X11/programs/Xserver/miext/damage/damage.c
@@ -1726,7 +1726,7 @@ damageCloseScreen (int i, ScreenPtr pScreen)
unwrap (pScrPriv, pScreen, CopyWindow);
unwrap (pScrPriv, pScreen, CloseScreen);
unwrap (pScrPriv, pScreen, BackingStoreFuncs.RestoreAreas);
- xfree (pScrPriv);
+ free (pScrPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -1770,7 +1770,7 @@ DamageSetup (ScreenPtr pScreen)
if (!AllocateWindowPrivate (pScreen, damageWinPrivateIndex, 0))
return FALSE;
- pScrPriv = (DamageScrPrivPtr) xalloc (sizeof (DamageScrPrivRec));
+ pScrPriv = (DamageScrPrivPtr) malloc (sizeof (DamageScrPrivRec));
if (!pScrPriv)
return FALSE;
@@ -1818,7 +1818,7 @@ DamageCreate (DamageReportFunc damageReport,
{
DamagePtr pDamage;
- pDamage = xalloc (sizeof (DamageRec));
+ pDamage = malloc (sizeof (DamageRec));
if (!pDamage)
return 0;
pDamage->pNext = 0;
@@ -1913,7 +1913,7 @@ DamageDestroy (DamagePtr pDamage)
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
RegionUninit(&pDamage->damage);
- xfree (pDamage);
+ free (pDamage);
}
Bool
diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile
index 00d28deb1..802725306 100644
--- a/nx-X11/programs/Xserver/os/Imakefile
+++ b/nx-X11/programs/Xserver/os/Imakefile
@@ -91,11 +91,6 @@ COLOR_SRCS=oscolor.c
COLOR_OBJS=oscolor.o
#endif
-#if UseInternalMalloc
-MALLOC_SRCS=xalloc.c
-MALLOC_OBJS=xalloc.o
-#endif
-
#if !HasSnprintf
SNPRINTF_SRCS = snprintf.c
SNPRINTF_OBJS = snprintf.o
@@ -119,19 +114,13 @@ BOOTSTRAPCFLAGS =
osinit.c utils.c log.c auth.c mitauth.c secauth.c \
$(XDMAUTHSRCS) $(RPCSRCS) xdmcp.c OtherSources \
transport.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \
- $(MALLOC_SRCS) xprintf.c
+ xprintf.c
OBJS = WaitFor.o access.o connection.o io.o $(COLOR_OBJS) \
osinit.o utils.o log.o auth.o mitauth.o secauth.o \
$(XDMAUTHOBJS) $(RPCOBJS) xdmcp.o OtherObjects \
transport.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \
- $(MALLOC_OBJS) xprintf.o
+ xprintf.o
-#if SpecialMalloc
- MEM_DEFINES = -DSPECIAL_MALLOC
-#endif /* SpecialMalloc */
-#if UseInternalMalloc
- MEM_DEFINES = -DINTERNAL_MALLOC
-#endif
#if UseMemLeak
MEM_DEFINES = -DMEMBUG
#endif
@@ -141,7 +130,6 @@ BOOTSTRAPCFLAGS =
DBM_DEFINES = NdbmDefines
ADM_DEFINES = -DADMPATH=\"$(ADMDIR)/X\%smsgs\"
XDMCP_DEFINES = ServerXdmcpDefines
- XALLOC_DEFINES = XallocDefines
ERROR_DEFINES = ServerErrorDefines
#if HasPam && HasPamMisc
PAM_DEFINES = -DUSE_PAM
@@ -189,7 +177,6 @@ SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES))
SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(utils,$(ICONFIGFILES),$(XDMCP_DEFINES) $(EXT_DEFINES) $(ERROR_DEFINES) $(PAM_DEFINES))
-SpecialCObjectRule(xalloc,$(ICONFIGFILES),$(XALLOC_DEFINES))
#if defined(SparcArchitecture) && HasGcc && !HasGcc2
oscolor.o: oscolor.c $(ICONFIGFILES)
$(RM) $@
diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c
index 0a18c28c8..0f23c9d4a 100644
--- a/nx-X11/programs/Xserver/os/WaitFor.c
+++ b/nx-X11/programs/Xserver/os/WaitFor.c
@@ -650,7 +650,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
if (!timer)
{
- timer = (OsTimerPtr)xalloc(sizeof(struct _OsTimerRec));
+ timer = (OsTimerPtr)malloc(sizeof(struct _OsTimerRec));
if (!timer)
return NULL;
}
@@ -730,7 +730,7 @@ TimerFree(OsTimerPtr timer)
if (!timer)
return;
TimerCancel(timer);
- xfree(timer);
+ free(timer);
}
void
@@ -750,7 +750,7 @@ TimerInit(void)
while ((timer = timers))
{
timers = timer->next;
- xfree(timer);
+ free(timer);
}
}
diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c
index 7f45e5ec9..4090a9589 100644
--- a/nx-X11/programs/Xserver/os/access.c
+++ b/nx-X11/programs/Xserver/os/access.c
@@ -256,12 +256,12 @@ typedef struct _host {
int requested;
} HOST;
-#define MakeHost(h,l) (h)=(HOST *) xalloc(sizeof *(h)+(l));\
+#define MakeHost(h,l) (h)=(HOST *) malloc(sizeof *(h)+(l));\
if (h) { \
(h)->addr=(unsigned char *) ((h) + 1);\
(h)->requested = FALSE; \
}
-#define FreeHost(h) xfree(h)
+#define FreeHost(h) free(h)
static HOST *selfhosts = NULL;
static HOST *validhosts = NULL;
static int AccessEnabled = DEFAULT_ACCESS_CONTROL;
@@ -782,7 +782,7 @@ DefineSelf (int fd)
Error ("Getting interface count");
if (len < (ifn.lifn_count * sizeof(struct lifreq))) {
len = ifn.lifn_count * sizeof(struct lifreq);
- bufptr = xalloc(len);
+ bufptr = malloc(len);
}
#endif
@@ -1376,12 +1376,12 @@ Bool LocalClient(ClientPtr client)
&alen, (void **)&addr);
if (family == -1)
{
- xfree ((char *) from);
+ free ((char *) from);
return FALSE;
}
if (family == FamilyLocal)
{
- xfree ((char *) from);
+ free ((char *) from);
return TRUE;
}
for (host = selfhosts; host; host = host->next)
@@ -1389,7 +1389,7 @@ Bool LocalClient(ClientPtr client)
if (addrEqual (family, addr, alen, host))
return TRUE;
}
- xfree ((char *) from);
+ free ((char *) from);
}
return FALSE;
}
@@ -1477,7 +1477,7 @@ LocalClientCredAndGroups(ClientPtr client, int *pUid, int *pGid,
const gid_t *gids;
*nSuppGids = ucred_getgroups(peercred, &gids);
if (*nSuppGids > 0) {
- *pSuppGids = xalloc(sizeof(int) * (*nSuppGids));
+ *pSuppGids = malloc(sizeof(int) * (*nSuppGids));
if (*pSuppGids == NULL) {
*nSuppGids = 0;
} else {
@@ -1691,7 +1691,7 @@ GetHosts (
}
if (n)
{
- *data = ptr = (void *) xalloc (n);
+ *data = ptr = (void *) malloc (n);
if (!ptr)
{
return(BadAlloc);
@@ -1951,7 +1951,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch,
}
}
- s = (struct siType *) xalloc(sizeof(struct siType));
+ s = (struct siType *) malloc(sizeof(struct siType));
if (s == NULL)
return BadAlloc;
@@ -2293,7 +2293,7 @@ static Bool
siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id)
{
Bool parsedOK = FALSE;
- char *addrbuf = xalloc(len + 1);
+ char *addrbuf = malloc(len + 1);
if (addrbuf == NULL) {
return FALSE;
@@ -2327,7 +2327,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id)
}
}
- xfree(addrbuf);
+ free(addrbuf);
return parsedOK;
}
@@ -2360,11 +2360,11 @@ siLocalCredAddrMatch(int family, void * addr, int len,
for (i = 0 ; i < connNumSuppGids; i++) {
if (connSuppGids[i] == siAddrId) {
- xfree(connSuppGids);
+ free(connSuppGids);
return TRUE;
}
}
- xfree(connSuppGids);
+ free(connSuppGids);
}
}
return FALSE;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 2df92bf91..15321458e 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -261,7 +261,7 @@ void SetConnectionTranslation(int conn, int client)
}
node = &((*node)->next);
}
- *node = (struct _ct_node*)xalloc(sizeof(struct _ct_node));
+ *node = (struct _ct_node*)malloc(sizeof(struct _ct_node));
(*node)->next = NULL;
(*node)->key = conn;
(*node)->value = client;
@@ -279,7 +279,7 @@ void ClearConnectionTranslation(void)
{
struct _ct_node *temp = node;
node = node->next;
- xfree(temp);
+ free(temp);
}
}
}
@@ -407,7 +407,7 @@ CreateWellKnownSockets(void)
}
else
{
- ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int));
+ ListenTransFds = (int *) malloc (ListenTransCount * sizeof (int));
for (i = 0; i < ListenTransCount; i++)
{
@@ -713,7 +713,7 @@ ClientAuthorized(ClientPtr client,
proto_n, auth_proto, auth_id);
}
- xfree ((char *) from);
+ free ((char *) from);
}
if (auth_id == (XID) ~0L) {
@@ -731,7 +731,7 @@ ClientAuthorized(ClientPtr client,
AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen,
proto_n, auth_proto, auth_id);
- xfree ((char *) from);
+ free ((char *) from);
}
}
priv->auth_id = auth_id;
@@ -764,7 +764,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
#endif
)
return NullClient;
- oc = (OsCommPtr)xalloc(sizeof(OsCommRec));
+ oc = (OsCommPtr)malloc(sizeof(OsCommRec));
if (!oc)
return NullClient;
oc->trans_conn = trans_conn;
@@ -775,7 +775,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
oc->conn_time = conn_time;
if (!(client = NextAvailableClient((void *)oc)))
{
- xfree (oc);
+ free (oc);
return NullClient;
}
{
@@ -962,7 +962,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
_XSERVTransClose(oc->trans_conn);
}
FreeOsBuffers(oc);
- xfree(oc);
+ free(oc);
#ifndef WIN32
ConnectionTranslation[connection] = 0;
#else
diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c
index fefe3007f..d0862ddd4 100644
--- a/nx-X11/programs/Xserver/os/io.c
+++ b/nx-X11/programs/Xserver/os/io.c
@@ -222,8 +222,8 @@ ReadRequestFromClient(ClientPtr client)
register ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK)
{
- xfree(aci->buffer);
- xfree(aci);
+ free(aci->buffer);
+ free(aci);
}
else
{
@@ -321,7 +321,7 @@ ReadRequestFromClient(ClientPtr client)
/* make buffer bigger to accomodate request */
char *ibuf;
- ibuf = (char *)xrealloc(oci->buffer, needed);
+ ibuf = (char *)realloc(oci->buffer, needed);
if (!ibuf)
{
YieldControlDeath();
@@ -371,7 +371,7 @@ ReadRequestFromClient(ClientPtr client)
{
char *ibuf;
- ibuf = (char *)xrealloc(oci->buffer, BUFSIZE);
+ ibuf = (char *)realloc(oci->buffer, BUFSIZE);
if (ibuf)
{
oci->size = BUFSIZE;
@@ -504,8 +504,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK)
{
- xfree(aci->buffer);
- xfree(aci);
+ free(aci->buffer);
+ free(aci);
}
else
{
@@ -531,7 +531,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
{
char *ibuf;
- ibuf = (char *)xrealloc(oci->buffer, gotnow + count);
+ ibuf = (char *)realloc(oci->buffer, gotnow + count);
if (!ibuf)
return(FALSE);
oci->size = gotnow + count;
@@ -1097,7 +1097,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
{
unsigned char *obuf;
- obuf = (unsigned char *)xrealloc(oco->buf,
+ obuf = (unsigned char *)realloc(oco->buf,
notWritten + BUFSIZE);
if (!obuf)
{
@@ -1154,8 +1154,8 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
}
if (oco->size > BUFWATERMARK)
{
- xfree(oco->buf);
- xfree(oco);
+ free(oco->buf);
+ free(oco);
}
else
{
@@ -1171,13 +1171,13 @@ AllocateInputBuffer(void)
{
ConnectionInputPtr oci;
- oci = (ConnectionInputPtr)xalloc(sizeof(ConnectionInput));
+ oci = (ConnectionInputPtr)malloc(sizeof(ConnectionInput));
if (!oci)
return (ConnectionInputPtr)NULL;
- oci->buffer = (char *)xalloc(BUFSIZE);
+ oci->buffer = (char *)malloc(BUFSIZE);
if (!oci->buffer)
{
- xfree(oci);
+ free(oci);
return (ConnectionInputPtr)NULL;
}
oci->size = BUFSIZE;
@@ -1192,13 +1192,13 @@ AllocateOutputBuffer(void)
{
ConnectionOutputPtr oco;
- oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput));
+ oco = (ConnectionOutputPtr)malloc(sizeof(ConnectionOutput));
if (!oco)
return (ConnectionOutputPtr)NULL;
- oco->buf = (unsigned char *) xalloc(BUFSIZE);
+ oco->buf = (unsigned char *) malloc(BUFSIZE);
if (!oco->buf)
{
- xfree(oco);
+ free(oco);
return (ConnectionOutputPtr)NULL;
}
oco->size = BUFSIZE;
@@ -1218,8 +1218,8 @@ FreeOsBuffers(OsCommPtr oc)
{
if (FreeInputs)
{
- xfree(oci->buffer);
- xfree(oci);
+ free(oci->buffer);
+ free(oci);
}
else
{
@@ -1234,8 +1234,8 @@ FreeOsBuffers(OsCommPtr oc)
{
if (FreeOutputs)
{
- xfree(oco->buf);
- xfree(oco);
+ free(oco->buf);
+ free(oco);
}
else
{
@@ -1255,13 +1255,13 @@ ResetOsBuffers(void)
while ((oci = FreeInputs))
{
FreeInputs = oci->next;
- xfree(oci->buffer);
- xfree(oci);
+ free(oci->buffer);
+ free(oci);
}
while ((oco = FreeOutputs))
{
FreeOutputs = oco->next;
- xfree(oco->buf);
- xfree(oco);
+ free(oco->buf);
+ free(oco);
}
}
diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c
index 84381dbf2..d97317819 100644
--- a/nx-X11/programs/Xserver/os/log.c
+++ b/nx-X11/programs/Xserver/os/log.c
@@ -186,7 +186,7 @@ LogInit(const char *fname, const char *backup)
char *logFileName = NULL;
if (fname && *fname) {
- /* xalloc() can't be used yet. */
+ /* malloc() can't be used yet. */
logFileName = malloc(strlen(fname) + strlen(display) + 1);
if (!logFileName)
FatalError("Cannot allocate space for the log file name\n");
@@ -236,7 +236,7 @@ LogInit(const char *fname, const char *backup)
* needed.
*/
if (saveBuffer && bufferSize > 0) {
- free(saveBuffer); /* Must be free(), not xfree() */
+ free(saveBuffer); /* Must be free(), not free() */
saveBuffer = NULL;
bufferSize = 0;
}
@@ -333,7 +333,7 @@ LogVWrite(int verb, const char *f, va_list args)
} else if (needBuffer) {
/*
* Note, this code is used before OsInit() has been called, so
- * xalloc() and friends can't be used.
+ * malloc() and friends can't be used.
*/
if (len > bufferUnused) {
bufferSize += 1024;
diff --git a/nx-X11/programs/Xserver/os/mitauth.c b/nx-X11/programs/Xserver/os/mitauth.c
index abf7976af..2630a81ae 100644
--- a/nx-X11/programs/Xserver/os/mitauth.c
+++ b/nx-X11/programs/Xserver/os/mitauth.c
@@ -57,12 +57,12 @@ MitAddCookie (
{
struct auth *new;
- new = (struct auth *) xalloc (sizeof (struct auth));
+ new = (struct auth *) malloc (sizeof (struct auth));
if (!new)
return 0;
- new->data = (char *) xalloc ((unsigned) data_length);
+ new->data = (char *) malloc ((unsigned) data_length);
if (!new->data) {
- xfree(new);
+ free(new);
return 0;
}
new->next = mit_auth;
@@ -98,8 +98,8 @@ MitResetCookie (void)
for (auth = mit_auth; auth; auth=next) {
next = auth->next;
- xfree (auth->data);
- xfree (auth);
+ free (auth->data);
+ free (auth);
}
mit_auth = 0;
return 0;
@@ -154,8 +154,8 @@ MitRemoveCookie (
prev->next = auth->next;
else
mit_auth = auth->next;
- xfree (auth->data);
- xfree (auth);
+ free (auth->data);
+ free (auth);
return 1;
}
}
diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c
index a8b01b4b9..2ea81060d 100644
--- a/nx-X11/programs/Xserver/os/oscolor.c
+++ b/nx-X11/programs/Xserver/os/oscolor.c
@@ -134,11 +134,11 @@ OsLookupColor(int screen, char *name, unsigned int len,
if(!rgb_dbm)
return(0);
- /* we use xalloc here so that we can compile with cc without alloca
+ /* we use malloc here so that we can compile with cc without alloca
* when otherwise using gcc */
if (len < sizeof(buf))
lowername = buf;
- else if (!(lowername = (char *)xalloc(len + 1)))
+ else if (!(lowername = (char *)malloc(len + 1)))
return(0);
CopyISOLatin1Lowered ((unsigned char *) lowername, (unsigned char *) name,
(int)len);
@@ -152,7 +152,7 @@ OsLookupColor(int screen, char *name, unsigned int len,
#endif
if (len >= sizeof(buf))
- xfree(lowername);
+ free(lowername);
if(dbent.dptr)
{
@@ -372,7 +372,7 @@ lookup(char *name, int len, Bool create)
else
prev = &(hashTab[h]);
- if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len)))
+ if (!entry && create && (entry = (dbEntryPtr)malloc(sizeof(dbEntry) +len)))
{
*prev = entry;
entry->link = NULL;
diff --git a/nx-X11/programs/Xserver/os/rpcauth.c b/nx-X11/programs/Xserver/os/rpcauth.c
index 91823553c..40ea7ad97 100644
--- a/nx-X11/programs/Xserver/os/rpcauth.c
+++ b/nx-X11/programs/Xserver/os/rpcauth.c
@@ -77,7 +77,7 @@ authdes_ezdecode(char *inmsg, int len)
XDR xdr;
SVCXPRT xprt;
- temp_inmsg = (char *) xalloc(len);
+ temp_inmsg = (char *) malloc(len);
if (temp_inmsg == NULL) {
why = AUTH_FAILED; /* generic error, since there is no AUTH_BADALLOC */
return NULL;
@@ -94,7 +94,7 @@ authdes_ezdecode(char *inmsg, int len)
why = AUTH_FAILED;
xdrmem_create(&xdr, temp_inmsg, len, XDR_DECODE);
- if ((r.rq_clntcred = (caddr_t) xalloc(MAX_AUTH_BYTES)) == NULL)
+ if ((r.rq_clntcred = (caddr_t) malloc(MAX_AUTH_BYTES)) == NULL)
goto bad1;
r.rq_xprt = &xprt;
@@ -121,7 +121,7 @@ authdes_ezdecode(char *inmsg, int len)
return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name);
bad2:
- xfree(r.rq_clntcred);
+ free(r.rq_clntcred);
bad1:
return ((char *)0); /* ((struct authdes_cred *) NULL); */
}
diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c
index 90cf55d1a..f5f09c320 100644
--- a/nx-X11/programs/Xserver/os/utils.c
+++ b/nx-X11/programs/Xserver/os/utils.c
@@ -261,12 +261,6 @@ int SyncOn = 0;
extern int SelectWaitTime;
#endif
-#ifdef DEBUG
-#ifndef SPECIAL_MALLOC
-#define MEMBUG
-#endif
-#endif
-
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
#define HAS_SAVED_IDS_AND_SETEUID
#endif
@@ -1186,7 +1180,7 @@ InsertFileIntoCommandLine(
fstat(fileno(f), &st);
- buf = (char *) xalloc((unsigned) st.st_size + 1);
+ buf = (char *) malloc((unsigned) st.st_size + 1);
if (!buf)
FatalError("Out of Memory\n");
@@ -1226,12 +1220,12 @@ InsertFileIntoCommandLine(
}
}
- buf = (char *) xrealloc(buf, q - buf);
+ buf = (char *) realloc(buf, q - buf);
if (!buf)
FatalError("Out of memory reallocing option buf\n");
*resargc = prefix_argc + insert_argc + suffix_argc;
- *resargv = (char **) xalloc((*resargc + 1) * sizeof(char *));
+ *resargv = (char **) malloc((*resargc + 1) * sizeof(char *));
if (!*resargv)
FatalError("Out of Memory\n");
@@ -1316,7 +1310,7 @@ set_font_authorizations(char **authorizations, int *authlen, void * client)
#endif
len = strlen(hnameptr) + 1;
- result = xalloc(len + sizeof(AUTHORIZATION_NAME) + 4);
+ result = malloc(len + sizeof(AUTHORIZATION_NAME) + 4);
p = result;
*p++ = sizeof(AUTHORIZATION_NAME) >> 8;
@@ -1342,80 +1336,20 @@ set_font_authorizations(char **authorizations, int *authlen, void * client)
#endif /* TCPCONN */
}
-/* XALLOC -- X's internal memory allocator. Why does it return unsigned
- * long * instead of the more common char *? Well, if you read K&R you'll
- * see they say that alloc must return a pointer "suitable for conversion"
- * to whatever type you really want. In a full-blown generic allocator
- * there's no way to solve the alignment problems without potentially
- * wasting lots of space. But we have a more limited problem. We know
- * we're only ever returning pointers to structures which will have to
- * be long word aligned. So we are making a stronger guarantee. It might
- * have made sense to make Xalloc return char * to conform with people's
- * expectations of malloc, but this makes lint happier.
- */
-
-#ifndef INTERNAL_MALLOC
-
-void *
-Xalloc(unsigned long amount)
-{
- register void * ptr;
-
- if ((long)amount <= 0) {
- return (unsigned long *)NULL;
- }
- /* aligned extra on long word boundary */
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
-#ifdef MEMBUG
- if (!Must_have_memory && Memory_fail &&
- ((random() % MEM_FAIL_SCALE) < Memory_fail))
- return (unsigned long *)NULL;
-#endif
- if ((ptr = (void *)malloc(amount))) {
- return (unsigned long *)ptr;
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- return (unsigned long *)NULL;
-}
-
/*****************
* XNFalloc
- * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory
+ * "no failure" alloc
*****************/
void *
XNFalloc(unsigned long amount)
{
- register void * ptr;
-
- if ((long)amount <= 0)
- {
- return (unsigned long *)NULL;
- }
- /* aligned extra on long word boundary */
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
- ptr = (void *)malloc(amount);
+ void *ptr = malloc(amount);
if (!ptr)
{
FatalError("Out of memory");
}
- return ((unsigned long *)ptr);
-}
-
-/*****************
- * Xcalloc
- *****************/
-
-void *
-Xcalloc(unsigned long amount)
-{
- unsigned long *ret;
-
- ret = Xalloc (amount);
- if (ret)
- bzero ((char *) ret, (int) amount);
- return ret;
+ return ptr;
}
/*****************
@@ -1425,72 +1359,24 @@ Xcalloc(unsigned long amount)
void *
XNFcalloc(unsigned long amount)
{
- unsigned long *ret;
-
- ret = Xalloc (amount);
- if (ret)
- bzero ((char *) ret, (int) amount);
- else if ((long)amount > 0)
- FatalError("Out of memory");
+ void *ret = calloc(1, amount);
+ if (!ret)
+ FatalError("XNFcalloc: Out of memory");
return ret;
}
/*****************
- * Xrealloc
- *****************/
-
-void *
-Xrealloc(void * ptr, unsigned long amount)
-{
-#ifdef MEMBUG
- if (!Must_have_memory && Memory_fail &&
- ((random() % MEM_FAIL_SCALE) < Memory_fail))
- return (unsigned long *)NULL;
-#endif
- if ((long)amount <= 0)
- {
- if (ptr && !amount)
- free(ptr);
- return (unsigned long *)NULL;
- }
- amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
- if (ptr)
- ptr = (void *)realloc((char *)ptr, amount);
- else
- ptr = (void *)malloc(amount);
- if (ptr)
- return (unsigned long *)ptr;
- if (Must_have_memory)
- FatalError("Out of memory");
- return (unsigned long *)NULL;
-}
-
-/*****************
* XNFrealloc
- * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory
+ * "no failure" realloc
*****************/
void *
XNFrealloc(void * ptr, unsigned long amount)
{
- if (( ptr = (void *)Xrealloc( ptr, amount ) ) == NULL)
- {
- if ((long)amount > 0)
- FatalError( "Out of memory" );
- }
- return ((unsigned long *)ptr);
-}
-
-/*****************
- * Xfree
- * calls free
- *****************/
-
-void
-Xfree(void * ptr)
-{
- if (ptr)
- free((char *)ptr);
+ void *ret = realloc(ptr, amount);
+ if (!ret)
+ FatalError("XNFrealloc: Out of memory");
+ return ret;
}
void
@@ -1506,35 +1392,28 @@ OsInitAllocator (void)
been_here = 1;
#endif
}
-#endif /* !INTERNAL_MALLOC */
-
char *
Xstrdup(const char *s)
{
- char *sd;
-
if (s == NULL)
return NULL;
-
- sd = (char *)Xalloc(strlen(s) + 1);
- if (sd != NULL)
- strcpy(sd, s);
- return sd;
+ return strdup(s);
}
char *
XNFstrdup(const char *s)
{
- char *sd;
+ char *ret;
if (s == NULL)
return NULL;
- sd = (char *)XNFalloc(strlen(s) + 1);
- strcpy(sd, s);
- return sd;
+ ret = strdup(s);
+ if (!ret)
+ FatalError("XNFstrdup: Out of memory");
+ return ret;
}
#ifdef SMART_SCHEDULE
@@ -1808,11 +1687,11 @@ Popen(char *command, char *type)
if ((*type != 'r' && *type != 'w') || type[1])
return NULL;
- if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL)
+ if ((cur = (struct pid *)malloc(sizeof(struct pid))) == NULL)
return NULL;
if (pipe(pdes) < 0) {
- xfree(cur);
+ free(cur);
return NULL;
}
@@ -1826,7 +1705,7 @@ Popen(char *command, char *type)
case -1: /* error */
close(pdes[0]);
close(pdes[1]);
- xfree(cur);
+ free(cur);
#ifdef NX_TRANS_EXIT
if (OsVendorEndRedirectErrorFProc != NULL) {
OsVendorEndRedirectErrorFProc();
@@ -1946,11 +1825,11 @@ Fopen(char *file, char *type)
if ((*type != 'r' && *type != 'w') || type[1])
return NULL;
- if ((cur = (struct pid *)xalloc(sizeof(struct pid))) == NULL)
+ if ((cur = (struct pid *)malloc(sizeof(struct pid))) == NULL)
return NULL;
if (pipe(pdes) < 0) {
- xfree(cur);
+ free(cur);
return NULL;
}
@@ -1958,7 +1837,7 @@ Fopen(char *file, char *type)
case -1: /* error */
close(pdes[0]);
close(pdes[1]);
- xfree(cur);
+ free(cur);
return NULL;
case 0: /* child */
if (setgid(getgid()) == -1)
@@ -2052,7 +1931,7 @@ Pclose(void * iop)
pidlist = cur->next;
else
last->next = cur->next;
- xfree(cur);
+ free(cur);
/* allow EINTR again */
OsReleaseSignals ();
diff --git a/nx-X11/programs/Xserver/os/xalloc.c b/nx-X11/programs/Xserver/os/xalloc.c
deleted file mode 100644
index 4d2d3f1ee..000000000
--- a/nx-X11/programs/Xserver/os/xalloc.c
+++ /dev/null
@@ -1,817 +0,0 @@
-#define FATALERRORS 1
-/*
-Copyright (C) 1995 Pascal Haible. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-PASCAL HAIBLE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-Except as contained in this notice, the name of Pascal Haible shall
-not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from
-Pascal Haible.
-*/
-
-/* $XFree86: xc/programs/Xserver/os/xalloc.c,v 3.35tsi Exp $ */
-
-/* Only used if INTERNAL_MALLOC is defined
- * - otherwise xalloc() in utils.c is used
- */
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifdef INTERNAL_MALLOC
-
-#include <stdlib.h> /* for malloc() etc. */
-
-#include <nx-X11/Xos.h>
-#include "misc.h"
-#include <nx-X11/X.h>
-
-#ifdef XALLOC_LOG
-#include <stdio.h>
-#endif
-
-extern Bool Must_have_memory;
-
-/*
- ***** New malloc approach for the X server *****
- * Pascal Haible 1995
- *
- * Some statistics about memory allocation of the X server
- * The test session included several clients of different size, including
- * xv, emacs and xpaint with a new canvas of 3000x2000, zoom 5.
- * All clients were running together.
- * A protocolling version of Xalloc recorded 318917 allocating actions
- * (191573 Xalloc, 85942 XNFalloc, 41438 Xrealloc, 279727 Xfree).
- * Results grouped by size, excluding the next lower size
- * (i.e. size=32 means 16<size<=32):
- *
- * size nr of alloc max nr of blocks allocated together
- * 8 1114 287
- * 16 17341 4104
- * 32 147352 2068
- * 64 59053 2518
- * 128 46882 1230
- * 256 20544 1217
- * 512 6808 117
- * 1024 8254 171
- * 2048 4841 287
- * 4096 2429 84
- * 8192 3364 85
- * 16384 573 22
- * 32768 49 7
- * 65536 45 5
- * 131072 48 2
- * 262144 209 2
- * 524288 7 4
- * 1048576 2 1
- * 8388608 2 2
- *
- * The most used sizes:
- * count size
- * 24 136267
- * 40 37055
- * 72 17278
- * 56 13504
- * 80 9372
- * 16 8966
- * 32 8411
- * 136 8399
- * 104 7690
- * 12 7630
- * 120 5512
- * 88 4634
- * 152 3062
- * 52 2881
- * 48 2736
- * 156 1569
- * 168 1487
- * 160 1483
- * 28 1446
- * 1608 1379
- * 184 1305
- * 552 1270
- * 64 934
- * 320 891
- * 8 754
- *
- * Conclusions: more than the half of all allocations are <= 32 bytes.
- * But of these about 150,000 blocks, only a maximum of about 6,000 are
- * allocated together (including memory leaks..).
- * On the other side, only 935 of the 191573 or 0.5% were larger than 8kB
- * (362 or 0.2% larger than 16k).
- *
- * What makes the server really grow is the fragmentation of the heap,
- * and the fact that it can't shrink.
- * To cure this, we do the following:
- * - large blocks (>=11k) are mmapped on xalloc, and unmapped on xfree,
- * so we don't need any free lists etc.
- * As this needs 2 system calls, we only do this for the quite
- * infrequent large (>=11k) blocks.
- * - instead of reinventing the wheel, we use system malloc for medium
- * sized blocks (>256, <11k).
- * - for small blocks (<=256) we use an other approach:
- * As we need many small blocks, and most ones for a short time,
- * we don't go through the system malloc:
- * for each fixed sizes a seperate list of free blocks is kept.
- * to KISS (Keep it Small and Simple), we don't free them
- * (not freeing a block of 32 bytes won't be worse than having fragmented
- * a larger area on allocation).
- * This way, we (almost) allways have a fitting free block right at hand,
- * and don't have to walk any lists.
- */
-
-/*
- * structure layout of a allocated block
- * unsigned long size:
- * rounded up netto size for small and medium blocks
- * brutto size == mmap'ed area for large blocks
- * unsigned long DEBUG ? MAGIC : unused
- * .... data
- * ( unsigned long MAGIC2 ) only if SIZE_TAIL defined
- *
- */
-
-/* use otherwise unused long in the header to store a magic */
-/* shouldn't this be removed for production release ? */
-#define XALLOC_DEBUG
-
-#ifdef XALLOC_DEBUG
-/* Xfree fills the memory with a certain pattern (currently 0xF0) */
-/* this should really be removed for production release! */
-#define XFREE_ERASES
-#endif
-
-/* this must be a multiple of SIZE_STEPS below */
-#define MAX_SMALL 264 /* quite many blocks of 264 */
-
-#define MIN_LARGE (11*1024)
-/* worst case is 25% loss with a page size of 4k */
-
-/* SIZE_STEPS defines the granularity of size of small blocks -
- * this makes blocks align to that, too! */
-#define SIZE_STEPS (sizeof(double))
-#define SIZE_HEADER (2*sizeof(long)) /* = sizeof(double) for 32bit */
-#ifdef XALLOC_DEBUG
-#if defined(__sparc__)
-#define SIZE_TAIL (2*sizeof(long)) /* = sizeof(double) for 32bit */
-#else
-#define SIZE_TAIL (sizeof(long))
-#endif
-#endif
-
-#undef TAIL_SIZE
-#ifdef SIZE_TAIL
-#define TAIL_SIZE SIZE_TAIL
-#else
-#define TAIL_SIZE 0
-#endif
-
-#if defined (_LP64) || \
- defined(__alpha__) || defined(__alpha) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__sparc64__) || \
- defined(__s390x__) || \
- defined(__amd64__) || defined(amd64) || \
- defined(__powerpc64__) || \
- (defined(sgi) && _MIPS_SZLONG == 64))
-#define MAGIC 0x1404196414071968
-#define MAGIC_FREE 0x1506196615061966
-#define MAGIC2 0x2515207525182079
-#else
-#define MAGIC 0x14071968
-#define MAGIC_FREE 0x15061966
-#define MAGIC2 0x25182079
-#endif
-
-/* To get some statistics about memory allocation */
-
-#ifdef XALLOC_LOG
-#define XALLOC_LOG_FILE "/tmp/Xalloc.log" /* unsecure... */
-#define LOG_BODY(_body) \
- { FILE *f; \
- f = fopen(XALLOC_LOG_FILE, "a"); \
- if (NULL!=f) { \
- _body; \
- fclose(f); \
- } \
- }
-#if defined(linux) && defined(i386)
-#define LOG_ALLOC(_fun, _size, _ret) \
- { unsigned long *from; \
- __asm__("movl %%ebp,%0" : /*OUT*/ "=r" (from) : /*IN*/ ); \
- LOG_BODY(fprintf(f, "%s\t%i\t%p\t[%lu]\n", _fun, _size, _ret, *(from+1))) \
- }
-#else
-#define LOG_ALLOC(_fun, _size, _ret) \
- LOG_BODY(fprintf(f, "%s\t%i\t%p\n", _fun, _size, _ret))
-#endif
-#define LOG_REALLOC(_fun, _ptr, _size, _ret) \
- LOG_BODY(fprintf(f, "%s\t%p\t%i\t%p\n", _fun, _ptr, _size, _ret))
-#define LOG_FREE(_fun, _ptr) \
- LOG_BODY(fprintf(f, "%s\t%p\n", _fun, _ptr))
-#else
-#define LOG_ALLOC(_fun, _size, _ret)
-#define LOG_REALLOC(_fun, _ptr, _size, _ret)
-#define LOG_FREE(_fun, _ptr)
-#endif /* XALLOC_LOG */
-
-static unsigned long *free_lists[MAX_SMALL/SIZE_STEPS];
-
-/*
- * systems that support it should define HAS_MMAP_ANON or MMAP_DEV_ZERO
- * and include the appropriate header files for
- * mmap(), munmap(), PROT_READ, PROT_WRITE, MAP_PRIVATE,
- * PAGE_SIZE or _SC_PAGESIZE (and MAP_ANON for HAS_MMAP_ANON).
- *
- * systems that don't support MAP_ANON fall through to the 2 fold behaviour
- */
-
-#if defined(linux)
-#define HAS_MMAP_ANON
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <asm/page.h> /* PAGE_SIZE */
-#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
-#define HAS_GETPAGESIZE
-#endif /* linux */
-
-#if defined(__GNU__)
-#define HAS_MMAP_ANON
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <mach/vm_param.h> /* PAGE_SIZE */
-#define HAS_SC_PAGESIZE
-#define HAS_GETPAGESIZE
-#endif /* __GNU__ */
-
-#if defined(CSRG_BASED)
-#define HAS_MMAP_ANON
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* CSRG_BASED */
-
-#if defined(DGUX)
-#define HAS_GETPAGESIZE
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* DGUX */
-
-#if defined(SVR4) && !defined(DGUX)
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* SVR4 && !DGUX */
-
-#if defined(sun) && !defined(SVR4) /* SunOS */
-#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* sun && !SVR4 */
-
-#ifdef XNO_SYSCONF
-#undef _SC_PAGESIZE
-#endif
-
-#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO)
-static int pagesize;
-#endif
-
-#ifdef MMAP_DEV_ZERO
-static int devzerofd = -1;
-#include <errno.h>
-#endif
-
-/*
- * empty trap function for gdb. Breakpoint here
- * to find who tries to free a free area
- */
-void XfreeTrap(void)
-{
-}
-
-void *
-Xalloc (unsigned long amount)
-{
- register unsigned long *ptr;
- int indx;
-
- /* sanity checks */
-
- /* zero size requested */
- if (amount == 0) {
- LOG_ALLOC("Xalloc=0", amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: Xalloc(<0)\n");
-#else
- ErrorF("Xalloc warning: Xalloc(<0) ignored..\n");
-#endif
- LOG_ALLOC("Xalloc<0", amount, 0);
- return NULL;
- }
-
- /* alignment check */
-#if defined(__alpha__) || defined(__alpha) || \
- defined(__sparc__) || \
- defined(__mips__) || \
- defined(__powerpc__) || \
- defined(__arm32__) || \
- defined(__ia64__) || defined(ia64) || \
- defined(__s390x__) || defined(__s390__)
- amount = (amount + (sizeof(long)-1)) & ~(sizeof(long)-1);
-#endif
-
- if (amount <= MAX_SMALL) {
- /*
- * small block
- */
- /* pick a ready to use small chunk */
- indx = (amount-1) / SIZE_STEPS;
- ptr = free_lists[indx];
- if (NULL == ptr) {
- /* list empty - get 20 or 40 more */
- /* amount = size rounded up */
- amount = (indx+1) * SIZE_STEPS;
- ptr = (unsigned long *)calloc(1,(amount+SIZE_HEADER+TAIL_SIZE)
- * (amount<100 ? 40 : 20));
- if (NULL!=ptr) {
- int i;
- unsigned long *p1, *p2;
- p1 = 0;
- p2 = (unsigned long *)((char *)ptr + SIZE_HEADER);
- for (i=0; i<(amount<100 ? 40 : 20); i++) {
- p1 = p2;
- p1[-2] = amount;
-#ifdef XALLOC_DEBUG
- p1[-1] = MAGIC_FREE;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- *(unsigned long *)((unsigned char *)p1 + amount) = MAGIC2;
-#endif /* SIZE_TAIL */
- p2 = (unsigned long *)((char *)p1 + SIZE_HEADER + amount + TAIL_SIZE);
- *(unsigned long **)p1 = p2;
- }
- /* last one has no next one */
- *(unsigned long **)p1 = NULL;
- /* put the second in the list */
- free_lists[indx] = (unsigned long *)((char *)ptr + SIZE_HEADER + amount + TAIL_SIZE + SIZE_HEADER);
- /* take the fist one */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-S", amount, ptr);
- ptr[-1] = MAGIC;
- return (void *)ptr;
- } /* else fall through to 'Out of memory' */
- } else {
- /* take that piece of mem out of the list */
- free_lists[indx] = *((unsigned long **)ptr);
- /* already has size (and evtl. magic) filled in */
-#ifdef XALLOC_DEBUG
- ptr[-1] = MAGIC;
-#endif /* XALLOC_DEBUG */
- LOG_ALLOC("Xalloc-S", amount, ptr);
- return (void *)ptr;
- }
-
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- } else if (amount >= MIN_LARGE) {
- /*
- * large block
- */
- /* mmapped malloc */
- /* round up amount */
- amount += SIZE_HEADER + TAIL_SIZE;
- /* round up brutto amount to a multiple of the page size */
- amount = (amount + pagesize-1) & ~(pagesize-1);
-#ifdef MMAP_DEV_ZERO
- ptr = (unsigned long *)mmap((caddr_t)0,
- (size_t)amount,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE,
- devzerofd,
- (off_t)0);
-#else
- ptr = (unsigned long *)mmap((caddr_t)0,
- (size_t)amount,
- PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE,
- -1,
- (off_t)0);
-#endif
- if (-1!=(long)ptr) {
- ptr[0] = amount - SIZE_HEADER - TAIL_SIZE;
-#ifdef XALLOC_DEBUG
- ptr[1] = MAGIC;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- ((unsigned long *)((char *)ptr + amount - TAIL_SIZE))[0] = MAGIC2;
-#endif /* SIZE_TAIL */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-L", amount, ptr);
- return (void *)ptr;
- } /* else fall through to 'Out of memory' */
-#endif /* HAS_MMAP_ANON || MMAP_DEV_ZERO */
- } else {
- /*
- * medium sized block
- */
- /* 'normal' malloc() */
- ptr=(unsigned long *)calloc(1,amount+SIZE_HEADER+TAIL_SIZE);
- if (ptr != (unsigned long *)NULL) {
- ptr[0] = amount;
-#ifdef XALLOC_DEBUG
- ptr[1] = MAGIC;
-#endif /* XALLOC_DEBUG */
-#ifdef SIZE_TAIL
- *(unsigned long *)((char *)ptr + amount + SIZE_HEADER) = MAGIC2;
-#endif /* SIZE_TAIL */
- ptr = (unsigned long *)((char *)ptr + SIZE_HEADER);
- LOG_ALLOC("Xalloc-M", amount, ptr);
- return (void *)ptr;
- }
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- LOG_ALLOC("Xalloc-oom", amount, 0);
- return NULL;
-}
-
-/*****************
- * XNFalloc
- * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory
- *****************/
-
-void *
-XNFalloc (unsigned long amount)
-{
- register void * ptr;
-
- /* zero size requested */
- if (amount == 0) {
- LOG_ALLOC("XNFalloc=0", amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: XNFalloc(<0)\n");
-#else
- ErrorF("Xalloc warning: XNFalloc(<0) ignored..\n");
-#endif
- LOG_ALLOC("XNFalloc<0", amount, 0);
- return (unsigned long *)NULL;
- }
- ptr = Xalloc(amount);
- if (!ptr)
- {
- FatalError("Out of memory");
- }
- return ptr;
-}
-
-/*****************
- * Xcalloc
- *****************/
-
-void *
-Xcalloc (unsigned long amount)
-{
- void * ret;
-
- ret = Xalloc (amount);
- if (ret != 0
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */
-#endif
- )
- bzero ((char *) ret, (int) amount);
- return ret;
-}
-
-/*****************
- * XNFcalloc
- *****************/
-void *
-XNFcalloc (unsigned long amount)
-{
- void * ret;
-
- ret = XNFalloc (amount);
- if (ret != 0
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- && (amount < MIN_LARGE) /* mmaped anonymous mem is already cleared */
-#endif
- )
- bzero ((char *) ret, (int) amount);
- return ret;
-}
-
-/*****************
- * Xrealloc
- *****************/
-
-void *
-Xrealloc (void * ptr, unsigned long amount)
-{
- register unsigned long *new_ptr;
-
- /* zero size requested */
- if (amount == 0) {
- if (ptr)
- Xfree(ptr);
- LOG_REALLOC("Xrealloc=0", ptr, amount, 0);
- return NULL;
- }
- /* negative size (or size > 2GB) - what do we do? */
- if ((long)amount < 0) {
- /* Diagnostic */
-#ifdef FATALERRORS
- FatalError("Xalloc: Xrealloc(<0)\n");
-#else
- ErrorF("Xalloc warning: Xrealloc(<0) ignored..\n");
-#endif
- if (ptr)
- Xfree(ptr); /* ?? */
- LOG_REALLOC("Xrealloc<0", ptr, amount, 0);
- return NULL;
- }
-
- new_ptr = Xalloc(amount);
- if ( (new_ptr) && (ptr) ) {
- unsigned long old_size;
- old_size = ((unsigned long *)ptr)[-2];
-#ifdef XALLOC_DEBUG
- if (MAGIC != ((unsigned long *)ptr)[-1]) {
- if (MAGIC_FREE == ((unsigned long *)ptr)[-1]) {
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: range already freed in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n");
- sleep(5);
- XfreeTrap();
-#endif
- LOG_REALLOC("Xalloc error: ranged already freed in Xrealloc() :-(",
- ptr, amount, 0);
- return NULL;
- }
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: header corrupt in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: header corrupt in Xrealloc() :-(\n");
- XfreeTrap();
-#endif
- LOG_REALLOC("Xalloc error: header corrupt in Xrealloc() :-(",
- ptr, amount, 0);
- return NULL;
- }
-#endif /* XALLOC_DEBUG */
- /* copy min(old size, new size) */
- memcpy((char *)new_ptr, (char *)ptr, (amount < old_size ? amount : old_size));
- }
- if (ptr)
- Xfree(ptr);
- if (new_ptr) {
- LOG_REALLOC("Xrealloc", ptr, amount, new_ptr);
- return (void *)new_ptr;
- }
- if (Must_have_memory)
- FatalError("Out of memory");
- LOG_REALLOC("Xrealloc", ptr, amount, 0);
- return NULL;
-}
-
-/*****************
- * XNFrealloc
- * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory
- *****************/
-
-void *
-XNFrealloc (void * ptr, unsigned long amount)
-{
- if (( ptr = (void *)Xrealloc( ptr, amount ) ) == NULL)
- {
- FatalError( "Out of memory" );
- }
- return ptr;
-}
-
-/*****************
- * Xfree
- * calls free
- *****************/
-
-void
-Xfree(void * ptr)
-{
- unsigned long size;
- unsigned long *pheader;
-
- /* free(NULL) IS valid :-( - and widely used throughout the server.. */
- if (!ptr)
- return;
-
- pheader = (unsigned long *)((char *)ptr - SIZE_HEADER);
-#ifdef XALLOC_DEBUG
- if (MAGIC != pheader[1]) {
- /* Diagnostic */
- if (MAGIC_FREE == pheader[1]) {
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: range already freed in Xrealloc() :-(\n");
-#else
- ErrorF("Xalloc error: range already freed in Xrealloc() :-(\a\n");
- sleep(5);
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: ranged already freed in Xrealloc() :-(", ptr);
- return;
- }
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Header corrupt in Xfree() :-(\n");
-#else
- ErrorF("Xalloc error: Header corrupt in Xfree() :-(\n");
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Header corrupt in Xfree() :-(", ptr);
- return;
- }
-#endif /* XALLOC_DEBUG */
-
- size = pheader[0];
- if (size <= MAX_SMALL) {
- int indx;
- /*
- * small block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for small block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for small block", ptr);
- return;
- }
-#endif /* SIZE_TAIL */
-
-#ifdef XFREE_ERASES
- memset(ptr,0xF0,size);
-#endif /* XFREE_ERASES */
-#ifdef XALLOC_DEBUG
- pheader[1] = MAGIC_FREE;
-#endif
- /* put this small block at the head of the list */
- indx = (size-1) / SIZE_STEPS;
- *(unsigned long **)(ptr) = free_lists[indx];
- free_lists[indx] = (unsigned long *)ptr;
- LOG_FREE("Xfree", ptr);
- return;
-
-#if defined(HAS_MMAP_ANON) || defined(MMAP_DEV_ZERO)
- } else if (size >= MIN_LARGE) {
- /*
- * large block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != ((unsigned long *)((char *)ptr + size))[0]) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]);
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for big block (adr=0x%x, val=0x%x)\n",(char *)ptr+size,((unsigned long *)((char *)ptr + size))[0]);
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for big block", ptr);
- return;
- }
- size += SIZE_TAIL;
-#endif /* SIZE_TAIL */
-
- LOG_FREE("Xfree", ptr);
- size += SIZE_HEADER;
- munmap((caddr_t)pheader, (size_t)size);
- /* no need to clear - mem is inaccessible after munmap.. */
-#endif /* HAS_MMAP_ANON */
-
- } else {
- /*
- * medium sized block
- */
-#ifdef SIZE_TAIL
- if (MAGIC2 != *(unsigned long *)((char *)ptr + size)) {
- /* Diagnostic */
-#ifdef FATALERRORS
- XfreeTrap();
- FatalError("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
-#else
- ErrorF("Xalloc error: Tail corrupt in Xfree() for medium block (adr=0x%x, val=0x%x)\n",(char *)ptr + size,*(unsigned long *)((char *)ptr + size));
- XfreeTrap();
-#endif
- LOG_FREE("Xalloc error: Tail corrupt in Xfree() for medium block", ptr);
- return;
- }
-#endif /* SIZE_TAIL */
-
-#ifdef XFREE_ERASES
- memset(pheader,0xF0,size+SIZE_HEADER);
-#endif /* XFREE_ERASES */
-#ifdef XALLOC_DEBUG
- pheader[1] = MAGIC_FREE;
-#endif
-
- LOG_FREE("Xfree", ptr);
- free((char *)pheader);
- }
-}
-
-void
-OsInitAllocator (void)
-{
- static Bool beenhere = FALSE;
-
- if (beenhere)
- return;
- beenhere = TRUE;
-
-#if defined(HAS_MMAP_ANON) || defined (MMAP_DEV_ZERO)
- pagesize = -1;
-#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
- pagesize = sysconf(_SC_PAGESIZE);
-#endif
-#ifdef _SC_PAGE_SIZE
- if (pagesize == -1)
- pagesize = sysconf(_SC_PAGE_SIZE);
-#endif
-#ifdef HAS_GETPAGESIZE
- if (pagesize == -1)
- pagesize = getpagesize();
-#endif
-#ifdef PAGE_SIZE
- if (pagesize == -1)
- pagesize = PAGE_SIZE;
-#endif
- if (pagesize == -1)
- FatalError("OsInitAllocator: Cannot determine page size\n");
-#endif
-
- /* set up linked lists of free blocks */
- bzero ((char *) free_lists, MAX_SMALL/SIZE_STEPS*sizeof(unsigned long *));
-
-#ifdef MMAP_DEV_ZERO
- /* open /dev/zero on systems that have mmap, but not MAP_ANON */
- if (devzerofd < 0) {
- if ((devzerofd = open("/dev/zero", O_RDWR, 0)) < 0)
- FatalError("OsInitAllocator: Cannot open /dev/zero (errno=%d)\n",
- errno);
- }
-#endif
-
-#ifdef XALLOC_LOG
- /* reset the log file to zero length */
- {
- FILE *f;
- f = fopen(XALLOC_LOG_FILE, "w");
- if (NULL!=f)
- fclose(f);
- }
-#endif
-}
-
-#else /* !INTERNAL_MALLOC */
-/* This is to avoid an empty .o */
-static int no_internal_xalloc;
-#endif /* INTERNAL_MALLOC */
diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c
index 92fbde478..a89c5b0c0 100644
--- a/nx-X11/programs/Xserver/os/xdmauth.c
+++ b/nx-X11/programs/Xserver/os/xdmauth.c
@@ -240,7 +240,7 @@ XdmClientAuthTimeout (long now)
prev->next = next;
else
xdmClients = next;
- xfree (client);
+ free (client);
}
else
prev = client;
@@ -260,20 +260,20 @@ XdmAuthorizationValidate (unsigned char *plain, int length,
*reason = "Bad XDM authorization key length";
return NULL;
}
- client = (XdmClientAuthPtr) xalloc (sizeof (XdmClientAuthRec));
+ client = (XdmClientAuthPtr) malloc (sizeof (XdmClientAuthRec));
if (!client)
return NULL;
XdmClientAuthDecode (plain, client);
if (!XdmcpCompareKeys (&client->rho, rho))
{
- xfree (client);
+ free (client);
if (reason)
*reason = "Invalid XDM-AUTHORIZATION-1 key (failed key comparison)";
return NULL;
}
for (i = 18; i < 24; i++)
if (plain[i] != 0) {
- xfree (client);
+ free (client);
if (reason)
*reason = "Invalid XDM-AUTHORIZATION-1 key (failed NULL check)";
return NULL;
@@ -288,15 +288,15 @@ XdmAuthorizationValidate (unsigned char *plain, int length,
#if defined(TCPCONN) || defined(STREAMSCONN)
if (family == FamilyInternet &&
memcmp((char *)addr, client->client, 4) != 0) {
- xfree (client);
- xfree (addr);
+ free (client);
+ free (addr);
if (reason)
*reason = "Invalid XDM-AUTHORIZATION-1 key (failed address comparison)";
return NULL;
}
#endif
- xfree (addr);
+ free (addr);
}
}
now = time(0);
@@ -309,7 +309,7 @@ XdmAuthorizationValidate (unsigned char *plain, int length,
XdmClientAuthTimeout (now);
if (abs (client->time - now) > TwentyMinutes)
{
- xfree (client);
+ free (client);
if (reason)
*reason = "Excessive XDM-AUTHORIZATION-1 time offset";
return NULL;
@@ -318,7 +318,7 @@ XdmAuthorizationValidate (unsigned char *plain, int length,
{
if (XdmClientAuthCompare (existing, client))
{
- xfree (client);
+ free (client);
if (reason)
*reason = "XDM authorization key matches an existing client!";
return NULL;
@@ -364,7 +364,7 @@ XdmAddCookie (unsigned short data_length, char *data, XID id)
/* the first octet of the key must be zero */
if (key_bits[0] != '\0')
return 0;
- new = (XdmAuthorizationPtr) xalloc (sizeof (XdmAuthorizationRec));
+ new = (XdmAuthorizationPtr) malloc (sizeof (XdmAuthorizationRec));
if (!new)
return 0;
new->next = xdmAuth;
@@ -386,7 +386,7 @@ XdmCheckCookie (unsigned short cookie_length, char *cookie,
/* Auth packets must be a multiple of 8 bytes long */
if (cookie_length & 7)
return (XID) -1;
- plain = (unsigned char *) xalloc (cookie_length);
+ plain = (unsigned char *) malloc (cookie_length);
if (!plain)
return (XID) -1;
for (auth = xdmAuth; auth; auth=auth->next) {
@@ -395,11 +395,11 @@ XdmCheckCookie (unsigned short cookie_length, char *cookie,
{
client->next = xdmClients;
xdmClients = client;
- xfree (plain);
+ free (plain);
return auth->id;
}
}
- xfree (plain);
+ free (plain);
return (XID) -1;
}
@@ -412,13 +412,13 @@ XdmResetCookie (void)
for (auth = xdmAuth; auth; auth=next_auth)
{
next_auth = auth->next;
- xfree (auth);
+ free (auth);
}
xdmAuth = 0;
for (client = xdmClients; client; client=next_client)
{
next_client = client->next;
- xfree (client);
+ free (client);
}
xdmClients = (XdmClientAuthPtr) 0;
return 1;
@@ -431,19 +431,19 @@ XdmToID (unsigned short cookie_length, char *cookie)
XdmClientAuthPtr client;
unsigned char *plain;
- plain = (unsigned char *) xalloc (cookie_length);
+ plain = (unsigned char *) malloc (cookie_length);
if (!plain)
return (XID) -1;
for (auth = xdmAuth; auth; auth=auth->next) {
XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length);
if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, NULL, NULL)) != NULL)
{
- xfree (client);
- xfree (cookie);
+ free (client);
+ free (cookie);
return auth->id;
}
}
- xfree (cookie);
+ free (cookie);
return (XID) -1;
}
@@ -492,7 +492,7 @@ XdmRemoveCookie (unsigned short data_length, char *data)
prev->next = auth->next;
else
xdmAuth = auth->next;
- xfree (auth);
+ free (auth);
return 1;
}
}
diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c
index 4181e52ce..d48012759 100644
--- a/nx-X11/programs/Xserver/os/xdmcp.c
+++ b/nx-X11/programs/Xserver/os/xdmcp.c
@@ -407,7 +407,7 @@ XdmcpRegisterAuthentication (
AuthenticationNames.length + 1) &&
XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas,
AuthenticationDatas.length + 1) &&
- (newFuncs = (AuthenticationFuncsPtr) xalloc (
+ (newFuncs = (AuthenticationFuncsPtr) malloc (
(AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec)))))
{
XdmcpDisposeARRAY8 (&AuthenticationName);
@@ -419,7 +419,7 @@ XdmcpRegisterAuthentication (
newFuncs[AuthenticationNames.length-1].Validator = Validator;
newFuncs[AuthenticationNames.length-1].Generator = Generator;
newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth;
- xfree (AuthenticationFuncsList);
+ free (AuthenticationFuncsList);
AuthenticationFuncsList = newFuncs;
AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName;
AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData;
@@ -507,18 +507,18 @@ XdmcpRegisterConnection (
return;
}
}
- newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8));
+ newAddress = (CARD8 *) malloc (addrlen * sizeof (CARD8));
if (!newAddress)
return;
if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1))
{
- xfree (newAddress);
+ free (newAddress);
return;
}
if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses,
ConnectionAddresses.length + 1))
{
- xfree (newAddress);
+ free (newAddress);
return;
}
ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type;
@@ -548,12 +548,12 @@ XdmcpRegisterAuthorization (char *name, int namelen)
ARRAY8 authName;
int i;
- authName.data = (CARD8 *) xalloc (namelen * sizeof (CARD8));
+ authName.data = (CARD8 *) malloc (namelen * sizeof (CARD8));
if (!authName.data)
return;
if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1))
{
- xfree (authName.data);
+ free (authName.data);
return;
}
for (i = 0; i < namelen; i++)
diff --git a/nx-X11/programs/Xserver/os/xprintf.c b/nx-X11/programs/Xserver/os/xprintf.c
index 4423208ff..1bcb36d3c 100644
--- a/nx-X11/programs/Xserver/os/xprintf.c
+++ b/nx-X11/programs/Xserver/os/xprintf.c
@@ -1,5 +1,5 @@
/*
- * printf routines which xalloc their buffer
+ * printf routines which malloc their buffer
*/
/*
* Copyright (c) 2004 Alexander Gottwald
@@ -111,7 +111,7 @@ Xvprintf(const char *format, va_list va)
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
- ret = (char *)Xalloc(size + 1);
+ ret = (char *)malloc(size + 1);
if (ret == NULL)
return NULL;
diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c
index b78a947c8..8ff3f9c75 100644
--- a/nx-X11/programs/Xserver/randr/randr.c
+++ b/nx-X11/programs/Xserver/randr/randr.c
@@ -131,9 +131,9 @@ RRCloseScreen(
RRMonitorClose(pScreen);
- xfree(pScrPriv->crtcs);
- xfree(pScrPriv->outputs);
- xfree(pScrPriv);
+ free(pScrPriv->crtcs);
+ free(pScrPriv->outputs);
+ free(pScrPriv);
RRNScreens -= 1; /* ok, one fewer screen with RandR running */
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -321,7 +321,7 @@ RRScreenInit(ScreenPtr pScreen)
if (!RRInit())
return FALSE;
- pScrPriv = (rrScrPrivPtr) xcalloc(1, sizeof(rrScrPrivRec));
+ pScrPriv = (rrScrPrivPtr) calloc(1, sizeof(rrScrPrivRec));
if (!pScrPriv)
return FALSE;
@@ -405,7 +405,7 @@ RRFreeClient(void *data, XID id)
*pHead = pRREvent->next;
}
}
- xfree((void *) pRREvent);
+ free((void *) pRREvent);
return 1;
}
@@ -418,9 +418,9 @@ RRFreeEvents(void *data, XID id)
for (pCur = *pHead; pCur; pCur = pNext) {
pNext = pCur->next;
FreeResource(pCur->clientResource, RRClientType);
- xfree((void *) pCur);
+ free((void *) pCur);
}
- xfree((void *) pHead);
+ free((void *) pHead);
return 1;
}
diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c
index d69b5ec08..4c9b805c2 100644
--- a/nx-X11/programs/Xserver/randr/rrcrtc.c
+++ b/nx-X11/programs/Xserver/randr/rrcrtc.c
@@ -86,16 +86,16 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
crtcs = reallocarray(pScrPriv->crtcs,
pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
#else /* !defined(NXAGENT_SERVER) */
- crtcs = xrealloc(pScrPriv->crtcs,
+ crtcs = realloc(pScrPriv->crtcs,
(pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- crtcs = xalloc(sizeof(RRCrtcPtr));
+ crtcs = malloc(sizeof(RRCrtcPtr));
if (!crtcs)
return FALSE;
pScrPriv->crtcs = crtcs;
- crtc = xcalloc(1, sizeof(RRCrtcRec));
+ crtc = calloc(1, sizeof(RRCrtcRec));
if (!crtc)
return NULL;
crtc->id = FakeClientID(0);
@@ -202,20 +202,20 @@ RRCrtcNotify(RRCrtcPtr crtc,
newoutputs = reallocarray(crtc->outputs,
numOutputs, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
- newoutputs = xrealloc(crtc->outputs,
+ newoutputs = realloc(crtc->outputs,
numOutputs * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
#ifndef NXAGENT_SERVER
newoutputs = xallocarray(numOutputs, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
- newoutputs = xalloc(numOutputs * sizeof(RROutputPtr));
+ newoutputs = malloc(numOutputs * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!newoutputs)
return FALSE;
}
else {
- xfree(crtc->outputs);
+ free(crtc->outputs);
newoutputs = NULL;
}
crtc->outputs = newoutputs;
@@ -370,7 +370,7 @@ RRComputeContiguity(ScreenPtr pScreen)
Bool discontiguous = TRUE;
int i, n = pScrPriv->numCrtcs;
- int *reachable = xcalloc(n, sizeof(int));
+ int *reachable = calloc(n, sizeof(int));
if (!reachable)
goto out;
@@ -391,7 +391,7 @@ RRComputeContiguity(ScreenPtr pScreen)
discontiguous = FALSE;
out:
- xfree(reachable);
+ free(reachable);
pScrPriv->discontiguous = discontiguous;
}
@@ -778,10 +778,10 @@ RRCrtcDestroyResource(void *value, XID pid)
if (crtc->scanout_pixmap)
RRCrtcDetachScanoutPixmap(crtc);
- xfree(crtc->gammaRed);
+ free(crtc->gammaRed);
if (crtc->mode)
RRModeDestroy(crtc->mode);
- xfree(crtc);
+ free(crtc);
return 1;
}
@@ -892,14 +892,14 @@ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size)
#ifndef NXAGENT_SERVER
gamma = xallocarray(size, 3 * sizeof(CARD16));
#else /* !defined(NXAGENT_SERVER) */
- gamma = xalloc(size * 3 * sizeof(CARD16));
+ gamma = malloc(size * 3 * sizeof(CARD16));
#endif /* !defined(NXAGENT_SERVER) */
if (!gamma)
return FALSE;
}
else
gamma = NULL;
- xfree(crtc->gammaRed);
+ free(crtc->gammaRed);
crtc->gammaRed = gamma;
crtc->gammaGreen = gamma + size;
crtc->gammaBlue = gamma + size * 2;
@@ -1047,7 +1047,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
}
@@ -1089,7 +1089,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep);
if (extraLen) {
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
@@ -1136,7 +1136,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
#ifndef NXAGENT_SERVER
outputs = xallocarray(numOutputs, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
- outputs = xalloc(numOutputs * sizeof(RROutputPtr));
+ outputs = malloc(numOutputs * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!outputs)
return BadAlloc;
@@ -1151,7 +1151,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
RROutputType, client, DixSetAttrAccess);
if (ret != Success) {
- xfree(outputs);
+ free(outputs);
return ret;
}
#else /* !defined(NXAGENT_SERVER) */
@@ -1159,7 +1159,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
if (!outputs[i]) {
client->errorValue = outputIds[i];
if (outputs)
- xfree(outputs);
+ free(outputs);
return RRErrorBase + BadRROutput;
}
#endif /* !defined(NXAGENT_SERVER) */
@@ -1168,7 +1168,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
if (outputs[i]->crtcs[j] == crtc)
break;
if (j == outputs[i]->numCrtcs) {
- xfree(outputs);
+ free(outputs);
return BadMatch;
}
/* validate mode for this output */
@@ -1180,7 +1180,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
break;
}
if (j == outputs[i]->numModes + outputs[i]->numUserModes) {
- xfree(outputs);
+ free(outputs);
return BadMatch;
}
}
@@ -1196,7 +1196,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
break;
}
if (k == outputs[i]->numClones) {
- xfree(outputs);
+ free(outputs);
return BadMatch;
}
}
@@ -1230,7 +1230,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
* Invalid rotation
*/
client->errorValue = stuff->rotation;
- xfree(outputs);
+ free(outputs);
return BadValue;
}
@@ -1240,7 +1240,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
* requested rotation or reflection not supported by screen
*/
client->errorValue = stuff->rotation;
- xfree(outputs);
+ free(outputs);
return BadMatch;
}
@@ -1282,13 +1282,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
&source_height);
if (stuff->x + source_width > width) {
client->errorValue = stuff->x;
- xfree(outputs);
+ free(outputs);
return BadValue;
}
if (stuff->y + source_height > height) {
client->errorValue = stuff->y;
- xfree(outputs);
+ free(outputs);
return BadValue;
}
}
@@ -1304,7 +1304,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
pScrPriv->lastSetTime = time;
sendReply:
- xfree(outputs);
+ free(outputs);
rep = (xRRSetCrtcConfigReply) {
.type = X_Reply,
@@ -1514,7 +1514,7 @@ ProcRRGetCrtcGamma(ClientPtr client)
len = crtc->gammaSize * 3 * 2;
if (crtc->gammaSize) {
- extra = xalloc(len);
+ extra = malloc(len);
if (!extra)
return BadAlloc;
}
@@ -1535,7 +1535,7 @@ ProcRRGetCrtcGamma(ClientPtr client)
memcpy(extra, crtc->gammaRed, len);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
WriteSwappedDataToClient(client, len, extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -1673,7 +1673,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
nextra = (transform_filter_length(pending) +
transform_filter_length(current));
- reply = xcalloc(1, sizeof(xRRGetCrtcTransformReply) + nextra);
+ reply = calloc(1, sizeof(xRRGetCrtcTransformReply) + nextra);
if (!reply)
return BadAlloc;
@@ -1700,7 +1700,7 @@ ProcRRGetCrtcTransform(ClientPtr client)
}
WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra,
(char *) reply);
- xfree(reply);
+ free(reply);
return Success;
}
@@ -1825,7 +1825,7 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable)
PixmapPtr *saved_scanout_pixmap;
int i;
- saved_scanout_pixmap = xalloc(sizeof(PixmapPtr) * pScrPriv->numCrtcs);
+ saved_scanout_pixmap = malloc(sizeof(PixmapPtr) * pScrPriv->numCrtcs);
if (saved_scanout_pixmap == NULL)
return FALSE;
@@ -1894,7 +1894,7 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable)
else
crtc->scanout_pixmap = saved_scanout_pixmap[i];
}
- xfree(saved_scanout_pixmap);
+ free(saved_scanout_pixmap);
return ret;
}
diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c
index b15d1ad20..50f2011c6 100644
--- a/nx-X11/programs/Xserver/randr/rrdispatch.c
+++ b/nx-X11/programs/Xserver/randr/rrdispatch.c
@@ -125,7 +125,7 @@ ProcRRSelectInput(ClientPtr client)
if (!pRREvent) {
/* build the entry */
- pRREvent = (RREventPtr) xalloc(sizeof(RREventRec));
+ pRREvent = (RREventPtr) malloc(sizeof(RREventRec));
if (!pRREvent)
return BadAlloc;
pRREvent->next = 0;
@@ -147,7 +147,7 @@ ProcRRSelectInput(ClientPtr client)
* done through the resource database.
*/
if (!pHead) {
- pHead = (RREventPtr *) xalloc(sizeof(RREventPtr));
+ pHead = (RREventPtr *) malloc(sizeof(RREventPtr));
if (!pHead ||
!AddResource(pWin->drawable.id, RREventType,
(void *) pHead)) {
@@ -212,7 +212,7 @@ ProcRRSelectInput(ClientPtr client)
pNewRREvent->next = pRREvent->next;
else
*pHead = pRREvent->next;
- xfree(pRREvent);
+ free(pRREvent);
}
}
}
diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c
index df9b79986..bea921436 100644
--- a/nx-X11/programs/Xserver/randr/rrinfo.c
+++ b/nx-X11/programs/Xserver/randr/rrinfo.c
@@ -59,11 +59,11 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh)
modes = reallocarray(output->modes,
output->numModes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
- modes = xrealloc(output->modes,
+ modes = realloc(output->modes,
(output->numModes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- modes = xalloc(sizeof(RRModePtr));
+ modes = malloc(sizeof(RRModePtr));
if (!modes) {
RRModeDestroy(mode);
FreeResource(mode->mode.id, 0);
@@ -132,7 +132,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
newMode = mode;
}
}
- xfree(size->pRates);
+ free(size->pRates);
}
else {
mode = RROldModeAdd(output, size, 0);
@@ -141,7 +141,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
}
}
if (pScrPriv->nSizes)
- xfree(pScrPriv->pSizes);
+ free(pScrPriv->pSizes);
pScrPriv->pSizes = NULL;
pScrPriv->nSizes = 0;
@@ -275,7 +275,7 @@ RRRegisterSize(ScreenPtr pScreen,
pNew = reallocarray(pScrPriv->pSizes,
pScrPriv->nSizes + 1, sizeof(RRScreenSize));
#else /* !defined(NXAGENT_SERVER) */
- pNew = xrealloc(pScrPriv->pSizes,
+ pNew = realloc(pScrPriv->pSizes,
(pScrPriv->nSizes + 1) * sizeof(RRScreenSize));
#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
@@ -302,7 +302,7 @@ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate)
#ifndef NXAGENT_SERVER
pNew = reallocarray(pSize->pRates, pSize->nRates + 1, sizeof(RRScreenRate));
#else /* !defined(NXAGENT_SERVER) */
- pNew = xrealloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
+ pNew = realloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
return FALSE;
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c
index 918e0f221..c4718c1b4 100644
--- a/nx-X11/programs/Xserver/randr/rrmode.c
+++ b/nx-X11/programs/Xserver/randr/rrmode.c
@@ -85,7 +85,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
if (!RRInit())
return NULL;
- mode = xalloc(sizeof(RRModeRec) + modeInfo->nameLength + 1);
+ mode = malloc(sizeof(RRModeRec) + modeInfo->nameLength + 1);
if (!mode)
return NULL;
mode->refcnt = 1;
@@ -99,20 +99,20 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
#ifndef NXAGENT_SERVER
newModes = reallocarray(modes, num_modes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
- newModes = xrealloc(modes, (num_modes + 1) * sizeof(RRModePtr));
+ newModes = realloc(modes, (num_modes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- newModes = xalloc(sizeof(RRModePtr));
+ newModes = malloc(sizeof(RRModePtr));
if (!newModes) {
- xfree(mode);
+ free(mode);
return NULL;
}
mode->mode.id = FakeClientID(0);
if (!AddResource(mode->mode.id, RRModeType, (void *) mode)) {
- xfree(newModes);
+ free(newModes);
return NULL;
}
modes = newModes;
@@ -211,7 +211,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret)
#ifndef NXAGENT_SERVER
screen_modes = xallocarray((num_modes ? num_modes : 1), sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
- screen_modes = xalloc((num_modes ? num_modes : 1) * sizeof(RRModePtr));
+ screen_modes = malloc((num_modes ? num_modes : 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!screen_modes)
return NULL;
@@ -285,14 +285,14 @@ RRModeDestroy(RRModePtr mode)
(num_modes - m - 1) * sizeof(RRModePtr));
num_modes--;
if (!num_modes) {
- xfree(modes);
+ free(modes);
modes = NULL;
}
break;
}
}
- xfree(mode);
+ free(mode);
}
static int
diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c
index fc9b9295b..42e0de64a 100644
--- a/nx-X11/programs/Xserver/randr/rrmonitor.c
+++ b/nx-X11/programs/Xserver/randr/rrmonitor.c
@@ -95,7 +95,7 @@ RRMonitorSetFromServer(RRCrtcPtr crtc, RRMonitorPtr monitor)
monitor->name = RRMonitorCrtcName(crtc);
monitor->pScreen = crtc->pScreen;
monitor->numOutputs = crtc->numOutputs;
- monitor->outputs = xcalloc(crtc->numOutputs, sizeof(RRCrtc));
+ monitor->outputs = calloc(crtc->numOutputs, sizeof(RRCrtc));
if (!monitor->outputs)
return FALSE;
for (o = 0; o < crtc->numOutputs; o++)
@@ -173,7 +173,7 @@ RRMonitorSetFromClient(RRMonitorPtr client_monitor, RRMonitorPtr monitor)
monitor->name = client_monitor->name;
monitor->pScreen = client_monitor->pScreen;
monitor->numOutputs = client_monitor->numOutputs;
- monitor->outputs = xcalloc(client_monitor->numOutputs, sizeof(RROutput));
+ monitor->outputs = calloc(client_monitor->numOutputs, sizeof(RROutput));
if (!monitor->outputs && client_monitor->numOutputs)
return FALSE;
memcpy(monitor->outputs, client_monitor->outputs, client_monitor->numOutputs * sizeof(RROutput));
@@ -216,7 +216,7 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
#endif
mon_list->num_crtcs = numCrtcs;
- mon_list->server_crtc = xcalloc(numCrtcs * 2, sizeof(RRCrtcPtr));
+ mon_list->server_crtc = calloc(numCrtcs * 2, sizeof(RRCrtcPtr));
if (!mon_list->server_crtc)
return FALSE;
@@ -298,7 +298,7 @@ RRMonitorInitList(ScreenPtr screen, RRMonitorListPtr mon_list, Bool get_active)
static void
RRMonitorFiniList(RRMonitorListPtr list)
{
- xfree(list->server_crtc);
+ free(list->server_crtc);
}
/* Construct a complete list of protocol-visible monitors, including
@@ -321,7 +321,7 @@ RRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr * monitors_ret
if (!RRMonitorInitList(screen, &list, get_active))
return FALSE;
- monitors = xcalloc(list.num_client + list.num_server, sizeof(RRMonitorRec));
+ monitors = calloc(list.num_client + list.num_server, sizeof(RRMonitorRec));
if (!monitors) {
RRMonitorFiniList(&list);
return FALSE;
@@ -401,7 +401,7 @@ RRMonitorCountList(ScreenPtr screen)
void
RRMonitorFree(RRMonitorPtr monitor)
{
- xfree(monitor);
+ free(monitor);
}
RRMonitorPtr
@@ -409,7 +409,7 @@ RRMonitorAlloc(int noutput)
{
RRMonitorPtr monitor;
- monitor = xcalloc(1, sizeof(RRMonitorRec) + noutput * sizeof(RROutput));
+ monitor = calloc(1, sizeof(RRMonitorRec) + noutput * sizeof(RROutput));
if (!monitor)
return NULL;
monitor->numOutputs = noutput;
@@ -512,11 +512,11 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
pScrPriv->numMonitors + 1,
sizeof(RRMonitorPtr));
#else /* !defined(NXAGENT_SERVER) */
- monitors = xrealloc(pScrPriv->monitors,
+ monitors = realloc(pScrPriv->monitors,
(pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- monitors = xalloc(sizeof(RRMonitorPtr));
+ monitors = malloc(sizeof(RRMonitorPtr));
if (!monitors)
return BadAlloc;
@@ -573,8 +573,8 @@ RRMonitorFreeList(RRMonitorPtr monitors, int nmon)
int m;
for (m = 0; m < nmon; m++)
- xfree(monitors[m].outputs);
- xfree(monitors);
+ free(monitors[m].outputs);
+ free(monitors);
}
void
@@ -600,7 +600,7 @@ RRMonitorClose(ScreenPtr screen)
for (m = 0; m < pScrPriv->numMonitors; m++)
RRMonitorFree(pScrPriv->monitors[m]);
- xfree(pScrPriv->monitors);
+ free(pScrPriv->monitors);
pScrPriv->monitors = NULL;
pScrPriv->numMonitors = 0;
}
diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c
index 2628fabb0..4a3d32a12 100644
--- a/nx-X11/programs/Xserver/randr/rroutput.c
+++ b/nx-X11/programs/Xserver/randr/rroutput.c
@@ -79,17 +79,17 @@ RROutputCreate(ScreenPtr pScreen,
outputs = reallocarray(pScrPriv->outputs,
pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
- outputs = xrealloc(pScrPriv->outputs,
+ outputs = realloc(pScrPriv->outputs,
(pScrPriv->numOutputs + 1) * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- outputs = xalloc(sizeof(RROutputPtr));
+ outputs = malloc(sizeof(RROutputPtr));
if (!outputs)
return FALSE;
pScrPriv->outputs = outputs;
- output = xalloc(sizeof(RROutputRec) + nameLength + 1);
+ output = malloc(sizeof(RROutputRec) + nameLength + 1);
if (!output)
return NULL;
output->id = FakeClientID(0);
@@ -147,14 +147,14 @@ RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones)
#ifndef NXAGENT_SERVER
newClones = xallocarray(numClones, sizeof(RROutputPtr));
#else /* !defined(NXAGENT_SERVER) */
- newClones = xalloc(numClones * sizeof(RROutputPtr));
+ newClones = malloc(numClones * sizeof(RROutputPtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!newClones)
return FALSE;
}
else
newClones = NULL;
- xfree(output->clones);
+ free(output->clones);
memcpy(newClones, clones, numClones * sizeof(RROutputPtr));
output->clones = newClones;
output->numClones = numClones;
@@ -184,7 +184,7 @@ RROutputSetModes(RROutputPtr output,
#ifndef NXAGENT_SERVER
newModes = xallocarray(numModes, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
- newModes = xalloc(numModes * sizeof(RRModePtr));
+ newModes = malloc(numModes * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!newModes)
return FALSE;
@@ -194,7 +194,7 @@ RROutputSetModes(RROutputPtr output,
if (output->modes) {
for (i = 0; i < output->numModes; i++)
RRModeDestroy(output->modes[i]);
- xfree(output->modes);
+ free(output->modes);
}
memcpy(newModes, modes, numModes * sizeof(RRModePtr));
output->modes = newModes;
@@ -232,11 +232,11 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode)
newModes = reallocarray(output->userModes,
output->numUserModes + 1, sizeof(RRModePtr));
#else /* !defined(NXAGENT_SERVER) */
- newModes = xrealloc(output->userModes,
+ newModes = realloc(output->userModes,
(output->numUserModes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- newModes = xalloc(sizeof(RRModePtr));
+ newModes = malloc(sizeof(RRModePtr));
if (!newModes)
return BadAlloc;
@@ -292,14 +292,14 @@ RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs)
#ifndef NXAGENT_SERVER
newCrtcs = xallocarray(numCrtcs, sizeof(RRCrtcPtr));
#else /* !defined(NXAGENT_SERVER) */
- newCrtcs = xalloc(numCrtcs * sizeof(RRCrtcPtr));
+ newCrtcs = malloc(numCrtcs * sizeof(RRCrtcPtr));
#endif /* !defined(NXAGENT_SERVER) */
if (!newCrtcs)
return FALSE;
}
else
newCrtcs = NULL;
- xfree(output->crtcs);
+ free(output->crtcs);
memcpy(newCrtcs, crtcs, numCrtcs * sizeof(RRCrtcPtr));
output->crtcs = newCrtcs;
output->numCrtcs = numCrtcs;
@@ -404,17 +404,17 @@ RROutputDestroyResource(void *value, XID pid)
if (output->modes) {
for (m = 0; m < output->numModes; m++)
RRModeDestroy(output->modes[m]);
- xfree(output->modes);
+ free(output->modes);
}
for (m = 0; m < output->numUserModes; m++)
RRModeDestroy(output->userModes[m]);
- xfree(output->userModes);
+ free(output->userModes);
- xfree(output->crtcs);
- xfree(output->clones);
+ free(output->crtcs);
+ free(output->clones);
RRDeleteAllOutputProperties(output);
- xfree(output);
+ free(output);
return 1;
}
@@ -494,7 +494,7 @@ ProcRRGetOutputInfo(ClientPtr client)
if (extraLen) {
rep.length += bytes_to_int32(extraLen);
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
}
@@ -541,7 +541,7 @@ ProcRRGetOutputInfo(ClientPtr client)
WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep);
if (extraLen) {
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c
index 741d0310e..cf13ca23e 100644
--- a/nx-X11/programs/Xserver/randr/rrproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproperty.c
@@ -63,10 +63,10 @@ RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
static void
RRDestroyOutputProperty(RRPropertyPtr prop)
{
- xfree(prop->valid_values);
- xfree(prop->current.data);
- xfree(prop->pending.data);
- xfree(prop);
+ free(prop->valid_values);
+ free(prop->current.data);
+ free(prop->pending.data);
+ free(prop);
}
static void
@@ -111,7 +111,7 @@ RRCreateOutputProperty(Atom property)
{
RRPropertyPtr prop;
- prop = (RRPropertyPtr) xalloc(sizeof(RRPropertyRec));
+ prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec));
if (!prop)
return NULL;
prop->next = NULL;
@@ -189,7 +189,7 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
#ifndef NXAGENT_SERVER
new_value.data = xallocarray(total_len, size_in_bytes);
#else /* !defined(NXAGENT_SERVER) */
- new_value.data = xalloc(total_len * size_in_bytes);
+ new_value.data = malloc(total_len * size_in_bytes);
#endif /* !defined(NXAGENT_SERVER) */
if (!new_value.data && total_len && size_in_bytes) {
if (add)
@@ -225,12 +225,12 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
if (pending && pScrPriv->rrOutputSetProperty &&
!pScrPriv->rrOutputSetProperty(output->pScreen, output,
prop->propertyName, &new_value)) {
- xfree(new_value.data);
+ free(new_value.data);
if (add)
RRDestroyOutputProperty(prop);
return BadValue;
}
- xfree(prop_value->data);
+ free(prop_value->data);
*prop_value = new_value;
}
@@ -362,7 +362,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property,
#ifndef NXAGENT_SERVER
new_values = xallocarray(num_values, sizeof(INT32));
#else /* !defined(NXAGENT_SERVER) */
- new_values = xalloc(num_values * sizeof(INT32));
+ new_values = malloc(num_values * sizeof(INT32));
#endif /* !defined(NXAGENT_SERVER) */
if (!new_values && num_values) {
if (add)
@@ -377,7 +377,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property,
* loses any pending values
*/
if (prop->is_pending && !pending) {
- xfree(prop->pending.data);
+ free(prop->pending.data);
RRInitOutputPropertyValue(&prop->pending);
}
@@ -385,7 +385,7 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property,
prop->range = range;
prop->immutable = immutable;
prop->num_valid = num_values;
- xfree(prop->valid_values);
+ free(prop->valid_values);
prop->valid_values = new_values;
if (add) {
@@ -417,7 +417,7 @@ ProcRRListOutputProperties(ClientPtr client)
#ifndef NXAGENT_SERVER
if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
#else /* !defined(NXAGENT_SERVER) */
- if (!(pAtoms = xalloc(numProps * sizeof(Atom))))
+ if (!(pAtoms = malloc(numProps * sizeof(Atom))))
#endif /* !defined(NXAGENT_SERVER) */
return BadAlloc;
@@ -442,7 +442,7 @@ ProcRRListOutputProperties(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- xfree(pAtoms);
+ free(pAtoms);
}
return Success;
}
@@ -469,7 +469,7 @@ ProcRRQueryOutputProperty(ClientPtr client)
#ifndef NXAGENT_SERVER
extra = xallocarray(prop->num_valid, sizeof(INT32));
#else /* !defined(NXAGENT_SERVER) */
- extra = xalloc(prop->num_valid * sizeof(INT32));
+ extra = malloc(prop->num_valid * sizeof(INT32));
#endif /* !defined(NXAGENT_SERVER) */
if (!extra)
return BadAlloc;
@@ -493,7 +493,7 @@ ProcRRQueryOutputProperty(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -702,7 +702,7 @@ ProcRRGetOutputProperty(ClientPtr client)
len = min(n - ind, 4 * stuff->longLength);
if (len) {
- extra = xalloc(len);
+ extra = malloc(len);
if (!extra)
return BadAlloc;
}
@@ -749,7 +749,7 @@ ProcRRGetOutputProperty(ClientPtr client)
break;
}
WriteSwappedDataToClient(client, len, extra);
- xfree(extra);
+ free(extra);
}
if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */
diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c
index b2251b682..7d3096482 100644
--- a/nx-X11/programs/Xserver/randr/rrprovider.c
+++ b/nx-X11/programs/Xserver/randr/rrprovider.c
@@ -121,7 +121,7 @@ ProcRRGetProviders(ClientPtr client)
};
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
} else
@@ -152,7 +152,7 @@ ProcRRGetProviders(ClientPtr client)
if (extraLen)
{
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -217,7 +217,7 @@ ProcRRGetProviderInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
}
@@ -295,7 +295,7 @@ ProcRRGetProviderInfo(ClientPtr client)
if (extraLen)
{
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -380,7 +380,7 @@ RRProviderCreate(ScreenPtr pScreen, const char *name,
pScrPriv = rrGetScrPriv(pScreen);
- provider = xcalloc(1, sizeof(RRProviderRec) + nameLength + 1);
+ provider = calloc(1, sizeof(RRProviderRec) + nameLength + 1);
if (!provider)
return NULL;
@@ -427,7 +427,7 @@ RRProviderDestroyResource(void *value, XID pid)
(*pScrPriv->rrProviderDestroy) (pScreen, provider);
pScrPriv->provider = NULL;
}
- xfree(provider);
+ free(provider);
return 1;
}
diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
index a68a94ff2..b7ba8ab53 100644
--- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
@@ -60,10 +60,10 @@ RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
static void
RRDestroyProviderProperty(RRPropertyPtr prop)
{
- xfree(prop->valid_values);
- xfree(prop->current.data);
- xfree(prop->pending.data);
- xfree(prop);
+ free(prop->valid_values);
+ free(prop->current.data);
+ free(prop->pending.data);
+ free(prop);
}
static void
@@ -108,7 +108,7 @@ RRCreateProviderProperty(Atom property)
{
RRPropertyPtr prop;
- prop = (RRPropertyPtr) xalloc(sizeof(RRPropertyRec));
+ prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec));
if (!prop)
return NULL;
prop->next = NULL;
@@ -185,7 +185,7 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
void *new_data = NULL, *old_data = NULL;
total_size = total_len * size_in_bytes;
- new_value.data = (void *) xalloc(total_size);
+ new_value.data = (void *) malloc(total_size);
if (!new_value.data && total_size) {
if (add)
RRDestroyProviderProperty(prop);
@@ -222,10 +222,10 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
prop->propertyName, &new_value)) {
if (add)
RRDestroyProviderProperty(prop);
- xfree(new_value.data);
+ free(new_value.data);
return BadValue;
}
- xfree(prop_value->data);
+ free(prop_value->data);
*prop_value = new_value;
}
@@ -357,7 +357,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
#ifndef NXAGENT_SERVER
new_values = xallocarray(num_values, sizeof(INT32));
#else /* !defined(NXAGENT_SERVER) */
- new_values = xalloc(num_values * sizeof(INT32));
+ new_values = malloc(num_values * sizeof(INT32));
#endif /* !defined(NXAGENT_SERVER) */
if (!new_values && num_values) {
@@ -373,7 +373,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
* loses any pending values
*/
if (prop->is_pending && !pending) {
- xfree(prop->pending.data);
+ free(prop->pending.data);
RRInitProviderPropertyValue(&prop->pending);
}
@@ -381,7 +381,7 @@ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
prop->range = range;
prop->immutable = immutable;
prop->num_valid = num_values;
- xfree(prop->valid_values);
+ free(prop->valid_values);
prop->valid_values = new_values;
if (add) {
@@ -413,7 +413,7 @@ ProcRRListProviderProperties(ClientPtr client)
#ifndef NXAGENT_SERVER
if (!(pAtoms = xallocarray(numProps, sizeof(Atom))))
#else /* !defined(NXAGENT_SERVER) */
- if (!(pAtoms = xalloc(numProps * sizeof(Atom))))
+ if (!(pAtoms = malloc(numProps * sizeof(Atom))))
#endif /* !defined(NXAGENT_SERVER) */
return BadAlloc;
@@ -437,7 +437,7 @@ ProcRRListProviderProperties(ClientPtr client)
if (numProps) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
- xfree(pAtoms);
+ free(pAtoms);
}
return Success;
}
@@ -464,7 +464,7 @@ ProcRRQueryProviderProperty(ClientPtr client)
#ifndef NXAGENT_SERVER
extra = xallocarray(prop->num_valid, sizeof(INT32));
#else /* !defined(NXAGENT_SERVER) */
- extra = xalloc(prop->num_valid * sizeof(INT32));
+ extra = malloc(prop->num_valid * sizeof(INT32));
#endif /* !defined(NXAGENT_SERVER) */
if (!extra)
return BadAlloc;
@@ -487,7 +487,7 @@ ProcRRQueryProviderProperty(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32),
extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -694,7 +694,7 @@ ProcRRGetProviderProperty(ClientPtr client)
len = min(n - ind, 4 * stuff->longLength);
if (len) {
- extra = xalloc(len);
+ extra = malloc(len);
if (!extra)
return BadAlloc;
}
@@ -741,7 +741,7 @@ ProcRRGetProviderProperty(ClientPtr client)
break;
}
WriteSwappedDataToClient(client, len, extra);
- xfree(extra);
+ free(extra);
}
if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */
diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c
index af54d66f5..017ff0143 100644
--- a/nx-X11/programs/Xserver/randr/rrscreen.c
+++ b/nx-X11/programs/Xserver/randr/rrscreen.c
@@ -334,7 +334,7 @@ ProcRRSetScreenSize(ClientPtr client)
for (j = 0; j < num_modes; j++) \
total_name_len += modes[j]->mode.nameLength; \
total_modes += num_modes; \
- xfree(modes); \
+ free(modes); \
} while(0)
static inline void
@@ -388,7 +388,7 @@ swap_modeinfos(xRRModeInfo * modeinfos, int i)
names += mode->mode.nameLength; \
mode_count++; \
} \
- xfree(modes); \
+ free(modes); \
} \
} while (0)
@@ -456,7 +456,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra) {
return BadAlloc;
}
@@ -504,7 +504,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen)
WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *) &rep);
if (extraLen) {
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -595,9 +595,9 @@ rrGetScreenResources(ClientPtr client, Bool query)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra) {
- xfree(modes);
+ free(modes);
return BadAlloc;
}
}
@@ -655,7 +655,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
memcpy(names, mode->name, mode->mode.nameLength);
names += mode->mode.nameLength;
}
- xfree(modes);
+ free(modes);
assert(bytes_to_int32((char *) names - (char *) extra) == rep.length);
}
@@ -673,7 +673,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
(char *) (char *) &rep);
if (extraLen) {
WriteToClient(client, extraLen, (char *) (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -714,7 +714,7 @@ RR10GetData(ScreenPtr pScreen, RROutputPtr output)
Bool *used;
/* Make sure there is plenty of space for any combination */
- data = xalloc(sizeof(RR10DataRec) +
+ data = malloc(sizeof(RR10DataRec) +
sizeof(RRScreenSize) * nmode +
sizeof(RRScreenRate) * nmode + sizeof(Bool) * nmode);
if (!data)
@@ -874,9 +874,9 @@ ProcRRGetScreenInfo(ClientPtr client)
extraLen += rep.nrateEnts * sizeof(CARD16);
if (extraLen) {
- extra = (CARD8 *) xalloc(extraLen);
+ extra = (CARD8 *) malloc(extraLen);
if (!extra) {
- xfree(pData);
+ free(pData);
return BadAlloc;
}
}
@@ -916,7 +916,7 @@ ProcRRGetScreenInfo(ClientPtr client)
}
}
}
- xfree(pData);
+ free(pData);
data8 = (CARD8 *) rates;
@@ -939,7 +939,7 @@ ProcRRGetScreenInfo(ClientPtr client)
WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep);
if (extraLen) {
WriteToClient(client, extraLen, (char *) extra);
- xfree(extra);
+ free(extra);
}
return Success;
}
@@ -1035,7 +1035,7 @@ ProcRRSetScreenConfig(ClientPtr client)
* Invalid size ID
*/
client->errorValue = stuff->sizeID;
- xfree(pData);
+ free(pData);
return BadValue;
}
pSize = &pData->sizes[stuff->sizeID];
@@ -1057,7 +1057,7 @@ ProcRRSetScreenConfig(ClientPtr client)
* Invalid rotation
*/
client->errorValue = stuff->rotation;
- xfree(pData);
+ free(pData);
return BadValue;
}
@@ -1066,7 +1066,7 @@ ProcRRSetScreenConfig(ClientPtr client)
* requested rotation or reflection not supported by screen
*/
client->errorValue = stuff->rotation;
- xfree(pData);
+ free(pData);
return BadMatch;
}
@@ -1088,7 +1088,7 @@ ProcRRSetScreenConfig(ClientPtr client)
* Invalid rate
*/
client->errorValue = rate;
- xfree(pData);
+ free(pData);
return BadValue;
}
mode = pSize->pRates[i].mode;
@@ -1113,12 +1113,12 @@ ProcRRSetScreenConfig(ClientPtr client)
height = mode->mode.height;
if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
client->errorValue = width;
- xfree(pData);
+ free(pData);
return BadValue;
}
if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) {
client->errorValue = height;
- xfree(pData);
+ free(pData);
return BadValue;
}
@@ -1159,7 +1159,7 @@ ProcRRSetScreenConfig(ClientPtr client)
sendReply:
- xfree(pData);
+ free(pData);
rep = (xRRSetScreenConfigReply) {
.type = X_Reply,
@@ -1202,7 +1202,7 @@ RR10CurrentSizeID(ScreenPtr pScreen)
sizeID = (CARD16) i;
break;
}
- xfree(data);
+ free(data);
}
}
return sizeID;
diff --git a/nx-X11/programs/Xserver/randr/rrtransform.c b/nx-X11/programs/Xserver/randr/rrtransform.c
index 4377d09aa..f0c5dd8c7 100644
--- a/nx-X11/programs/Xserver/randr/rrtransform.c
+++ b/nx-X11/programs/Xserver/randr/rrtransform.c
@@ -37,7 +37,7 @@ RRTransformInit(RRTransformPtr transform)
void
RRTransformFini(RRTransformPtr transform)
{
- xfree(transform->params);
+ free(transform->params);
}
Bool
@@ -73,7 +73,7 @@ RRTransformSetFilter(RRTransformPtr dst,
#ifndef NXAGENT_SERVER
new_params = xallocarray(nparams, sizeof(xFixed));
#else /* !defined(NXAGENT_SERVER) */
- new_params = xalloc(nparams * sizeof(xFixed));
+ new_params = malloc(nparams * sizeof(xFixed));
#endif /* !defined(NXAGENT_SERVER) */
if (!new_params)
return FALSE;
@@ -81,7 +81,7 @@ RRTransformSetFilter(RRTransformPtr dst,
}
else
new_params = NULL;
- xfree(dst->params);
+ free(dst->params);
dst->filter = filter;
dst->params = new_params;
dst->nparams = nparams;
diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c
index 590a343a0..410920d02 100644
--- a/nx-X11/programs/Xserver/record/record.c
+++ b/nx-X11/programs/Xserver/record/record.c
@@ -1002,7 +1002,7 @@ RecordInstallHooks(pRCAP, oneclient)
RecordClientPrivatePtr pClientPriv;
/* no Record proc vector; allocate one */
pClientPriv = (RecordClientPrivatePtr)
- xalloc(sizeof(RecordClientPrivateRec));
+ malloc(sizeof(RecordClientPrivateRec));
if (!pClientPriv)
return BadAlloc;
/* copy old proc vector to new */
@@ -1126,7 +1126,7 @@ RecordUninstallHooks(pRCAP, oneclient)
{ /* nobody needs it, so free it */
pClient->requestVector = pClientPriv->originalVector;
pClient->devPrivates[RecordClientPrivateIndex].ptr = NULL;
- xfree(pClientPriv);
+ free(pClientPriv);
}
} /* end if this RCAP specifies any requests */
} /* end if not future clients */
@@ -1197,8 +1197,8 @@ RecordDeleteClientFromRCAP(pRCAP, position)
}
/* free the RCAP */
if (pRCAP->clientIDsSeparatelyAllocated)
- xfree(pRCAP->pClientIDs);
- xfree(pRCAP);
+ free(pRCAP->pClientIDs);
+ free(pRCAP);
}
} /* RecordDeleteClientFromRCAP */
@@ -1228,7 +1228,7 @@ RecordAddClientToRCAP(pRCAP, clientspec)
{
if (pRCAP->clientIDsSeparatelyAllocated)
{
- XID *pNewIDs = (XID *)xrealloc(pRCAP->pClientIDs,
+ XID *pNewIDs = (XID *)realloc(pRCAP->pClientIDs,
(pRCAP->sizeClients + CLIENT_ARRAY_GROWTH_INCREMENT) *
sizeof(XID));
if (!pNewIDs)
@@ -1238,7 +1238,7 @@ RecordAddClientToRCAP(pRCAP, clientspec)
}
else
{
- XID *pNewIDs = (XID *)xalloc((pRCAP->sizeClients +
+ XID *pNewIDs = (XID *)malloc((pRCAP->sizeClients +
CLIENT_ARRAY_GROWTH_INCREMENT) * sizeof(XID));
if (!pNewIDs)
return;
@@ -1345,7 +1345,7 @@ RecordSanityCheckClientSpecifiers(clientspecs, nspecs, errorspec)
* - XRecordCurrentClients expanded to a list of all currently
* connected clients - excludespec (if non-zero)
* The returned array may be the passed array modified in place, or
- * it may be an Xalloc'ed array. The caller should keep a pointer to the
+ * it may be an malloc'ed array. The caller should keep a pointer to the
* original array and free the returned array if it is different.
*
* *pNumClientspecs is set to the number of elements in the returned
@@ -1380,7 +1380,7 @@ RecordCanonicalizeClientSpecifiers(pClientspecs, pNumClientspecs, excludespec)
pClientspecs[i] == XRecordCurrentClients)
{ /* expand All/Current */
int j, nc;
- XID *pCanon = (XID *)xalloc(sizeof(XID) * (currentMaxClients + 1));
+ XID *pCanon = (XID *)malloc(sizeof(XID) * (currentMaxClients + 1));
if (!pCanon) return NULL;
for (nc = 0, j = 1; j < currentMaxClients; j++)
{
@@ -1599,7 +1599,7 @@ RecordAllocIntervals(psi, nIntervals)
{
assert(!psi->intervals);
psi->intervals = (RecordSetInterval *)
- xalloc(nIntervals * sizeof(RecordSetInterval));
+ malloc(nIntervals * sizeof(RecordSetInterval));
if (!psi->intervals)
return BadAlloc;
bzero(psi->intervals, nIntervals * sizeof(RecordSetInterval));
@@ -1865,7 +1865,7 @@ RecordRegisterClients(pContext, client, stuff)
/* allocate memory for the whole RCAP */
- pRCAP = (RecordClientsAndProtocolPtr)xalloc(totRCAPsize);
+ pRCAP = (RecordClientsAndProtocolPtr)malloc(totRCAPsize);
if (!pRCAP)
{
err = BadAlloc;
@@ -1979,11 +1979,11 @@ bailout:
{
for (i = 0; i < maxSets; i++)
if (si[i].intervals)
- xfree(si[i].intervals);
+ free(si[i].intervals);
DEALLOCATE_LOCAL(si);
}
if (pCanonClients && pCanonClients != (XID *)&stuff[1])
- xfree(pCanonClients);
+ free(pCanonClients);
return err;
} /* RecordRegisterClients */
@@ -2030,14 +2030,14 @@ ProcRecordCreateContext(client)
REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
LEGAL_NEW_RESOURCE(stuff->context, client);
- pContext = (RecordContextPtr)xalloc(sizeof(RecordContextRec));
+ pContext = (RecordContextPtr)malloc(sizeof(RecordContextRec));
if (!pContext)
goto bailout;
/* make sure there is room in ppAllContexts to store the new context */
ppNewAllContexts = (RecordContextPtr *)
- xrealloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
+ realloc(ppAllContexts, sizeof(RecordContextPtr) * (numContexts + 1));
if (!ppNewAllContexts)
goto bailout;
ppAllContexts = ppNewAllContexts;
@@ -2068,7 +2068,7 @@ ProcRecordCreateContext(client)
}
bailout:
if (pContext)
- xfree(pContext);
+ free(pContext);
return err;
} /* ProcRecordCreateContext */
@@ -2119,7 +2119,7 @@ ProcRecordUnregisterClients(client)
RecordDeleteClientFromContext(pContext, pCanonClients[i]);
}
if (pCanonClients != (XID *)&stuff[1])
- xfree(pCanonClients);
+ free(pCanonClients);
return Success;
} /* ProcRecordUnregisterClients */
@@ -2162,7 +2162,7 @@ RecordAllocRanges(pri, nRanges)
#define SZINCR 8
newsize = max(pri->size + SZINCR, nRanges);
- pNewRange = (xRecordRange *)xrealloc(pri->pRanges,
+ pNewRange = (xRecordRange *)realloc(pri->pRanges,
newsize * sizeof(xRecordRange));
if (!pNewRange)
return BadAlloc;
@@ -2471,7 +2471,7 @@ ProcRecordGetContext(client)
bailout:
for (i = 0; i < nRCAPs; i++)
{
- if (pRangeInfo[i].pRanges) xfree(pRangeInfo[i].pRanges);
+ if (pRangeInfo[i].pRanges) free(pRangeInfo[i].pRanges);
}
DEALLOCATE_LOCAL(pRangeInfo);
return err;
@@ -2646,7 +2646,7 @@ RecordDeleteContext(value, id)
}
}
- xfree(pContext);
+ free(pContext);
/* remove context from AllContexts list */
@@ -2655,7 +2655,7 @@ RecordDeleteContext(value, id)
ppAllContexts[i] = ppAllContexts[numContexts - 1];
if (--numContexts == 0)
{
- xfree(ppAllContexts);
+ free(ppAllContexts);
ppAllContexts = NULL;
}
}
diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c
index 83fb0e7d7..b7360a565 100644
--- a/nx-X11/programs/Xserver/record/set.c
+++ b/nx-X11/programs/Xserver/record/set.c
@@ -72,19 +72,9 @@ typedef int Bool;
typedef unsigned short CARD16;
-#define xalloc malloc
-#define xfree free
#define ALLOCATE_LOCAL malloc
#define DEALLOCATE_LOCAL free
-void *Xcalloc(size)
- int size;
-{
- void *p = malloc(size);
- if (p) memset(p, 0, size);
- return p;
-}
-
#ifndef max
#define max(_a, _b) ( ((_a) > (_b)) ? (_a) : (_b) )
#endif
@@ -135,7 +125,7 @@ static void
BitVectorDestroySet(pSet)
RecordSetPtr pSet;
{
- xfree(pSet);
+ free(pSet);
}
static unsigned long
@@ -260,7 +250,7 @@ BitVectorCreateSet(pIntervals, nIntervals, pMem, memsize)
}
else
{
- pbvs = (BitVectorSetPtr)Xcalloc(memsize);
+ pbvs = (BitVectorSetPtr)calloc(1, memsize);
if (!pbvs) return NULL;
pbvs->baseSet.ops = &BitVectorSetOperations;
}
@@ -295,7 +285,7 @@ static void
IntervalListDestroySet(pSet)
RecordSetPtr pSet;
{
- xfree(pSet);
+ free(pSet);
}
static unsigned long
@@ -425,7 +415,7 @@ IntervalListCreateSet(pIntervals, nIntervals, pMem, memsize)
else
{
prls = (IntervalListSetPtr)
- xalloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval));
+ malloc(sizeof(IntervalListSet) + nIntervals * sizeof(RecordSetInterval));
if (!prls) goto bailout;
prls->baseSet.ops = &IntervalListSetOperations;
}
@@ -612,7 +602,7 @@ int main(argc, argv)
_RecordForceSetImplementation(IntervalListImplementation);
rsize = RecordSetMemoryRequirements(intervals, nIntervals, &ralign);
pad = (ralign - (bsize & (ralign - 1))) & (ralign - 1);
- bs = (RecordSetPtr)xalloc(bsize + pad + rsize );
+ bs = (RecordSetPtr)malloc(bsize + pad + rsize );
if (!bs)
{
fprintf(stderr, "%d: failed to alloc memory for sets\n",
@@ -702,7 +692,7 @@ int main(argc, argv)
if (testcount & 1)
{
- xfree(bs);
+ free(bs);
}
}
}
diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c
index 27e5ab949..c5535050e 100644
--- a/nx-X11/programs/Xserver/render/animcur.c
+++ b/nx-X11/programs/Xserver/render/animcur.c
@@ -128,7 +128,7 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen)
Unwrap(as, pScreen, RecolorCursor);
SetAnimCurScreen(pScreen,0);
ret = (*pScreen->CloseScreen) (index, pScreen);
- xfree (as);
+ free (as);
if (index == 0)
AnimCurScreenPrivateIndex = -1;
return ret;
@@ -334,7 +334,7 @@ AnimCurInit (ScreenPtr pScreen)
animCurState.elt = 0;
animCurState.time = 0;
}
- as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec));
+ as = (AnimCurScreenPtr) malloc (sizeof (AnimCurScreenRec));
if (!as)
return FALSE;
Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen);
@@ -366,7 +366,7 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp
if (IsAnimCur (cursors[i]))
return BadMatch;
- pCursor = (CursorPtr) xalloc (sizeof (CursorRec) +
+ pCursor = (CursorPtr) malloc (sizeof (CursorRec) +
sizeof (AnimCurRec) +
ncursor * sizeof (AnimCurElt));
if (!pCursor)
diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c
index 57a21a8c0..10e732997 100644
--- a/nx-X11/programs/Xserver/render/filter.c
+++ b/nx-X11/programs/Xserver/render/filter.c
@@ -62,18 +62,18 @@ PictureGetFilterId (char *filter, int len, Bool makeit)
return i;
if (!makeit)
return -1;
- name = xalloc (len + 1);
+ name = malloc (len + 1);
if (!name)
return -1;
memcpy (name, filter, len);
name[len] = '\0';
if (filterNames)
- names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
+ names = realloc (filterNames, (nfilterNames + 1) * sizeof (char *));
else
- names = xalloc (sizeof (char *));
+ names = malloc (sizeof (char *));
if (!names)
{
- xfree (name);
+ free (name);
return -1;
}
filterNames = names;
@@ -119,8 +119,8 @@ PictureFreeFilterIds (void)
int i;
for (i = 0; i < nfilterNames; i++)
- xfree (filterNames[i]);
- xfree (filterNames);
+ free (filterNames[i]);
+ free (filterNames);
nfilterNames = 0;
filterNames = 0;
}
@@ -144,9 +144,9 @@ PictureAddFilter (ScreenPtr pScreen,
if (ps->filters[i].id == id)
return -1;
if (ps->filters)
- filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
+ filters = realloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
else
- filters = xalloc (sizeof (PictFilterRec));
+ filters = malloc (sizeof (PictFilterRec));
if (!filters)
return -1;
ps->filters = filters;
@@ -175,11 +175,11 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
PictFilterAliasPtr aliases;
if (ps->filterAliases)
- aliases = xrealloc (ps->filterAliases,
+ aliases = realloc (ps->filterAliases,
(ps->nfilterAliases + 1) *
sizeof (PictFilterAliasRec));
else
- aliases = xalloc (sizeof (PictFilterAliasRec));
+ aliases = malloc (sizeof (PictFilterAliasRec));
if (!aliases)
return FALSE;
ps->filterAliases = aliases;
@@ -272,8 +272,8 @@ PictureResetFilters (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen(pScreen);
- xfree (ps->filters);
- xfree (ps->filterAliases);
+ free (ps->filters);
+ free (ps->filterAliases);
PictureFreeFilterIds ();
}
@@ -336,11 +336,11 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
}
if (nparams != pPicture->filter_nparams) {
- xFixed *new_params = xalloc (nparams * sizeof (xFixed));
+ xFixed *new_params = malloc (nparams * sizeof (xFixed));
if (!new_params && nparams)
return BadAlloc;
- xfree (pPicture->filter_params);
+ free (pPicture->filter_params);
pPicture->filter_params = new_params;
pPicture->filter_nparams = nparams;
}
diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c
index 854a9069d..2ef1087e7 100644
--- a/nx-X11/programs/Xserver/render/glyph.c
+++ b/nx-X11/programs/Xserver/render/glyph.c
@@ -117,12 +117,12 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr)
if (n > glyphSet->maxPrivate) {
if (glyphSet->devPrivates &&
glyphSet->devPrivates != (void *)(&glyphSet[1])) {
- new = (void **) xrealloc (glyphSet->devPrivates,
+ new = (void **) realloc (glyphSet->devPrivates,
(n + 1) * sizeof (void *));
if (!new)
return FALSE;
} else {
- new = (void **) xalloc ((n + 1) * sizeof (void *));
+ new = (void **) malloc ((n + 1) * sizeof (void *));
if (!new)
return FALSE;
if (glyphSet->devPrivates)
@@ -264,7 +264,7 @@ FreeGlyph (GlyphPtr glyph, int format)
gr->signature = 0;
globalGlyphs[format].tableEntries--;
}
- xfree (glyph);
+ free (glyph);
}
}
@@ -281,7 +281,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph);
if (gr->glyph && gr->glyph != DeletedGlyph)
{
- xfree (glyph);
+ free (glyph);
glyph = gr->glyph;
}
else
@@ -346,7 +346,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height)
return 0;
size = gi->height * padded_width;
- glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec));
+ glyph = (GlyphPtr) malloc (size + sizeof (GlyphRec));
if (!glyph)
return 0;
glyph->refcnt = 0;
@@ -358,7 +358,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
Bool
AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet)
{
- hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec));
+ hash->table = (GlyphRefPtr) malloc (hashSet->size * sizeof (GlyphRefRec));
if (!hash->table)
return FALSE;
memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec));
@@ -404,7 +404,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
++newHash.tableEntries;
}
}
- xfree (hash->table);
+ free (hash->table);
}
*hash = newHash;
if (global)
@@ -434,7 +434,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format)
size = (sizeof (GlyphSetRec) +
(sizeof (void *) * _GlyphSetPrivateAllocateIndex));
- glyphSet = xalloc (size);
+ glyphSet = malloc (size);
if (!glyphSet)
return FALSE;
bzero((char *)glyphSet, size);
@@ -444,7 +444,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format)
if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0]))
{
- xfree (glyphSet);
+ free (glyphSet);
return FALSE;
}
glyphSet->refcnt = 1;
@@ -473,19 +473,19 @@ FreeGlyphSet (void *value,
}
if (!globalGlyphs[glyphSet->fdepth].tableEntries)
{
- xfree (globalGlyphs[glyphSet->fdepth].table);
+ free (globalGlyphs[glyphSet->fdepth].table);
globalGlyphs[glyphSet->fdepth].table = 0;
globalGlyphs[glyphSet->fdepth].hashSet = 0;
}
else
ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
- xfree (table);
+ free (table);
if (glyphSet->devPrivates &&
glyphSet->devPrivates != (void *)(&glyphSet[1]))
- xfree(glyphSet->devPrivates);
+ free(glyphSet->devPrivates);
- xfree (glyphSet);
+ free (glyphSet);
}
return Success;
}
diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c
index 03e2857a2..ce31c00fb 100644
--- a/nx-X11/programs/Xserver/render/miindex.c
+++ b/nx-X11/programs/Xserver/render/miindex.c
@@ -259,15 +259,15 @@ miInitIndexed (ScreenPtr pScreen,
pixels[p] = p;
}
- pIndexed = xalloc (sizeof (miIndexedRec));
+ pIndexed = malloc (sizeof (miIndexedRec));
if (!pIndexed)
return FALSE;
pFormat->index.nvalues = num;
- pFormat->index.pValues = xalloc (num * sizeof (xIndexValue));
+ pFormat->index.pValues = malloc (num * sizeof (xIndexValue));
if (!pFormat->index.pValues)
{
- xfree (pIndexed);
+ free (pIndexed);
return FALSE;
}
@@ -323,12 +323,12 @@ miCloseIndexed (ScreenPtr pScreen,
{
if (pFormat->index.devPrivate)
{
- xfree (pFormat->index.devPrivate);
+ free (pFormat->index.devPrivate);
pFormat->index.devPrivate = 0;
}
if (pFormat->index.pValues)
{
- xfree (pFormat->index.pValues);
+ free (pFormat->index.pValues);
pFormat->index.pValues = 0;
}
}
diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c
index ae7cf5a6d..5bd449d44 100644
--- a/nx-X11/programs/Xserver/render/mipict.c
+++ b/nx-X11/programs/Xserver/render/mipict.c
@@ -107,7 +107,7 @@ miChangePictureClip (PicturePtr pPicture,
if (!clientClip)
return BadAlloc;
clientClipType = CT_REGION;
- xfree(value);
+ free(value);
break;
}
(*ps->DestroyPictureClip) (pPicture);
diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c
index a29a9568c..4a1cd98f5 100644
--- a/nx-X11/programs/Xserver/render/picture.c
+++ b/nx-X11/programs/Xserver/render/picture.c
@@ -82,7 +82,7 @@ AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount)
{
unsigned int *nsizes;
- nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes,
+ nsizes = (unsigned int *)realloc(ps->PicturePrivateSizes,
(index2 + 1) * sizeof(unsigned int));
if (!nsizes)
return FALSE;
@@ -141,9 +141,9 @@ PictureCloseScreen (int index, ScreenPtr pScreen)
(*ps->CloseIndexed) (pScreen, &ps->formats[n]);
SetPictureScreen(pScreen, 0);
if (ps->PicturePrivateSizes)
- xfree (ps->PicturePrivateSizes);
- xfree (ps->formats);
- xfree (ps);
+ free (ps->PicturePrivateSizes);
+ free (ps->formats);
+ free (ps);
return ret;
}
@@ -365,7 +365,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
}
- pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec));
+ pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec));
if (!pFormats)
return 0;
memset (pFormats, '\0', nformats * sizeof (PictFormatRec));
@@ -660,7 +660,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n)))
{
- xfree (formats);
+ free (formats);
return FALSE;
}
if (formats[n].type == PictTypeIndexed)
@@ -689,18 +689,18 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
}
formats[n].format = PICT_FORMAT(0,type,a,r,g,b);
}
- ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec));
+ ps = (PictureScreenPtr) malloc (sizeof (PictureScreenRec));
if (!ps)
{
- xfree (formats);
+ free (formats);
return FALSE;
}
SetPictureScreen(pScreen, ps);
if (!GlyphInit (pScreen))
{
SetPictureScreen(pScreen, 0);
- xfree (formats);
- xfree (ps);
+ free (formats);
+ free (ps);
return FALSE;
}
@@ -730,8 +730,8 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
PictureResetFilters (pScreen);
SetPictureScreen(pScreen, 0);
- xfree (formats);
- xfree (ps);
+ free (formats);
+ free (ps);
return FALSE;
}
@@ -784,7 +784,7 @@ AllocatePicture (ScreenPtr pScreen)
unsigned int size;
int i;
- pPicture = (PicturePtr) xalloc (ps->totalPictureSize);
+ pPicture = (PicturePtr) malloc (ps->totalPictureSize);
if (!pPicture)
return 0;
ppriv = (DevUnion *)(pPicture + 1);
@@ -961,7 +961,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
dpos = stopPoints[i];
}
- pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop));
+ pGradient->linear.stops = malloc(stopCount*sizeof(PictGradientStop));
if (!pGradient->linear.stops) {
*error = BadAlloc;
return;
@@ -980,7 +980,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
{
PicturePtr pPicture;
- pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
+ pPicture = (PicturePtr) malloc(sizeof(PictureRec));
pPicture->pDrawable = 0;
pPicture->pFormat = 0;
pPicture->pNext = 0;
@@ -1000,10 +1000,10 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
@@ -1034,10 +1034,10 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
@@ -1047,7 +1047,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -1083,10 +1083,10 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
radial = &pPicture->pSourcePict->radial;
@@ -1110,7 +1110,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -1134,10 +1134,10 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
}
pPicture->id = pid;
- pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient));
+ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
- xfree(pPicture);
+ free(pPicture);
return 0;
}
@@ -1147,7 +1147,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle,
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
- xfree(pPicture);
+ free(pPicture);
return 0;
}
return pPicture;
@@ -1477,7 +1477,7 @@ SetPictureTransform (PicturePtr pPicture,
{
if (!pPicture->transform)
{
- pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform));
+ pPicture->transform = (PictTransform *) malloc (sizeof (PictTransform));
if (!pPicture->transform)
return BadAlloc;
}
@@ -1487,7 +1487,7 @@ SetPictureTransform (PicturePtr pPicture,
{
if (pPicture->transform)
{
- xfree (pPicture->transform);
+ free (pPicture->transform);
pPicture->transform = 0;
}
}
@@ -1611,12 +1611,12 @@ FreePicture (void * value,
if (--pPicture->refcnt == 0)
{
if (pPicture->transform)
- xfree (pPicture->transform);
+ free (pPicture->transform);
if (!pPicture->pDrawable) {
if (pPicture->pSourcePict) {
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
- xfree(pPicture->pSourcePict->linear.stops);
- xfree(pPicture->pSourcePict);
+ free(pPicture->pSourcePict->linear.stops);
+ free(pPicture->pSourcePict);
}
} else {
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
@@ -1647,7 +1647,7 @@ FreePicture (void * value,
(*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
}
}
- xfree (pPicture);
+ free (pPicture);
}
return Success;
}
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c
index 5a4114adc..c6cb7bce7 100644
--- a/nx-X11/programs/Xserver/render/render.c
+++ b/nx-X11/programs/Xserver/render/render.c
@@ -413,7 +413,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
ndepth * sizeof (xPictDepth) +
nvisual * sizeof (xPictVisual) +
numSubpixel * sizeof (CARD32));
- reply = (xRenderQueryPictFormatsReply *) xalloc (rlength);
+ reply = (xRenderQueryPictFormatsReply *) malloc (rlength);
if (!reply)
return BadAlloc;
memset(reply, 0, rlength);
@@ -552,7 +552,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
swapl (&reply->numSubpixel, n);
}
WriteToClient(client, rlength, (char *) reply);
- xfree (reply);
+ free (reply);
return client->noClientException;
}
#endif /* NXAGENT_SERVER */
@@ -588,7 +588,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
num = pFormat->index.nvalues;
rlength = (sizeof (xRenderQueryPictIndexValuesReply) +
num * sizeof(xIndexValue));
- reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength);
+ reply = (xRenderQueryPictIndexValuesReply *) malloc (rlength);
if (!reply)
return BadAlloc;
@@ -617,7 +617,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
}
WriteToClient(client, rlength, (char *) reply);
- xfree(reply);
+ free(reply);
return (client->noClientException);
}
@@ -1139,7 +1139,7 @@ ProcRenderAddGlyphs (ClientPtr client)
glyphsBase = glyphsLocal;
else
{
- glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec));
+ glyphsBase = (GlyphNewPtr) malloc (nglyphs * sizeof (GlyphNewRec));
if (!glyphsBase)
return BadAlloc;
}
@@ -1196,16 +1196,16 @@ ProcRenderAddGlyphs (ClientPtr client)
}
if (glyphsBase != glyphsLocal)
- Xfree (glyphsBase);
+ free (glyphsBase);
return client->noClientException;
bail:
while (glyphs != glyphsBase)
{
--glyphs;
- xfree (glyphs->glyph);
+ free (glyphs->glyph);
}
if (glyphsBase != glyphsLocal)
- Xfree (glyphsBase);
+ free (glyphsBase);
return err;
}
@@ -1533,23 +1533,23 @@ ProcRenderCreateCursor (ClientPtr client)
if ( stuff->x > width
|| stuff->y > height )
return (BadMatch);
- argbbits = xalloc (width * height * sizeof (CARD32));
+ argbbits = malloc (width * height * sizeof (CARD32));
if (!argbbits)
return (BadAlloc);
stride = BitmapBytePad(width);
nbytes_mono = stride*height;
- srcbits = (unsigned char *)xalloc(nbytes_mono);
+ srcbits = (unsigned char *)malloc(nbytes_mono);
if (!srcbits)
{
- xfree (argbbits);
+ free (argbbits);
return (BadAlloc);
}
- mskbits = (unsigned char *)xalloc(nbytes_mono);
+ mskbits = (unsigned char *)malloc(nbytes_mono);
if (!mskbits)
{
- xfree(argbbits);
- xfree(srcbits);
+ free(argbbits);
+ free(srcbits);
return (BadAlloc);
}
bzero ((char *) mskbits, nbytes_mono);
@@ -1571,26 +1571,26 @@ ProcRenderCreateCursor (ClientPtr client)
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return (BadImplementation);
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
if (!pPixmap)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return (BadAlloc);
}
pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
client, &error);
if (!pPicture)
{
- xfree (argbbits);
- xfree (srcbits);
- xfree (mskbits);
+ free (argbbits);
+ free (srcbits);
+ free (mskbits);
return error;
}
(*pScreen->DestroyPixmap) (pPixmap);
@@ -1674,7 +1674,7 @@ ProcRenderCreateCursor (ClientPtr client)
}
else
{
- xfree (argbbits);
+ free (argbbits);
argbbits = 0;
}
@@ -1748,7 +1748,7 @@ ProcRenderQueryFilters (ClientPtr client)
}
len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2);
total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
- reply = (xRenderQueryFiltersReply *) xalloc (total_bytes);
+ reply = (xRenderQueryFiltersReply *) malloc (total_bytes);
if (!reply)
return BadAlloc;
aliases = (INT16 *) (reply + 1);
@@ -1819,7 +1819,7 @@ ProcRenderQueryFilters (ClientPtr client)
swapl(&reply->numFilters, n);
}
WriteToClient(client, total_bytes, (char *) reply);
- xfree (reply);
+ free (reply);
return(client->noClientException);
}
@@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
if (client->req_len & 1)
return BadLength;
ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1;
- cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
+ cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32)));
if (!cursors)
return BadAlloc;
deltas = (CARD32 *) (cursors + ncursor);
@@ -1873,7 +1873,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
RT_CURSOR, SecurityReadAccess);
if (!cursors[i])
{
- xfree (cursors);
+ free (cursors);
client->errorValue = elt->cursor;
return BadCursor;
}
@@ -1881,7 +1881,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
elt++;
}
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor);
- xfree (cursors);
+ free (cursors);
if (ret != Success)
return ret;
@@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
return BadDrawable;
- if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+ if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPict->type = XRT_PICTURE;
newPict->info[0].id = stuff->pid;
@@ -2707,7 +2707,7 @@ PanoramiXRenderCreatePicture (ClientPtr client)
if (result == Success)
AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
else
- xfree(newPict);
+ free(newPict);
return (result);
}
diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c
index acdd9cf2e..c60d4b37c 100755
--- a/nx-X11/programs/Xserver/xfixes/cursor.c
+++ b/nx-X11/programs/Xserver/xfixes/cursor.c
@@ -124,7 +124,7 @@ CursorCloseScreen (int index, ScreenPtr pScreen)
Unwrap (cs, pScreen, CloseScreen);
Unwrap (cs, pScreen, DisplayCursor);
ret = (*pScreen->CloseScreen) (index, pScreen);
- xfree (cs);
+ free (cs);
if (index == 0)
CursorScreenPrivateIndex = -1;
return ret;
@@ -157,7 +157,7 @@ XFixesSelectCursorInput (ClientPtr pClient,
}
if (!e)
{
- e = (CursorEventPtr) xalloc (sizeof (CursorEventRec));
+ e = (CursorEventPtr) malloc (sizeof (CursorEventRec));
if (!e)
return BadAlloc;
@@ -174,7 +174,7 @@ XFixesSelectCursorInput (ClientPtr pClient,
if (!AddResource (pWindow->drawable.id, CursorWindowType,
(void *) pWindow))
{
- xfree (e);
+ free (e);
return BadAlloc;
}
@@ -312,7 +312,7 @@ ProcXFixesGetCursorImage (ClientPtr client)
width = pCursor->bits->width;
height = pCursor->bits->height;
npixels = width * height;
- rep = xalloc (sizeof (xXFixesGetCursorImageReply) +
+ rep = malloc (sizeof (xXFixesGetCursorImageReply) +
npixels * sizeof (CARD32));
if (!rep)
return BadAlloc;
@@ -346,7 +346,7 @@ ProcXFixesGetCursorImage (ClientPtr client)
}
(void) WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
(npixels << 2), (char *) rep);
- xfree (rep);
+ free (rep);
return client->noClientException;
}
@@ -463,7 +463,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
name = pCursor->name ? NameForAtom (pCursor->name) : "";
nbytes = strlen (name);
nbytesRound = (nbytes + 3) & ~3;
- rep = xalloc (sizeof (xXFixesGetCursorImageAndNameReply) +
+ rep = malloc (sizeof (xXFixesGetCursorImageAndNameReply) +
npixels * sizeof (CARD32) + nbytesRound);
if (!rep)
return BadAlloc;
@@ -502,7 +502,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
}
(void) WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
(npixels << 2) + nbytesRound, (char *) rep);
- xfree (rep);
+ free (rep);
return client->noClientException;
}
@@ -699,7 +699,7 @@ CursorFreeClient (void * data, XID id)
if (e == old)
{
*prev = e->next;
- xfree (e);
+ free (e);
break;
}
}
@@ -740,7 +740,7 @@ XFixesCursorInit (void)
ScreenPtr pScreen = screenInfo.screens[i];
CursorScreenPtr cs;
- cs = (CursorScreenPtr) xalloc (sizeof (CursorScreenRec));
+ cs = (CursorScreenPtr) malloc (sizeof (CursorScreenRec));
if (!cs)
return FALSE;
Wrap (cs, pScreen, CloseScreen, CursorCloseScreen);
diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c
index 0b1865cf0..09f33d0ac 100755
--- a/nx-X11/programs/Xserver/xfixes/region.c
+++ b/nx-X11/programs/Xserver/xfixes/region.c
@@ -575,7 +575,7 @@ ProcXFixesFetchRegion (ClientPtr client)
pBox = RegionRects (pRegion);
nBox = RegionNumRects (pRegion);
- reply = xalloc (sizeof (xXFixesFetchRegionReply) +
+ reply = malloc (sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle));
if (!reply)
return BadAlloc;
@@ -608,7 +608,7 @@ ProcXFixesFetchRegion (ClientPtr client)
}
(void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle), (char *) reply);
- xfree (reply);
+ free (reply);
return (client->noClientException);
}
@@ -822,7 +822,7 @@ ProcXFixesExpandRegion (ClientPtr client)
pSrc = RegionRects(pSource);
if (nBoxes)
{
- pTmp = xalloc (nBoxes * sizeof (BoxRec));
+ pTmp = malloc (nBoxes * sizeof (BoxRec));
if (!pTmp)
return BadAlloc;
for (i = 0; i < nBoxes; i++)
diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c
index 464979165..6fe632c0d 100755
--- a/nx-X11/programs/Xserver/xfixes/select.c
+++ b/nx-X11/programs/Xserver/xfixes/select.c
@@ -156,7 +156,7 @@ XFixesSelectSelectionInput (ClientPtr pClient,
}
if (!e)
{
- e = (SelectionEventPtr) xalloc (sizeof (SelectionEventRec));
+ e = (SelectionEventPtr) malloc (sizeof (SelectionEventRec));
if (!e)
return BadAlloc;
@@ -174,7 +174,7 @@ XFixesSelectSelectionInput (ClientPtr pClient,
if (!AddResource (pWindow->drawable.id, SelectionWindowType,
(void *) pWindow))
{
- xfree (e);
+ free (e);
return BadAlloc;
}
@@ -250,7 +250,7 @@ SelectionFreeClient (void * data, XID id)
if (e == old)
{
*prev = e->next;
- xfree (e);
+ free (e);
CheckSelectionCallback ();
break;
}
diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c
index 3dfb85644..2b8f90bad 100644
--- a/nx-X11/programs/Xserver/xkb/ddxList.c
+++ b/nx-X11/programs/Xserver/xkb/ddxList.c
@@ -169,7 +169,7 @@ char tmpname[PATH_MAX];
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]);
in= fopen(buf,"r");
- xfree (buf);
+ free (buf);
buf = NULL;
}
if (!in) {
@@ -186,7 +186,7 @@ char tmpname[PATH_MAX];
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
buf = Xprintf("%s.dir",componentDirs[what]);
in= fopen(buf,"r");
- xfree (buf);
+ free (buf);
buf = NULL;
}
if (!in) {
@@ -217,7 +217,7 @@ char tmpname[PATH_MAX];
if (!in)
{
if (buf != NULL)
- xfree (buf);
+ free (buf);
#ifdef WIN32
unlink(tmpname);
#endif
@@ -277,7 +277,7 @@ char tmpname[PATH_MAX];
unlink(tmpname);
#endif
if (buf != NULL)
- xfree (buf);
+ free (buf);
return status;
}
diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c
index b3ef60f22..9134e4754 100644
--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c
+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c
@@ -151,7 +151,7 @@ Win32System(const char *cmdline)
LocalFree(buffer);
}
- xfree(cmd);
+ free(cmd);
return -1;
}
/* Wait until child process exits. */
@@ -162,7 +162,7 @@ Win32System(const char *cmdline)
/* Close process and thread handles. */
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
- xfree(cmd);
+ free(cmd);
return dwExitCode;
}
@@ -620,7 +620,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
if (outFile!=NULL)
_XkbFree(outFile);
if (cmd!=NULL)
- xfree(cmd);
+ free(cmd);
return True;
}
#ifdef DEBUG
@@ -629,7 +629,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
if (outFile!=NULL)
_XkbFree(outFile);
if (cmd!=NULL)
- xfree(cmd);
+ free(cmd);
return False;
}
@@ -802,7 +802,7 @@ char tmpname[PATH_MAX];
}
#endif
if (buf != NULL)
- xfree (buf);
+ free (buf);
return True;
}
#ifdef DEBUG
@@ -826,7 +826,7 @@ char tmpname[PATH_MAX];
if (nameRtrn)
nameRtrn[0]= '\0';
if (buf != NULL)
- xfree (buf);
+ free (buf);
return False;
}
diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c
index 20aab8ef0..7085fbfe4 100644
--- a/nx-X11/programs/Xserver/xkb/xkb.c
+++ b/nx-X11/programs/Xserver/xkb/xkb.c
@@ -4823,16 +4823,16 @@ char * wire;
return status;
status = _GetCountedString(&wire, client, &val);
if (status != Success) {
- xfree(name);
+ free(name);
return status;
}
if (XkbAddGeomProperty(geom,name,val)==NULL) {
- xfree(name);
- xfree(val);
+ free(name);
+ free(val);
return BadAlloc;
}
- xfree(name);
- xfree(val);
+ free(name);
+ free(val);
}
if (req->nColors<2) {
@@ -4860,10 +4860,10 @@ char * wire;
if (status != Success)
return status;
if (!XkbAddGeomColor(geom,name,geom->num_colors)) {
- xfree(name);
+ free(name);
return BadAlloc;
}
- xfree(name);
+ free(name);
}
if (req->nColors!=geom->num_colors) {
client->errorValue= _XkbErrCode3(0x05,req->nColors,geom->num_colors);
diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c
index eb1c80448..7bc6b3476 100644
--- a/nx-X11/programs/Xserver/xkb/xkbActions.c
+++ b/nx-X11/programs/Xserver/xkb/xkbActions.c
@@ -75,7 +75,7 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
if (!AllocateDevicePrivate(device, xkbDevicePrivateIndex))
return;
- xkbPrivPtr = (xkbDeviceInfoPtr) xalloc(sizeof(xkbDeviceInfoRec));
+ xkbPrivPtr = (xkbDeviceInfoPtr) malloc(sizeof(xkbDeviceInfoRec));
if (!xkbPrivPtr)
return;
xkbPrivPtr->unwrapProc = NULL;