Commit 2646fc25 authored by Mike Gabriel's avatar Mike Gabriel

nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead.

parent acf87144
......@@ -336,15 +336,6 @@ XORGRELSTRING = XorgManVersionString
#ifndef UseMemLeak
#define UseMemLeak NO
#endif
#ifndef SpecialMalloc
#define SpecialMalloc NO
#endif
#ifndef UseInternalMalloc
#define UseInternalMalloc NO
#endif
#ifndef XallocDefines
#define XallocDefines /**/
#endif
#ifndef ServerErrorDefines
#define ServerErrorDefines /**/
#endif
......
......@@ -291,12 +291,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
*/
/*
* To enable the internal Xserver malloc, uncomment this
*
#define UseInternalMalloc YES
*/
/*
* Some Linux releases don't have a libtermcap. In this case you may need
* to uncomment the following
*
......
......@@ -17,17 +17,6 @@ XCOMM $XFree86: xc/config/cf/lnxLib.rules,v 3.52 2003/10/31 20:49:03 herrb Exp $
#if UseElfFormat
# if (LinuxCLibMajorVersion >= 5 && LinuxCLibMinorVersion >= 4) || LinuxCLibMajorVersion >= 6
# ifndef SpecialMalloc
# define SpecialMalloc NO
# endif
#if 0
# ifndef UseInternalMalloc
# define UseInternalMalloc NO
# endif
#endif
# endif
# if LinuxCLibMajorVersion <= 5
/*
* #define BaseShLibReqs -lc
......
......@@ -512,10 +512,6 @@ IPLAN2P8_DEFS = -DUSE_IPLAN2P8
# endif
#endif
#ifndef UseInternalMalloc
# define UseInternalMalloc NO
#endif
#ifndef HasDlsymBug
# define HasDlsymBug NO
#endif
......
......@@ -163,25 +163,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
*/
/*
* If you want to use the GNU malloc library, uncomment this
*
#define UseGnuMalloc YES
*/
/*
* Set this to whatever is required to access the GNU malloc library.
* The default is '-lgmalloc' unless is specified in the OS's .cf file.
*
#define GnuMallocLibrary -L/usr/local/lib -lgmalloc
*/
/*
* To enable the internal Xserver malloc, uncomment this
*
#define UseInternalMalloc YES
*/
/*
* Some Linux releases don't have a libtermcap. In this case you may need
* to uncomment the following
*
......
......@@ -33,9 +33,6 @@ in this Software without prior written authorization from The Open Group.
/* Redefine these to XtMalloc/XtFree or whatever you want before including
* this header file.
*/
#ifndef xmalloc
#define xmalloc malloc
#endif
#ifdef CTHREADS
#include <cthreads.h>
......@@ -279,13 +276,13 @@ static xthread_t _X_no_thread_id;
typedef xcondition_rec *xcondition_t;
typedef xmutex_rec *xmutex_t;
#ifndef xcondition_malloc
#define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec))
#define xcondition_malloc() (xcondition_t)malloc(sizeof(xcondition_rec))
#endif
#ifndef xcondition_free
#define xcondition_free(c) free((char *)c)
#endif
#ifndef xmutex_malloc
#define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec))
#define xmutex_malloc() (xmutex_t)malloc(sizeof(xmutex_rec))
#endif
#ifndef xmutex_free
#define xmutex_free(m) free((char *)m)
......
......@@ -221,7 +221,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
/* Copy the string so it can be changed */
tmpptr = mybuf = (char *) xalloc (strlen (address) + 1);
tmpptr = mybuf = (char *) malloc (strlen (address) + 1);
strcpy (mybuf, address);
/* Parse the string to get each component */
......@@ -362,7 +362,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
* string space for them.
*/
if ((*protocol = (char *) xalloc(strlen (_protocol) + 1)) == NULL)
if ((*protocol = (char *) malloc(strlen (_protocol) + 1)) == NULL)
{
/* Malloc failed */
*port = NULL;
......@@ -374,7 +374,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
else
strcpy (*protocol, _protocol);
if ((*host = (char *) xalloc (strlen (_host) + 1)) == NULL)
if ((*host = (char *) malloc (strlen (_host) + 1)) == NULL)
{
/* Malloc failed */
*port = NULL;
......@@ -387,7 +387,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
else
strcpy (*host, _host);
if ((*port = (char *) xalloc (strlen (_port) + 1)) == NULL)
if ((*port = (char *) malloc (strlen (_port) + 1)) == NULL)
{
/* Malloc failed */
*port = NULL;
......@@ -539,7 +539,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
return NULL;
}
if ((save_port = (char *) xalloc (strlen (port) + 1)) == NULL)
if ((save_port = (char *) malloc (strlen (port) + 1)) == NULL)
{
PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0);
......@@ -668,7 +668,7 @@ TRANS(GetReopenInfo) (XtransConnInfo ciptr,
*trans_id = Xtransports[i].transport_id;
*fd = ciptr->fd;
if ((*port = (char *) xalloc (strlen (ciptr->port) + 1)) == NULL)
if ((*port = (char *) malloc (strlen (ciptr->port) + 1)) == NULL)
return 0;
else
{
......@@ -966,7 +966,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
*familyp = ciptr->family;
*addrlenp = ciptr->addrlen;
if ((*addrp = (Xtransaddr *) xalloc (ciptr->addrlen)) == NULL)
if ((*addrp = (Xtransaddr *) malloc (ciptr->addrlen)) == NULL)
{
PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0);
return -1;
......@@ -986,7 +986,7 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
*familyp = ciptr->family;
*addrlenp = ciptr->peeraddrlen;
if ((*addrp = (Xtransaddr *) xalloc (ciptr->peeraddrlen)) == NULL)
if ((*addrp = (Xtransaddr *) malloc (ciptr->peeraddrlen)) == NULL)
{
PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0);
return -1;
......@@ -1141,7 +1141,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
if (*count_ret > 0)
{
if ((*ciptrs_ret = (XtransConnInfo *) xalloc (
if ((*ciptrs_ret = (XtransConnInfo *) malloc (
*count_ret * sizeof (XtransConnInfo))) == NULL)
{
return -1;
......@@ -1239,7 +1239,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
if (*count_ret > 0)
{
if ((*ciptrs_ret = (XtransConnInfo *) xalloc (
if ((*ciptrs_ret = (XtransConnInfo *) malloc (
*count_ret * sizeof (XtransConnInfo))) == NULL)
{
return -1;
......
......@@ -121,7 +121,7 @@ TRANS(DNETGetAddr) (XtransConnInfo ciptr)
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "DNETGetAddr: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -161,7 +161,7 @@ TRANS(DNETGetPeerAddr) (XtransConnInfo ciptr)
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1,
"DNETGetPeerAddr: Can't allocate space for the addr\n",
......
......@@ -144,7 +144,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
ciptr->family = AF_UNIX;
ciptr->addrlen = sizeof (struct sockaddr_un);
if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL)
if ((sunaddr = (struct sockaddr_un *) malloc (ciptr->addrlen)) == NULL)
{
PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0);
return 0;
......@@ -165,7 +165,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
ciptr->peeraddrlen = sizeof (struct sockaddr_un);
if ((p_sunaddr = (struct sockaddr_un *) xalloc (
if ((p_sunaddr = (struct sockaddr_un *) malloc (
ciptr->peeraddrlen)) == NULL)
{
PRMSG(1,
......@@ -596,7 +596,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
0,0,0);
close(newfd);
......@@ -607,7 +607,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
newciptr->peeraddrlen=sizeof(struct sockaddr_un);
if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) {
if( (sunaddr=(struct sockaddr_un *)malloc(newciptr->peeraddrlen)) == NULL ) {
PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
0,0,0);
free(newciptr->addr);
......@@ -818,7 +818,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
PRMSG(1,
"NAMEDAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -830,7 +830,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
PRMSG(1,
"NAMEDAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -1162,7 +1162,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
PRMSG(1,
"ISCAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -1174,7 +1174,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen);
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
PRMSG(1,
"ISCAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -1436,7 +1436,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
PRMSG(1,
"SCOAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -1451,7 +1451,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#endif
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
PRMSG(1,
"SCOAccept: failed to allocate memory for peer addr\n",
0,0,0);
......@@ -1894,7 +1894,7 @@ TRANS(LocalInitTransports)(char *protocol)
if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
{
workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (protocol) + 1);
workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (protocol) + 1);
if (workingXLOCAL)
strcpy (workingXLOCAL, protocol);
}
......@@ -1902,7 +1902,7 @@ TRANS(LocalInitTransports)(char *protocol)
XLOCAL=(char *)getenv("XLOCAL");
if(XLOCAL==NULL)
XLOCAL=DEF_XLOCAL;
workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1);
workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (XLOCAL) + 1);
if (workingXLOCAL)
strcpy (workingXLOCAL, XLOCAL);
}
......
......@@ -202,7 +202,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
}
namelen=sizeof(struct sockaddr);
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -214,7 +214,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX;
strcpy(((struct sockaddr *)ciptr->addr)->sa_data, "local");
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -316,7 +316,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
/*** Put in info ***/
namelen=sizeof(struct sockaddr);
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -328,7 +328,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX;
strcpy (((struct sockaddr *)ciptr->addr)->sa_data, "local");
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -441,7 +441,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
strcpy(addr_name,"local");
namelen=sizeof(addr_name);
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -451,7 +451,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
ciptr->addrlen = namelen;
memcpy (ciptr->addr, addr_name, ciptr->addrlen);
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -605,7 +605,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
/* And finally fill-in info in newciptr */
namelen=sizeof(struct sockaddr);
if ((newciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((newciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
0, 0, 0);
......@@ -618,7 +618,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
((struct sockaddr *)newciptr->addr)->sa_family = AF_UNIX;
strcpy (((struct sockaddr *)newciptr->addr)->sa_data, "local");
if ((newciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((newciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
0, 0, 0);
......
......@@ -957,7 +957,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1,
"SocketINETGetAddr: Can't allocate space for the addr\n",
......@@ -1032,7 +1032,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
* Everything looks good: fill in the XtransConnInfo structure.
*/
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1,
"SocketINETGetPeerAddr: Can't allocate space for the addr\n",
......@@ -1834,7 +1834,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
namelen = sizeof (sockname); /* this will always make it the same size */
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
PRMSG (1,
"SocketUNIXCreateListener: Can't allocate space for the addr\n",
......@@ -2058,7 +2058,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
* since this is unix domain.
*/
if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL)
if ((newciptr->addr = (char *) malloc (ciptr->addrlen)) == NULL)
{
PRMSG (1,
"SocketUNIXAccept: Can't allocate space for the addr\n",
......@@ -2078,7 +2078,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
newciptr->addrlen = ciptr->addrlen;
memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen);
if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL)
if ((newciptr->peeraddr = (char *) malloc (ciptr->addrlen)) == NULL)
{
PRMSG (1,
"SocketUNIXAccept: Can't allocate space for the addr\n",
......@@ -2827,8 +2827,8 @@ SocketUNIXConnectPost:
* since this is unix domain.
*/
if ((ciptr->addr = (char *) xalloc(namelen)) == NULL ||
(ciptr->peeraddr = (char *) xalloc(namelen)) == NULL)
if ((ciptr->addr = (char *) malloc(namelen)) == NULL ||
(ciptr->peeraddr = (char *) malloc(namelen)) == NULL)
{
PRMSG (1,
"SocketUNIXCreateListener: Can't allocate space for the addr\n",
......
......@@ -173,7 +173,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
if( ciptr->addr )
free(ciptr->addr);
if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
if( (ciptr->addr=(char *)malloc(netbuf.len)) == NULL )
{
PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n",
0,0,0);
......@@ -223,7 +223,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
if( ciptr->peeraddr )
free(ciptr->peeraddr);
if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
if( (ciptr->peeraddr=(char *)malloc(netbuf.len)) == NULL )
{
PRMSG(1,
"TLIGetPeerAddr: Can't allocate space for the addr\n",
......@@ -730,7 +730,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
* Everything looks good: fill in the XtransConnInfo structure.
*/
if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL )
if( (ciptr->addr=(char *)malloc(ret->addr.len)) == NULL )
{
PRMSG(1,
"TLICreateListener: Unable to allocate space for the address\n",
......
......@@ -215,7 +215,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
*addrp = NULL;
}
if (!*addrp)
*addrp = (Xtransaddr *) xalloc (len + 1);
*addrp = (Xtransaddr *) malloc (len + 1);
if (*addrp) {
strcpy ((char *) *addrp, hostnamebuf);
*addrlenp = len;
......@@ -262,7 +262,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
case AF_UNIX:
{
struct sockaddr_un *saddr = (struct sockaddr_un *) addr;
networkId = (char *) xalloc (3 + strlen (transName) +
networkId = (char *) malloc (3 + strlen (transName) +
strlen (hostnamebuf) + strlen (saddr->sun_path));
sprintf (networkId, "%s/%s:%s", transName,
hostnamebuf, saddr->sun_path);
......@@ -292,7 +292,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
portnum = ntohs (saddr->sin_port);
sprintf (portnumbuf, "%d", portnum);
networkId = (char *) xalloc (3 + strlen (transName) +
networkId = (char *) malloc (3 + strlen (transName) +
strlen (hostnamebuf) + strlen (portnumbuf));
sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf);
break;
......@@ -304,7 +304,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
{
struct sockaddr_dn *saddr = (struct sockaddr_dn *) addr;
networkId = (char *) xalloc (
networkId = (char *) malloc (
13 + strlen (hostnamebuf) + saddr->sdn_objnamel);
sprintf (networkId, "dnet/%s::%s",
hostnamebuf, saddr->sdn_objname);
......@@ -453,7 +453,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
}
hostname = (char *) xalloc (
hostname = (char *) malloc (
strlen (ciptr->transptr->TransName) + strlen (addr) + 2);
strcpy (hostname, ciptr->transptr->TransName);
strcat (hostname, "/");
......
......@@ -59,7 +59,6 @@ from The Open Group.
#include "os.h"
#else
#include <stdlib.h>
#define xalloc(_size) malloc(_size)
#define xcalloc(_num,_size) calloc(_num,_size)
#define xrealloc(_ptr,_size) realloc(_ptr,_size)
#endif
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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");
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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))
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
......@@ -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,
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -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 */
}
......
......@@ -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;
......
......@@ -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]);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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");
}
......
......@@ -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)
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......@@ -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,
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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];
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -363,7 +363,7 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
fbOverlayGeneration = serverGeneration;
}
pScrPriv = xalloc (sizeof (FbOverlayScrPrivRec));
pScrPriv = malloc (sizeof (FbOverlayScrPrivRec));
if (!pScrPriv)
return FALSE;
......
......@@ -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;
......
......@@ -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));
......
......@@ -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)
{
......
......@@ -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)
{
......
......@@ -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,
......
......@@ -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));
......
......@@ -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++)
{
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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 */
......
......@@ -87,7 +87,7 @@ miGlyphs (CARD8 op,
}
else
{
nxagentGlyphsExtents = (BoxPtr) xalloc(sizeof(BoxRec));
nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec));
miGlyphExtents (nlist, list, glyphs, &extents);
......
......@@ -80,7 +80,7 @@ miTrapezoids (CARD8 op,
}
else
{
nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec));
nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec));
miTrapezoidBounds (ntrap, traps, &bounds);
......
......@@ -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)
{
......
......@@ -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,
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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");
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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++)
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment