aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-06-26 01:51:18 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-07-02 14:05:30 +0200
commit2646fc254e75c4a7fc10d03d1139d0bd708ceae9 (patch)
tree6a183ec2959f55cf8d6850d072b557399b401f7e /nx-X11/programs
parentacf87144d019f18e646501657d9082c6eba77f54 (diff)
downloadnx-libs-2646fc254e75c4a7fc10d03d1139d0bd708ceae9.tar.gz
nx-libs-2646fc254e75c4a7fc10d03d1139d0bd708ceae9.tar.bz2
nx-libs-2646fc254e75c4a7fc10d03d1139d0bd708ceae9.zip
nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead.
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.c6
-rw-r--r--nx-X11/programs/Xserver/GL/glx/glxutil.c6
-rw-r--r--nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c2
-rw-r--r--nx-X11/programs/Xserver/Xext/extmod/modinit.c2
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiX.c12
-rw-r--r--nx-X11/programs/Xserver/Xext/panoramiXprocs.c12
-rw-r--r--nx-X11/programs/Xserver/Xext/saver.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/security.c8
-rw-r--r--nx-X11/programs/Xserver/Xext/shape.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/shm.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/sleepuntil.c2
-rw-r--r--nx-X11/programs/Xserver/Xext/sync.c12
-rw-r--r--nx-X11/programs/Xserver/Xext/xcmisc.c2
-rw-r--r--nx-X11/programs/Xserver/Xext/xf86bigfont.c2
-rw-r--r--nx-X11/programs/Xserver/Xext/xvdisp.c4
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmain.c8
-rw-r--r--nx-X11/programs/Xserver/Xext/xvmc.c8
-rw-r--r--nx-X11/programs/Xserver/Xi/exevents.c10
-rw-r--r--nx-X11/programs/Xserver/Xi/extinit.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/getdctl.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/getfctl.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/getprop.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/getselev.c2
-rw-r--r--nx-X11/programs/Xserver/Xi/queryst.c2
-rw-r--r--nx-X11/programs/Xserver/composite/compalloc.c8
-rw-r--r--nx-X11/programs/Xserver/composite/compinit.c2
-rwxr-xr-xnx-X11/programs/Xserver/damageext/damageext.c2
-rw-r--r--nx-X11/programs/Xserver/dbe/dbe.c8
-rw-r--r--nx-X11/programs/Xserver/dbe/midbe.c2
-rw-r--r--nx-X11/programs/Xserver/dix/atom.c6
-rw-r--r--nx-X11/programs/Xserver/dix/colormap.c16
-rw-r--r--nx-X11/programs/Xserver/dix/cursor.c14
-rw-r--r--nx-X11/programs/Xserver/dix/devices.c36
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c10
-rw-r--r--nx-X11/programs/Xserver/dix/dixfonts.c36
-rw-r--r--nx-X11/programs/Xserver/dix/dixutils.c8
-rw-r--r--nx-X11/programs/Xserver/dix/events.c6
-rw-r--r--nx-X11/programs/Xserver/dix/extension.c8
-rw-r--r--nx-X11/programs/Xserver/dix/gc.c12
-rw-r--r--nx-X11/programs/Xserver/dix/glyphcurs.c2
-rw-r--r--nx-X11/programs/Xserver/dix/grabs.c4
-rw-r--r--nx-X11/programs/Xserver/dix/main.c6
-rw-r--r--nx-X11/programs/Xserver/dix/pixmap.c4
-rw-r--r--nx-X11/programs/Xserver/dix/property.c6
-rw-r--r--nx-X11/programs/Xserver/dix/region.c14
-rw-r--r--nx-X11/programs/Xserver/dix/resource.c10
-rw-r--r--nx-X11/programs/Xserver/dix/window.c10
-rw-r--r--nx-X11/programs/Xserver/fb/fballpriv.c2
-rw-r--r--nx-X11/programs/Xserver/fb/fbcmap.c8
-rw-r--r--nx-X11/programs/Xserver/fb/fbcopy.c2
-rw-r--r--nx-X11/programs/Xserver/fb/fboverlay.c2
-rw-r--r--nx-X11/programs/Xserver/fb/fbpseudocolor.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Colormap.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Cursor.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c14
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GCOps.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Image.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c28
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c2
-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.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXproperty.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c16
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXresource.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c24
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Render.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Rootless.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c32
-rw-r--r--nx-X11/programs/Xserver/include/os.h2
-rw-r--r--nx-X11/programs/Xserver/mi/miarc.c16
-rw-r--r--nx-X11/programs/Xserver/mi/mibitblt.c4
-rw-r--r--nx-X11/programs/Xserver/mi/mibstore.c6
-rw-r--r--nx-X11/programs/Xserver/mi/micmap.c10
-rw-r--r--nx-X11/programs/Xserver/mi/midispcur.c4
-rw-r--r--nx-X11/programs/Xserver/mi/migc.c2
-rw-r--r--nx-X11/programs/Xserver/mi/mioverlay.c2
-rw-r--r--nx-X11/programs/Xserver/mi/mipointer.c2
-rw-r--r--nx-X11/programs/Xserver/mi/mipolyutil.c2
-rw-r--r--nx-X11/programs/Xserver/mi/mipushpxl.c2
-rw-r--r--nx-X11/programs/Xserver/mi/miscrinit.c2
-rw-r--r--nx-X11/programs/Xserver/mi/mispans.c8
-rw-r--r--nx-X11/programs/Xserver/mi/misprite.c2
-rw-r--r--nx-X11/programs/Xserver/mi/miwideline.c12
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw.c2
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw_render.c2
-rwxr-xr-xnx-X11/programs/Xserver/miext/damage/damage.c4
-rw-r--r--nx-X11/programs/Xserver/os/Imakefile17
-rw-r--r--nx-X11/programs/Xserver/os/WaitFor.c2
-rw-r--r--nx-X11/programs/Xserver/os/access.c12
-rw-r--r--nx-X11/programs/Xserver/os/connection.c6
-rw-r--r--nx-X11/programs/Xserver/os/io.c8
-rw-r--r--nx-X11/programs/Xserver/os/log.c4
-rw-r--r--nx-X11/programs/Xserver/os/mitauth.c4
-rw-r--r--nx-X11/programs/Xserver/os/oscolor.c6
-rw-r--r--nx-X11/programs/Xserver/os/rpcauth.c4
-rw-r--r--nx-X11/programs/Xserver/os/utils.c18
-rw-r--r--nx-X11/programs/Xserver/os/xalloc.c817
-rw-r--r--nx-X11/programs/Xserver/os/xdmauth.c8
-rw-r--r--nx-X11/programs/Xserver/os/xdmcp.c6
-rw-r--r--nx-X11/programs/Xserver/os/xprintf.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rrcrtc.c14
-rw-r--r--nx-X11/programs/Xserver/randr/rrdispatch.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rrinfo.c2
-rw-r--r--nx-X11/programs/Xserver/randr/rrmode.c6
-rw-r--r--nx-X11/programs/Xserver/randr/rrmonitor.c2
-rw-r--r--nx-X11/programs/Xserver/randr/rroutput.c14
-rw-r--r--nx-X11/programs/Xserver/randr/rrproperty.c12
-rw-r--r--nx-X11/programs/Xserver/randr/rrprovider.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rrproviderproperty.c12
-rw-r--r--nx-X11/programs/Xserver/randr/rrscreen.c8
-rw-r--r--nx-X11/programs/Xserver/randr/rrtransform.c2
-rw-r--r--nx-X11/programs/Xserver/record/record.c14
-rw-r--r--nx-X11/programs/Xserver/record/set.c5
-rw-r--r--nx-X11/programs/Xserver/render/animcur.c4
-rw-r--r--nx-X11/programs/Xserver/render/filter.c10
-rw-r--r--nx-X11/programs/Xserver/render/glyph.c8
-rw-r--r--nx-X11/programs/Xserver/render/miindex.c4
-rw-r--r--nx-X11/programs/Xserver/render/picture.c20
-rw-r--r--nx-X11/programs/Xserver/render/render.c18
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/cursor.c8
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/region.c4
-rwxr-xr-xnx-X11/programs/Xserver/xfixes/select.c2
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbActions.c2
134 files changed, 464 insertions, 1301 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 5b6c545fc..b1245f900 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;
@@ -99,7 +99,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
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/glxutil.c b/nx-X11/programs/Xserver/GL/glx/glxutil.c
index cf0aae011..715bb5c99 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;
@@ -111,7 +111,7 @@ __glXRealloc(void *addr, size_t newSize)
if (newSize == 0) {
return NULL;
} else {
- newAddr = xalloc(newSize);
+ newAddr = malloc(newSize);
}
}
if (newAddr == NULL) {
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 0a86bf208..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;
diff --git a/nx-X11/programs/Xserver/Xext/extmod/modinit.c b/nx-X11/programs/Xserver/Xext/extmod/modinit.c
index 5bfd15719..5224a8ad9 100644
--- a/nx-X11/programs/Xserver/Xext/extmod/modinit.c
+++ b/nx-X11/programs/Xserver/Xext/extmod/modinit.c
@@ -161,7 +161,7 @@ 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");
diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c
index c3b47cf2c..ecf3453bb 100644
--- a/nx-X11/programs/Xserver/Xext/panoramiX.c
+++ b/nx-X11/programs/Xserver/Xext/panoramiX.c
@@ -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;
@@ -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) {
@@ -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;
diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c
index 28c0eb8b0..9682f2427 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;
@@ -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;
@@ -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;
@@ -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);
@@ -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;
@@ -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;
diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c
index 68dbe2fe8..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
@@ -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;
diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c
index ceadd8f6a..ec5f371db 100644
--- a/nx-X11/programs/Xserver/Xext/security.c
+++ b/nx-X11/programs/Xserver/Xext/security.c
@@ -524,7 +524,7 @@ SecurityEventSelectForAuthorization(
}
}
- pEventClient = (OtherClients *) xalloc(sizeof(OtherClients));
+ pEventClient = (OtherClients *) malloc(sizeof(OtherClients));
if (!pEventClient)
return BadAlloc;
pEventClient->mask = mask;
@@ -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;
@@ -1643,7 +1643,7 @@ SecurityParsePropertyAccessRule(
*/
if (mustHaveValue)
size += strlen(mustHaveValue) + 1;
- pacl = (PropertyAccessPtr)Xalloc(size);
+ pacl = (PropertyAccessPtr)malloc(size);
if (!pacl)
return FALSE;
@@ -1716,7 +1716,7 @@ SecurityParseSitePolicy(
if (!policyStr)
return FALSE;
- copyPolicyStr = (char *)Xalloc(strlen(policyStr) + 1);
+ copyPolicyStr = (char *)malloc(strlen(policyStr) + 1);
if (!copyPolicyStr)
return TRUE;
strcpy(copyPolicyStr, policyStr);
diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c
index a55dd4553..b929dded0 100644
--- a/nx-X11/programs/Xserver/Xext/shape.c
+++ b/nx-X11/programs/Xserver/Xext/shape.c
@@ -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))
{
diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c
index 4e36a6bb4..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,
@@ -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;
diff --git a/nx-X11/programs/Xserver/Xext/sleepuntil.c b/nx-X11/programs/Xserver/Xext/sleepuntil.c
index 368dc6b48..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;
diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c
index 8fe510497..88170169e 100644
--- a/nx-X11/programs/Xserver/Xext/sync.c
+++ b/nx-X11/programs/Xserver/Xext/sync.c
@@ -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;
@@ -1014,7 +1014,7 @@ 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))
@@ -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);
@@ -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;
@@ -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;
}
diff --git a/nx-X11/programs/Xserver/Xext/xcmisc.c b/nx-X11/programs/Xserver/Xext/xcmisc.c
index 8f381cee5..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;
diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c
index 7bdda72b4..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;
diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c
index b300a32d5..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;
@@ -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 d2c21b13f..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");
@@ -941,7 +941,7 @@ 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))
@@ -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 0ec04f3e3..bce7fbf7a 100644
--- a/nx-X11/programs/Xserver/Xext/xvmc.c
+++ b/nx-X11/programs/Xserver/Xext/xvmc.c
@@ -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;
}
@@ -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;
@@ -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;
@@ -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/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c
index 1612047bb..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) {
@@ -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));
@@ -1027,7 +1027,7 @@ 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;
}
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 440c1eeb4..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,
diff --git a/nx-X11/programs/Xserver/Xi/getfctl.c b/nx-X11/programs/Xserver/Xi/getfctl.c
index e2f243430..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,
diff --git a/nx-X11/programs/Xserver/Xi/getprop.c b/nx-X11/programs/Xserver/Xi/getprop.c
index 33d49fb95..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;
diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c
index 05d9d987c..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;
diff --git a/nx-X11/programs/Xserver/Xi/queryst.c b/nx-X11/programs/Xserver/Xi/queryst.c
index 975643e0e..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,
diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c
index a5d0998eb..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,7 +156,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
*/
if (!cw)
{
- cw = xalloc (sizeof (CompWindowRec));
+ cw = malloc (sizeof (CompWindowRec));
if (!cw)
{
free (ccw);
@@ -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,7 +365,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
*/
if (!csw)
{
- csw = xalloc (sizeof (CompSubwindowsRec));
+ csw = malloc (sizeof (CompSubwindowsRec));
if (!csw)
{
free (ccw);
diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c
index 930787195..e33bd3a3f 100644
--- a/nx-X11/programs/Xserver/composite/compinit.c
+++ b/nx-X11/programs/Xserver/composite/compinit.c
@@ -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;
diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c
index aedbecb7b..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;
diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c
index e64b6bd22..658e61abe 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)
{
@@ -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);
@@ -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);
@@ -932,7 +932,7 @@ ProcDbeGetVisualInfo(client)
}
count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n;
- if (!(pScrVisInfo = (XdbeScreenVisualInfo *)xalloc(count *
+ if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count *
sizeof(XdbeScreenVisualInfo))))
{
if (pDrawables)
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 fdb1c18a2..227069bab 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,7 +118,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
}
else
{
- nd->string = (char *) xalloc(len + 1);
+ nd->string = (char *) malloc(len + 1);
if (!nd->string) {
free(nd);
return BAD_RESOURCE;
@@ -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 39da0abd4..121877461 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,7 +303,7 @@ 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)
{
free(pmap);
@@ -349,7 +349,7 @@ 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)
{
free(pmap->clientPixelsRed[client]);
@@ -365,7 +365,7 @@ 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)
{
free(pmap->clientPixelsGreen[client]);
@@ -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);
@@ -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);
}
@@ -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);
}
@@ -2089,7 +2089,7 @@ 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++)
free(ppshared[z]);
diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c
index 575ff1eb4..875e19480 100644
--- a/nx-X11/programs/Xserver/dix/cursor.c
+++ b/nx-X11/programs/Xserver/dix/cursor.c
@@ -174,7 +174,7 @@ 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)
{
free(psrcbits);
@@ -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)
@@ -334,7 +334,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
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,9 +342,9 @@ 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;
}
@@ -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);
diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c
index 314714152..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;
@@ -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);
@@ -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;
@@ -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,9 +716,9 @@ 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)
@@ -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,7 +997,7 @@ 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)
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index 9b9021d62..807fecd90 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -1021,7 +1021,7 @@ ProcSetSelectionOwner(register ClientPtr client)
Selection *newsels;
if (i == 0)
- newsels = (Selection *)xalloc(sizeof(Selection));
+ newsels = (Selection *)malloc(sizeof(Selection));
else
newsels = (Selection *)xrealloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
@@ -3084,10 +3084,10 @@ 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)
{
free(srcbits);
@@ -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,7 +3753,7 @@ 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);
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index 1a0352387..ef40c66f7 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -393,7 +393,7 @@ 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);
@@ -430,10 +430,10 @@ 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) {
@@ -445,7 +445,7 @@ 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) {
free(c->fontname);
free(c);
@@ -680,7 +680,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
}
if (err == FontNameAlias) {
if (resolved) free(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
}
@@ -735,7 +735,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->haveSaved = TRUE;
if (c->savedName)
free(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
c->savedNameLen = namelen;
@@ -853,10 +853,10 @@ 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) {
free(c);
return BadAlloc;
@@ -995,7 +995,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->savedNumFonts = numFonts;
if (c->savedName)
free(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
aliascount = 20;
@@ -1127,10 +1127,10 @@ 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)
{
free(c);
@@ -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,7 +1327,7 @@ 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)
{
free(c);
@@ -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,7 +1527,7 @@ 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)
{
free(c);
@@ -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,13 +1745,13 @@ 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)
{
free(fpe);
diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c
index 1c6305684..84eb63f14 100644
--- a/nx-X11/programs/Xserver/dix/dixutils.c
+++ b/nx-X11/programs/Xserver/dix/dixutils.c
@@ -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;
@@ -735,7 +735,7 @@ _AddCallback(
{
CallbackPtr cbr;
- cbr = (CallbackPtr) xalloc(sizeof(CallbackRec));
+ cbr = (CallbackPtr) malloc(sizeof(CallbackRec));
if (!cbr)
return FALSE;
cbr->proc = callback;
@@ -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;
diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c
index ba0c5d847..97cd13b5e 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;
@@ -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;
@@ -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");
}
diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c
index 4f06c0af4..9c25c3db8 100644
--- a/nx-X11/programs/Xserver/dix/extension.c
+++ b/nx-X11/programs/Xserver/dix/extension.c
@@ -95,10 +95,10 @@ 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)
@@ -164,7 +164,7 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
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);
@@ -438,7 +438,7 @@ 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)
diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c
index 595d8ab74..9566bb8f7 100644
--- a/nx-X11/programs/Xserver/dix/gc.c
+++ b/nx-X11/programs/Xserver/dix/gc.c
@@ -466,7 +466,7 @@ 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)
@@ -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);
@@ -848,7 +848,7 @@ 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)
{
@@ -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;
@@ -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 c8b71db4e..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 */
diff --git a/nx-X11/programs/Xserver/dix/grabs.c b/nx-X11/programs/Xserver/dix/grabs.c
index 7fd9ad096..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);
@@ -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)
diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c
index 9d0197e3d..05f6dd19b 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);
@@ -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;
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/property.c b/nx-X11/programs/Xserver/dix/property.c
index 4476141e5..28ce1355c 100644
--- a/nx-X11/programs/Xserver/dix/property.c
+++ b/nx-X11/programs/Xserver/dix/property.c
@@ -284,10 +284,10 @@ 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)
{
free(pProp);
@@ -347,7 +347,7 @@ 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,
diff --git a/nx-X11/programs/Xserver/dix/region.c b/nx-X11/programs/Xserver/dix/region.c
index 4c2bc4695..df7c1fc16 100644
--- a/nx-X11/programs/Xserver/dix/region.c
+++ b/nx-X11/programs/Xserver/dix/region.c
@@ -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;
@@ -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;
@@ -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;
@@ -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);
@@ -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 0c5b6dd29..905dafc24 100644
--- a/nx-X11/programs/Xserver/dix/resource.c
+++ b/nx-X11/programs/Xserver/dix/resource.c
@@ -232,7 +232,7 @@ InitClientResources(ClientPtr client)
TypeMask = RC_LASTPREDEF - 1;
if (DeleteFuncs)
free(DeleteFuncs);
- DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) *
+ DeleteFuncs = (DeleteType *)malloc((lastResourceType + 1) *
sizeof(DeleteType));
if (!DeleteFuncs)
return FALSE;
@@ -250,13 +250,13 @@ InitClientResources(ClientPtr client)
#ifdef XResExtension
if(ResourceNames)
free(ResourceNames);
- ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom));
+ 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);
diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c
index 945dde7cf..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;
@@ -3445,8 +3445,8 @@ 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)
{
free(srcbits);
@@ -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];
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 9fdffdeff..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,8 +487,8 @@ 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)
{
free (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;
}
diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c
index d1fb63828..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;
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/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c
index bc1c091ed..71f39b52f 100644
--- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c
+++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c
@@ -271,7 +271,7 @@ 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;
@@ -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;
@@ -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;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 4f0173db0..895de1ef8 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -362,7 +362,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if ((size = strlen(argv[i])) < 1024)
{
- if ((nxagentOptionFile = xalloc(size + 1)) == NULL)
+ if ((nxagentOptionFile = malloc(size + 1)) == NULL)
{
FatalError("malloc failed");
}
@@ -726,7 +726,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
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));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 5249d8550..2fb53d440 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -1491,7 +1491,7 @@ int nxagentInitClipboard(WindowPtr pWin)
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 18c4c67a6..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);
@@ -116,7 +116,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
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);
@@ -129,7 +129,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
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);
@@ -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];
@@ -255,7 +255,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#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];
@@ -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)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
index b1449bf13..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,
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 27cd0859a..86a338b3d 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++)
{
@@ -2063,7 +2063,7 @@ void nxagentBackupDisplayInfo(void)
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));
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index a73040eeb..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");
@@ -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");
@@ -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++)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 22b3e6c88..90f545027 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -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");
@@ -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;
@@ -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)
{
@@ -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, "-");
@@ -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)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c
index 21e828769..ef83b871a 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;)
@@ -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;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c
index 01a3f6a93..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");
@@ -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");
@@ -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
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c
index b7c3135d0..8cc8962cc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Image.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c
@@ -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 6bd201d70..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);
@@ -1296,7 +1296,7 @@ int nxagentResetKeyboard(void)
savedBellPercent, savedBellPitch, savedBellDuration);
#endif
- devBackup = xalloc(sizeof(DeviceIntRec));
+ devBackup = malloc(sizeof(DeviceIntRec));
if (devBackup == NULL)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index d1923106d..b27a92102 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -204,7 +204,7 @@ InitSelections()
#ifdef NXAGENT_CLIPBOARD
{
Selection *newsels;
- newsels = (Selection *)xalloc(2 * sizeof(Selection));
+ newsels = (Selection *)malloc(2 * sizeof(Selection));
if (!newsels)
return;
NumCurrentSelections += 2;
@@ -750,7 +750,7 @@ ProcSetSelectionOwner(register ClientPtr client)
Selection *newsels;
if (i == 0)
- newsels = (Selection *)xalloc(sizeof(Selection));
+ newsels = (Selection *)malloc(sizeof(Selection));
else
newsels = (Selection *)xrealloc(CurrentSelections,
(NumCurrentSelections + 1) * sizeof(Selection));
@@ -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 d15df9513..4b0af0867 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -442,7 +442,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
}
if (err == FontNameAlias) {
if (resolved) free(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
}
@@ -497,7 +497,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->haveSaved = TRUE;
if (c->savedName)
free(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
c->savedNameLen = namelen;
@@ -638,10 +638,10 @@ 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) {
free(c);
return BadAlloc;
@@ -786,7 +786,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->savedNumFonts = numFonts;
if (c->savedName)
free(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
aliascount = 20;
@@ -1086,7 +1086,7 @@ nxdoListFontsAndAliases(client, fss)
}
if (err == FontNameAlias) {
if (resolved) free(resolved);
- resolved = (char *) xalloc(resolvedlen + 1);
+ resolved = (char *) malloc(resolvedlen + 1);
if (resolved)
{
memmove(resolved, tmpname, resolvedlen);
@@ -1155,7 +1155,7 @@ nxdoListFontsAndAliases(client, fss)
c->haveSaved = TRUE;
if (c->savedName)
free(c->savedName);
- c->savedName = (char *)xalloc(namelen + 1);
+ c->savedName = (char *)malloc(namelen + 1);
if (c->savedName)
{
memmove(c->savedName, name, namelen);
@@ -1275,7 +1275,7 @@ 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);
@@ -1312,16 +1312,16 @@ 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)))
{
free(fss);
return BadAlloc;
}
c->fpe_list = (FontPathElementPtr *)
- xalloc(sizeof(FontPathElementPtr) * num_fpes);
+ malloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
free(c);
free(fss);
@@ -1351,7 +1351,7 @@ 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++)
@@ -1361,7 +1361,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
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) {
@@ -1378,7 +1378,7 @@ 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) {
free(oc->fontname);
free(oc);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
index 53a5a8d68..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 */
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 44248bc1b..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,7 +281,7 @@ 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;
free(pPicture);
@@ -318,7 +318,7 @@ static PicturePtr createSourcePicture(void)
picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec);
- pPicture = (PicturePtr) xalloc(totalPictureSize);
+ pPicture = (PicturePtr) malloc(totalPictureSize);
if (pPicture != NULL)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
index 0ace2fbd2..4b4e059bd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
@@ -227,10 +227,10 @@ 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)
{
free(pProp);
@@ -290,7 +290,7 @@ 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,
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index b89b835db..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);
@@ -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);
}
@@ -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);
@@ -1219,19 +1219,19 @@ 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)
{
free (argbbits);
return (BadAlloc);
}
- mskbits = (unsigned char *)xalloc(nbytes_mono);
+ mskbits = (unsigned char *)malloc(nbytes_mono);
if (!mskbits)
{
free(argbbits);
@@ -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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c
index 4226a4435..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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index 08237440f..86b9e0d24 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -234,7 +234,7 @@ 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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index 0eabf1262..931c564dc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -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);
@@ -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");
@@ -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");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index 587e9a564..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);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
index 36ce6a74f..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)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
index 6947371ff..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++)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index a4c6fc2db..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)
{
@@ -3068,12 +3068,12 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
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;
@@ -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);
@@ -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)
{
@@ -3771,7 +3771,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
if (screeninfo) {
free(screeninfo);
}
- if (!(screeninfo = xalloc(sizeof(XineramaScreenInfo)))) {
+ if (!(screeninfo = malloc(sizeof(XineramaScreenInfo)))) {
return FALSE;
}
@@ -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;)
@@ -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;)
@@ -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;
@@ -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;
diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h
index 3b6a40b46..342913b4a 100644
--- a/nx-X11/programs/Xserver/include/os.h
+++ b/nx-X11/programs/Xserver/include/os.h
@@ -52,7 +52,7 @@ SOFTWARE.
#define OS_H
#include "misc.h"
-#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
+#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
diff --git a/nx-X11/programs/Xserver/mi/miarc.c b/nx-X11/programs/Xserver/mi/miarc.c
index b268c1140..c1e07f175 100644
--- a/nx-X11/programs/Xserver/mi/miarc.c
+++ b/nx-X11/programs/Xserver/mi/miarc.c
@@ -912,7 +912,7 @@ miComputeWideEllipse(
{
if (spdata)
free(spdata);
- spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) +
+ spdata = (miArcSpanData *)malloc(sizeof(miArcSpanData) +
sizeof(miArcSpan) * (k + 2));
lruent->spdata = spdata;
if (!spdata)
@@ -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;
@@ -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;
@@ -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;
@@ -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;
diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c
index ae30d5238..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)
{
@@ -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;
diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c
index d3dc11603..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;
@@ -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;
@@ -2581,7 +2581,7 @@ miBSAllocate(pWin)
if (!(pBackingStore = (miBSWindowPtr)pWin->backStorage))
{
- pBackingStore = (miBSWindowPtr)xalloc(sizeof(miBSWindowRec));
+ pBackingStore = (miBSWindowPtr)malloc(sizeof(miBSWindowRec));
if (!pBackingStore)
return;
diff --git a/nx-X11/programs/Xserver/mi/micmap.c b/nx-X11/programs/Xserver/mi/micmap.c
index 607ecec3b..1d79ade9b 100644
--- a/nx-X11/programs/Xserver/mi/micmap.c
+++ b/nx-X11/programs/Xserver/mi/micmap.c
@@ -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,9 +560,9 @@ 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)
{
free (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;
}
diff --git a/nx-X11/programs/Xserver/mi/midispcur.c b/nx-X11/programs/Xserver/mi/midispcur.c
index 5d4b3023a..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;
@@ -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
diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c
index 0ca7872a3..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;
diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c
index 1c0402892..cff29ee2a 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;
diff --git a/nx-X11/programs/Xserver/mi/mipointer.c b/nx-X11/programs/Xserver/mi/mipointer.c
index 48da4b6c3..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;
diff --git a/nx-X11/programs/Xserver/mi/mipolyutil.c b/nx-X11/programs/Xserver/mi/mipolyutil.c
index 7a9794fe3..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;
diff --git a/nx-X11/programs/Xserver/mi/mipushpxl.c b/nx-X11/programs/Xserver/mi/mipushpxl.c
index 83821b266..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;
diff --git a/nx-X11/programs/Xserver/mi/miscrinit.c b/nx-X11/programs/Xserver/mi/miscrinit.c
index c0df4a072..f2b009fcd 100644
--- a/nx-X11/programs/Xserver/mi/miscrinit.c
+++ b/nx-X11/programs/Xserver/mi/miscrinit.c
@@ -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 107476df3..38398f86b 100644
--- a/nx-X11/programs/Xserver/mi/mispans.c
+++ b/nx-X11/programs/Xserver/mi/mispans.c
@@ -418,8 +418,8 @@ 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)
{
@@ -492,8 +492,8 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
} /* 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;
diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c
index 2b68ad76a..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;
diff --git a/nx-X11/programs/Xserver/mi/miwideline.c b/nx-X11/programs/Xserver/mi/miwideline.c
index f3e8c691a..b96db7cfa 100644
--- a/nx-X11/programs/Xserver/mi/miwideline.c
+++ b/nx-X11/programs/Xserver/mi/miwideline.c
@@ -127,10 +127,10 @@ 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)
{
free (spanRec.points);
@@ -231,10 +231,10 @@ 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)
{
free (spanRec.points);
@@ -1076,10 +1076,10 @@ 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)
{
free (points);
diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c
index 5b2c65927..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;
diff --git a/nx-X11/programs/Xserver/miext/cw/cw_render.c b/nx-X11/programs/Xserver/miext/cw/cw_render.c
index 2710bf60f..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;
diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c
index 2d6783204..669f08ff5 100755
--- a/nx-X11/programs/Xserver/miext/damage/damage.c
+++ b/nx-X11/programs/Xserver/miext/damage/damage.c
@@ -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;
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 f9037ed3b..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;
}
diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c
index dcd2b52af..4090a9589 100644
--- a/nx-X11/programs/Xserver/os/access.c
+++ b/nx-X11/programs/Xserver/os/access.c
@@ -256,7 +256,7 @@ 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; \
@@ -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
@@ -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;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 4d5826888..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;
@@ -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++)
{
@@ -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;
diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c
index b8f05d939..3e9abb35c 100644
--- a/nx-X11/programs/Xserver/os/io.c
+++ b/nx-X11/programs/Xserver/os/io.c
@@ -1171,10 +1171,10 @@ 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)
{
free(oci);
@@ -1192,10 +1192,10 @@ 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)
{
free(oco);
diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c
index 12827cbe0..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");
@@ -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 4c1ae9cf6..2630a81ae 100644
--- a/nx-X11/programs/Xserver/os/mitauth.c
+++ b/nx-X11/programs/Xserver/os/mitauth.c
@@ -57,10 +57,10 @@ 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) {
free(new);
return 0;
diff --git a/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c
index 8f737eaba..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);
@@ -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 1b3db1e0e..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;
diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c
index 03deb811a..98e3cab8b 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");
@@ -1231,7 +1225,7 @@ InsertFileIntoCommandLine(
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;
@@ -1517,7 +1511,7 @@ Xstrdup(const char *s)
if (s == NULL)
return NULL;
- sd = (char *)Xalloc(strlen(s) + 1);
+ sd = (char *)malloc(strlen(s) + 1);
if (sd != NULL)
strcpy(sd, s);
return sd;
@@ -1808,7 +1802,7 @@ 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) {
@@ -1946,7 +1940,7 @@ 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) {
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 b55f75a36..a89c5b0c0 100644
--- a/nx-X11/programs/Xserver/os/xdmauth.c
+++ b/nx-X11/programs/Xserver/os/xdmauth.c
@@ -260,7 +260,7 @@ 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);
@@ -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) {
@@ -431,7 +431,7 @@ 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) {
diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c
index 29785f48e..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);
@@ -507,7 +507,7 @@ XdmcpRegisterConnection (
return;
}
}
- newAddress = (CARD8 *) xalloc (addrlen * sizeof (CARD8));
+ newAddress = (CARD8 *) malloc (addrlen * sizeof (CARD8));
if (!newAddress)
return;
if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1))
@@ -548,7 +548,7 @@ 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))
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/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c
index 6fb6e02e6..e7add9d60 100644
--- a/nx-X11/programs/Xserver/randr/rrcrtc.c
+++ b/nx-X11/programs/Xserver/randr/rrcrtc.c
@@ -90,7 +90,7 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
(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;
@@ -209,7 +209,7 @@ RRCrtcNotify(RRCrtcPtr crtc,
#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;
@@ -892,7 +892,7 @@ 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;
@@ -1047,7 +1047,7 @@ ProcRRGetCrtcInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
}
@@ -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;
@@ -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;
}
@@ -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;
diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c
index 271d5d939..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)) {
diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c
index 4c47fb903..c5075572f 100644
--- a/nx-X11/programs/Xserver/randr/rrinfo.c
+++ b/nx-X11/programs/Xserver/randr/rrinfo.c
@@ -63,7 +63,7 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh)
(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);
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c
index 3d84a0516..e8dd208a1 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;
@@ -103,7 +103,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
#endif /* !defined(NXAGENT_SERVER) */
else
- newModes = xalloc(sizeof(RRModePtr));
+ newModes = malloc(sizeof(RRModePtr));
if (!newModes) {
free(mode);
@@ -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;
diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c
index 36543cb4c..0e5514415 100644
--- a/nx-X11/programs/Xserver/randr/rrmonitor.c
+++ b/nx-X11/programs/Xserver/randr/rrmonitor.c
@@ -516,7 +516,7 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
(pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- monitors = xalloc(sizeof(RRMonitorPtr));
+ monitors = malloc(sizeof(RRMonitorPtr));
if (!monitors)
return BadAlloc;
diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c
index 46948c577..7be00ab5e 100644
--- a/nx-X11/programs/Xserver/randr/rroutput.c
+++ b/nx-X11/programs/Xserver/randr/rroutput.c
@@ -83,13 +83,13 @@ RROutputCreate(ScreenPtr pScreen,
(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,7 +147,7 @@ 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;
@@ -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;
@@ -236,7 +236,7 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode)
(output->numUserModes + 1) * sizeof(RRModePtr));
#endif /* !defined(NXAGENT_SERVER) */
else
- newModes = xalloc(sizeof(RRModePtr));
+ newModes = malloc(sizeof(RRModePtr));
if (!newModes)
return BadAlloc;
@@ -292,7 +292,7 @@ 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;
@@ -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;
}
diff --git a/nx-X11/programs/Xserver/randr/rrproperty.c b/nx-X11/programs/Xserver/randr/rrproperty.c
index 7275cd34f..cf13ca23e 100644
--- a/nx-X11/programs/Xserver/randr/rrproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproperty.c
@@ -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)
@@ -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)
@@ -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;
@@ -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;
@@ -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;
}
diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c
index 4911f8fd8..1c292b05e 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
@@ -217,7 +217,7 @@ ProcRRGetProviderInfo(ClientPtr client)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra)
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/randr/rrproviderproperty.c b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
index 9aa2135df..b7ba8ab53 100644
--- a/nx-X11/programs/Xserver/randr/rrproviderproperty.c
+++ b/nx-X11/programs/Xserver/randr/rrproviderproperty.c
@@ -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);
@@ -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) {
@@ -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;
@@ -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;
@@ -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;
}
diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c
index 7047d80a5..017ff0143 100644
--- a/nx-X11/programs/Xserver/randr/rrscreen.c
+++ b/nx-X11/programs/Xserver/randr/rrscreen.c
@@ -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;
}
@@ -595,7 +595,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
extraLen = rep.length << 2;
if (extraLen) {
- extra = xalloc(extraLen);
+ extra = malloc(extraLen);
if (!extra) {
free(modes);
return BadAlloc;
@@ -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,7 +874,7 @@ ProcRRGetScreenInfo(ClientPtr client)
extraLen += rep.nrateEnts * sizeof(CARD16);
if (extraLen) {
- extra = (CARD8 *) xalloc(extraLen);
+ extra = (CARD8 *) malloc(extraLen);
if (!extra) {
free(pData);
return BadAlloc;
diff --git a/nx-X11/programs/Xserver/randr/rrtransform.c b/nx-X11/programs/Xserver/randr/rrtransform.c
index 743e227ea..f0c5dd8c7 100644
--- a/nx-X11/programs/Xserver/randr/rrtransform.c
+++ b/nx-X11/programs/Xserver/randr/rrtransform.c
@@ -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;
diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c
index 7fabf79c6..1718c2810 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 */
@@ -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;
@@ -2030,7 +2030,7 @@ 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;
diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c
index 28547f3d0..b8e4cc44c 100644
--- a/nx-X11/programs/Xserver/record/set.c
+++ b/nx-X11/programs/Xserver/record/set.c
@@ -72,7 +72,6 @@ typedef int Bool;
typedef unsigned short CARD16;
-#define xalloc malloc
#define ALLOCATE_LOCAL malloc
#define DEALLOCATE_LOCAL free
@@ -424,7 +423,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;
}
@@ -611,7 +610,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",
diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c
index 993800c7e..c5535050e 100644
--- a/nx-X11/programs/Xserver/render/animcur.c
+++ b/nx-X11/programs/Xserver/render/animcur.c
@@ -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 31d5481c9..065ffa682 100644
--- a/nx-X11/programs/Xserver/render/filter.c
+++ b/nx-X11/programs/Xserver/render/filter.c
@@ -62,7 +62,7 @@ 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);
@@ -70,7 +70,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit)
if (filterNames)
names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *));
else
- names = xalloc (sizeof (char *));
+ names = malloc (sizeof (char *));
if (!names)
{
free (name);
@@ -146,7 +146,7 @@ PictureAddFilter (ScreenPtr pScreen,
if (ps->filters)
filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec));
else
- filters = xalloc (sizeof (PictFilterRec));
+ filters = malloc (sizeof (PictFilterRec));
if (!filters)
return -1;
ps->filters = filters;
@@ -179,7 +179,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias)
(ps->nfilterAliases + 1) *
sizeof (PictFilterAliasRec));
else
- aliases = xalloc (sizeof (PictFilterAliasRec));
+ aliases = malloc (sizeof (PictFilterAliasRec));
if (!aliases)
return FALSE;
ps->filterAliases = aliases;
@@ -336,7 +336,7 @@ 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;
diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c
index f956c44b2..4cba50d0f 100644
--- a/nx-X11/programs/Xserver/render/glyph.c
+++ b/nx-X11/programs/Xserver/render/glyph.c
@@ -122,7 +122,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr)
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)
@@ -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));
@@ -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);
diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c
index ad2653c14..ce31c00fb 100644
--- a/nx-X11/programs/Xserver/render/miindex.c
+++ b/nx-X11/programs/Xserver/render/miindex.c
@@ -259,12 +259,12 @@ 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)
{
free (pIndexed);
diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c
index 1e653b0c3..1131696d5 100644
--- a/nx-X11/programs/Xserver/render/picture.c
+++ b/nx-X11/programs/Xserver/render/picture.c
@@ -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));
@@ -689,7 +689,7 @@ 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)
{
free (formats);
@@ -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,7 +1000,7 @@ 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;
free(pPicture);
@@ -1034,7 +1034,7 @@ 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;
free(pPicture);
@@ -1083,7 +1083,7 @@ 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;
free(pPicture);
@@ -1134,7 +1134,7 @@ 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;
free(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;
}
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c
index 58b3dbc88..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);
@@ -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;
@@ -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;
}
@@ -1533,19 +1533,19 @@ 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)
{
free (argbbits);
return (BadAlloc);
}
- mskbits = (unsigned char *)xalloc(nbytes_mono);
+ mskbits = (unsigned char *)malloc(nbytes_mono);
if (!mskbits)
{
free(argbbits);
@@ -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);
@@ -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);
@@ -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;
diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c
index 6618dd45a..c60d4b37c 100755
--- a/nx-X11/programs/Xserver/xfixes/cursor.c
+++ b/nx-X11/programs/Xserver/xfixes/cursor.c
@@ -157,7 +157,7 @@ XFixesSelectCursorInput (ClientPtr pClient,
}
if (!e)
{
- e = (CursorEventPtr) xalloc (sizeof (CursorEventRec));
+ e = (CursorEventPtr) malloc (sizeof (CursorEventRec));
if (!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;
@@ -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;
@@ -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 ba840f4b3..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;
@@ -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 4abad3f19..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;
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;