Commit acf87144 authored by Mike Gabriel's avatar Mike Gabriel

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

Fixes ArcticaProject/nx-libs#105
parent 279d3712
......@@ -36,9 +36,6 @@ in this Software without prior written authorization from The Open Group.
#ifndef xmalloc
#define xmalloc malloc
#endif
#ifndef xfree
#define xfree free
#endif
#ifdef CTHREADS
#include <cthreads.h>
......@@ -285,13 +282,13 @@ typedef xmutex_rec *xmutex_t;
#define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec))
#endif
#ifndef xcondition_free
#define xcondition_free(c) xfree((char *)c)
#define xcondition_free(c) free((char *)c)
#endif
#ifndef xmutex_malloc
#define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec))
#endif
#ifndef xmutex_free
#define xmutex_free(m) xfree((char *)m)
#define xmutex_free(m) free((char *)m)
#endif
#ifndef xthread_have_id
#define xthread_have_id(id) id
......
......@@ -145,15 +145,15 @@ TRANS(FreeConnInfo) (XtransConnInfo ciptr)
PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0);
if (ciptr->addr)
xfree (ciptr->addr);
free (ciptr->addr);
if (ciptr->peeraddr)
xfree (ciptr->peeraddr);
free (ciptr->peeraddr);
if (ciptr->port)
xfree (ciptr->port);
free (ciptr->port);
xfree ((char *) ciptr);
free ((char *) ciptr);
}
......@@ -238,7 +238,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
*protocol = NULL;
*host = NULL;
*port = NULL;
xfree (tmpptr);
free (tmpptr);
return 0;
}
......@@ -288,7 +288,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
*protocol = NULL;
*host = NULL;
*port = NULL;
xfree (tmpptr);
free (tmpptr);
return 0;
}
......@@ -368,7 +368,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
*port = NULL;
*host = NULL;
*protocol = NULL;
xfree (tmpptr);
free (tmpptr);
return 0;
}
else
......@@ -379,9 +379,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
/* Malloc failed */
*port = NULL;
*host = NULL;
xfree (*protocol);
free (*protocol);
*protocol = NULL;
xfree (tmpptr);
free (tmpptr);
return 0;
}
else
......@@ -391,17 +391,17 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
{
/* Malloc failed */
*port = NULL;
xfree (*host);
free (*host);
*host = NULL;
xfree (*protocol);
free (*protocol);
*protocol = NULL;
xfree (tmpptr);
free (tmpptr);
return 0;
}
else
strcpy (*port, _port);
xfree (tmpptr);
free (tmpptr);
return 1;
}
......@@ -446,9 +446,9 @@ TRANS(Open) (int type, char *address)
PRMSG (1,"Open: Unable to find transport for %s\n",
protocol, 0, 0);
xfree (protocol);
xfree (host);
xfree (port);
free (protocol);
free (host);
free (port);
return NULL;
}
......@@ -487,17 +487,17 @@ TRANS(Open) (int type, char *address)
PRMSG (1,"Open: transport open failed for %s/%s:%s\n",
protocol, host, port);
}
xfree (protocol);
xfree (host);
xfree (port);
free (protocol);
free (host);
free (port);
return NULL;
}
ciptr->transptr = thistrans;
ciptr->port = port; /* We need this for TRANS(Reopen) */
xfree (protocol);
xfree (host);
free (protocol);
free (host);
return ciptr;
}
......@@ -859,16 +859,16 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
{
PRMSG (1,"Connect: Missing port specification in %s\n",
address, 0, 0);
if (protocol) xfree (protocol);
if (host) xfree (host);
if (protocol) free (protocol);
if (host) free (host);
return -1;
}
ret = ciptr->transptr->Connect (ciptr, host, port);
if (protocol) xfree (protocol);
if (host) xfree (host);
if (port) xfree (port);
if (protocol) free (protocol);
if (host) free (host);
if (port) free (port);
return ret;
}
......
......@@ -224,7 +224,7 @@ TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol,
if ((ciptr->fd = socket (AF_DECnet, SOCK_STREAM, 0)) < 0)
{
xfree ((char *) ciptr);
free ((char *) ciptr);
return NULL;
}
......@@ -406,7 +406,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status)
{
PRMSG (1, "DNETAccept: accept() failed\n", 0, 0, 0);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
}
......@@ -421,7 +421,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status)
PRMSG(1,
"DNETAccept: ...DNETGetAddr() failed:\n", 0, 0, 0);
close (newciptr->fd);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -432,8 +432,8 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status)
"DNETAccept: ...DNETGetPeerAddr() failed:\n", 0, 0, 0);
close (newciptr->fd);
if (newciptr->addr) xfree (newciptr->addr);
xfree (newciptr);
if (newciptr->addr) free (newciptr->addr);
free (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......
......@@ -171,7 +171,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
PRMSG(1,
"FillAddrInfo: failed to allocate memory for peer addr\n",
0,0,0);
xfree ((char *) sunaddr);
free ((char *) sunaddr);
ciptr->addr = NULL;
return 0;
......@@ -610,7 +610,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) {
PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
0,0,0);
xfree(newciptr->addr);
free(newciptr->addr);
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
......@@ -834,7 +834,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
PRMSG(1,
"NAMEDAccept: failed to allocate memory for peer addr\n",
0,0,0);
xfree(newciptr->addr);
free(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
......@@ -1178,7 +1178,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
PRMSG(1,
"ISCAccept: failed to allocate memory for peer addr\n",
0,0,0);
xfree(newciptr->addr);
free(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
......@@ -1455,7 +1455,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
PRMSG(1,
"SCOAccept: failed to allocate memory for peer addr\n",
0,0,0);
xfree(newciptr->addr);
free(newciptr->addr);
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
......@@ -1913,7 +1913,7 @@ TRANS(LocalEndTransports)(void)
{
PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
xfree(freeXLOCAL);
free(freeXLOCAL);
}
#define TYPEBUFSIZE 32
......@@ -2080,7 +2080,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if( ciptr->fd < 0 )
{
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -2150,7 +2150,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
}
}
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -2197,7 +2197,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
return ciptr;
}
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -2396,7 +2396,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
if( newciptr->fd < 0 )
{
xfree(newciptr);
free(newciptr);
return NULL;
}
......
......@@ -111,7 +111,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
0,0,0 );
PRMSG(1,"\tor the DISPLAY variable is set incorrectly.\n",
0,0,0 );
xfree(ciptr);
free(ciptr);
return NULL;
}
try ++;
......@@ -133,7 +133,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
pipe_len=0;
DosWrite(hServer,&pipe_len,1,&byteWritten);
DosClose(hServer);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -145,7 +145,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG(1, "Os2OpenClient: Unable to connect to pipe %s\n", pipename,0,0 );
DosClose (hfd);
DosClose(hServer);
xfree(ciptr);
free(ciptr);
return (NULL);
}
......@@ -158,7 +158,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
hServer,rc,byteWritten );
DosClose(hServer);
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -182,7 +182,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG(1, "\tor the XServer is too busy to respond.\n",0,0,0 );
DosClose(hServer);
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -197,7 +197,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG(1, "Os2OpenClient: Client pipe does not appear connected. rc=%d, h=%d\n",rc,hfd,0 );
PRMSG(1, "\tProbable cause: the XServer has just exited.\n",0,0,0 );
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -207,7 +207,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
ciptr->addrlen = namelen;
......@@ -219,8 +219,8 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hfd);
xfree(ciptr->addr);
xfree(ciptr);
free(ciptr->addr);
free(ciptr);
return(NULL);
}
ciptr->peeraddrlen = namelen;
......@@ -237,9 +237,9 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol,
PRMSG(1, "Os2OpenClient: Could not import the pipe handle into EMX\n",0,0,0 );
PRMSG(1, "\tProbable cause: EMX has run out of free file handles.\n",0,0,0 );
DosClose(hfd);
xfree(ciptr->addr);
xfree(ciptr->peeraddr);
xfree(ciptr);
free(ciptr->addr);
free(ciptr->peeraddr);
free(ciptr);
return(NULL);
}
PRMSG(5, "Os2OpenClient: pipe handle %d EMX handle %d\n",ciptr->index,ciptr->fd,0 );
......@@ -296,7 +296,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
PRMSG(1, "Os2OpenServer: Unable to create pipe %s, rc=%d\n", pipename,rc,0 );
PRMSG(1, "\tProbable cause: there is already another XServer running on display :%s\n",port,0,0 );
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -307,7 +307,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
{
PRMSG(1, "Os2OpenServer: Unable to connect to pipe %s\n", pipename,0,0 );
DosClose (hfd);
xfree(ciptr);
free(ciptr);
return (NULL);
}
......@@ -321,7 +321,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hfd);
xfree(ciptr);
free(ciptr);
return(NULL);
}
ciptr->addrlen = namelen;
......@@ -333,8 +333,8 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hfd);
xfree(ciptr->addr);
xfree(ciptr);
free(ciptr->addr);
free(ciptr);
return(NULL);
}
......@@ -351,9 +351,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
if((ciptr->fd=_imphandle(hfd))<0){
DosClose(hfd);
xfree(ciptr->addr);
xfree(ciptr->peeraddr);
xfree(ciptr);
free(ciptr->addr);
free(ciptr->peeraddr);
free(ciptr);
return(NULL);
}
PRMSG(5, "Os2OpenServer: Pipe handle %d EMX handle %d",ciptr->index,ciptr->fd,0 );
......@@ -365,9 +365,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol,
PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n",
hPipeSem,ciptr->fd,rc);
DosClose(ciptr->fd);
xfree(ciptr->addr);
xfree(ciptr->peeraddr);
xfree(ciptr);
free(ciptr->addr);
free(ciptr->peeraddr);
free(ciptr);
return(NULL);
}
#endif
......@@ -445,7 +445,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
{
PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
0, 0, 0);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -455,7 +455,7 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
{
PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n",
0, 0, 0);
xfree(ciptr);
free(ciptr);
return(NULL);
}
......@@ -521,7 +521,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n",
in,errno,0 );
*status = TRANS_ACCEPT_MISC_ERROR;
xfree(newciptr);
free(newciptr);
rc = DosDisConnectNPipe(ciptr->fd);
rc = DosConnectNPipe (ciptr->fd);
if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
......@@ -540,7 +540,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n",
in,errno,0 );
*status = TRANS_ACCEPT_MISC_ERROR;
xfree(newciptr);
free(newciptr);
rc = DosDisConnectNPipe(ciptr->fd);
rc = DosConnectNPipe (ciptr->fd);
if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
......@@ -566,7 +566,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG(1,"Os2Accept: Open pipe %s to client failed, rc=%d\n",
clientname,rc,0 );
PRMSG(1, "\tProbable cause: the client has exited or timed-out.\n",0,0,0 );
xfree(newciptr);
free(newciptr);
rc = DosDisConnectNPipe(ciptr->fd);
rc = DosConnectNPipe (ciptr->fd);
if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
......@@ -581,7 +581,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
{
PRMSG(1,"Os2Accept: Could not set pipe %s to non-blocking mode, rc=%d\n",
hClient,rc,0 );
xfree(newciptr);
free(newciptr);
rc = DosDisConnectNPipe(ciptr->fd);
rc = DosConnectNPipe (ciptr->fd);
if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED)
......@@ -610,7 +610,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hClient);
xfree(newciptr);
free(newciptr);
return(NULL);
}
......@@ -623,8 +623,8 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG (1, "Os2Accept: Can't allocate space for the addr\n",
0, 0, 0);
DosClose(hClient);
xfree(ciptr->addr);
xfree(newciptr);
free(ciptr->addr);
free(newciptr);
return(NULL);
}
......@@ -643,9 +643,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
hClient,errno,0 );
PRMSG(1, "\tProbable cause: EMX has run out of file handles.\n",0,0,0 );
DosClose(hClient);
xfree(newciptr->addr);
xfree(newciptr->peeraddr);
xfree(newciptr);
free(newciptr->addr);
free(newciptr->peeraddr);
free(newciptr);
return(NULL);
}
PRMSG(5, "Os2Accept: Pipe handle %d EMX handle %d",newciptr->index,newciptr->fd,0 );
......@@ -657,9 +657,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status)
PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n",
hPipeSem,newciptr->fd,rc);
DosClose(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr->peeraddr);
xfree(newciptr);
free(newciptr->addr);
free(newciptr->peeraddr);
free(newciptr);
return(NULL);
}
#endif
......
......@@ -619,7 +619,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0)
{
PRMSG (1, "SocketCreateConnInfo: socketpair() failed.\n", 0, 0, 0);
xfree ((char *) ciptr);
free ((char *) ciptr);
return NULL;
}
......@@ -643,7 +643,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
{
PRMSG (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n",
ciptr->fd, 0, 0);
xfree ((char *) ciptr);
free ((char *) ciptr);
return NULL;
}
else if (_NXProxyConnInfoTab[ciptr->fd] != NULL)
......@@ -658,7 +658,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if (_NXProxyConnInfoTab[ciptr->fd] == NULL)
{
PRMSG (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n", 0, 0, 0);
xfree ((char *) ciptr);
free ((char *) ciptr);
return NULL;
}
......@@ -812,7 +812,7 @@ static void TRANS(SocketCloseConnInfo) (XtransConnInfo ciptr)
ciptr->fd);
#endif
xfree((char *) _NXProxyConnInfoTab[ciptr->fd]);
free((char *) _NXProxyConnInfoTab[ciptr->fd]);
_NXProxyConnInfoTab[ciptr->fd] = NULL;
......@@ -1084,7 +1084,7 @@ TRANS(SocketOpen) (int i, int type)
PRMSG (2, "SocketOpen: socket() failed for %s\n",
Sockettrans2devtab[i].transname, 0, 0);
xfree ((char *) ciptr);
free ((char *) ciptr);
return NULL;
}
......@@ -1968,7 +1968,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
errno = WSAGetLastError();
#endif
PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
}
......@@ -1996,7 +1996,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
"SocketINETAccept: ...SocketINETGetAddr() failed:\n",
0, 0, 0);
close (newciptr->fd);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -2007,8 +2007,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
"SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n",
0, 0, 0);
close (newciptr->fd);
if (newciptr->addr) xfree (newciptr->addr);
xfree (newciptr);
if (newciptr->addr) free (newciptr->addr);
free (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -2048,7 +2048,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
(struct sockaddr *) &sockname, (void *)&namelen)) < 0)
{
PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
}
......@@ -2064,7 +2064,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
"SocketUNIXAccept: Can't allocate space for the addr\n",
0, 0, 0);
close (newciptr->fd);
xfree (newciptr);
free (newciptr);
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
......@@ -2084,8 +2084,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
"SocketUNIXAccept: Can't allocate space for the addr\n",
0, 0, 0);
close (newciptr->fd);
if (newciptr->addr) xfree (newciptr->addr);
xfree (newciptr);
if (newciptr->addr) free (newciptr->addr);
free (newciptr);
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
......@@ -2263,7 +2263,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
" socketfor IPv4 address\n", 0,0,0);
}
if (newciptr)
xfree(newciptr);
free(newciptr);
} else {
socketaddr = NULL;
PRMSG (4,"SocketINETConnect Skipping IPv4 address\n",
......@@ -2301,7 +2301,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
"socket for IPv6 address\n", 0,0,0);
}
if (newciptr)
xfree(newciptr);
free(newciptr);
}
else
{
......
......@@ -171,7 +171,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
*/
if( ciptr->addr )
xfree(ciptr->addr);
free(ciptr->addr);
if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
{
......@@ -221,7 +221,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
*/
if( ciptr->peeraddr )
xfree(ciptr->peeraddr);
free(ciptr->peeraddr);
if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
{
......@@ -457,7 +457,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
"TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n",
errno, 0,0 );
t_close(ciptr->fd);
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -467,7 +467,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
"TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n",
errno, 0,0 );
t_close(ciptr->fd);
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -557,7 +557,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
"TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n",
errno, 0,0 );
t_close(ciptr->fd);
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -567,7 +567,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
"TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n",
errno, 0,0 );
t_close(ciptr->fd);
xfree(ciptr);
free(ciptr);
return NULL;
}
......@@ -917,7 +917,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
errno, 0,0 );
t_free((char *)call,T_CALL);
t_close(newciptr->fd);
xfree(newciptr);
free(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -961,7 +961,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
errno, 0,0 );
t_close(newciptr->fd);
xfree(newciptr);
free(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -972,8 +972,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
errno, 0,0 );
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
free(newciptr->addr);
free(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -983,8 +983,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
errno,0,0 );
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
free(newciptr->addr);
free(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......@@ -994,8 +994,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
errno,0,0 );
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
free(newciptr->addr);
free(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
......
......@@ -211,7 +211,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
if (len > 0) {
if (*addrp && *addrlenp < (len + 1))
{
xfree ((char *) *addrp);
free ((char *) *addrp);
*addrp = NULL;
}
if (!*addrp)
......@@ -226,7 +226,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
else
{
if (*addrp)
xfree ((char *) *addrp);
free ((char *) *addrp);
*addrp = NULL;
*addrlenp = 0;
}
......
......@@ -62,7 +62,6 @@ from The Open Group.
#define xalloc(_size) malloc(_size)
#define xcalloc(_num,_size) calloc(_num,_size)
#define xrealloc(_ptr,_size) realloc(_ptr,_size)
#define xfree(_ptr) free(_ptr)
#endif
#include "Xtransint.h"
......
......@@ -81,7 +81,7 @@ void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
void __glXImpFree(__GLcontext *gc, void *addr)
{
if (addr) {
xfree(addr);
free(addr);
}
}
......@@ -91,7 +91,7 @@ void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
if (addr) {
if (newSize == 0) {
xfree(addr);
free(addr);
return NULL;
}
newAddr = xrealloc(addr, newSize);
......
......@@ -366,9 +366,9 @@ void __glXScreenReset(void)
__glXFree(__glXActiveScreens[i].GLXextensions);
__glXFree(__glXActiveScreens[i].GLextensions);
}
xfree(__glXActiveScreens);
xfree(__glXHyperpipeFuncs);
xfree(__glXSwapBarrierFuncs);
free(__glXActiveScreens);
free(__glXHyperpipeFuncs);
free(__glXSwapBarrierFuncs);
__glXNumHyperpipeFuncs = 0;
__glXNumSwapBarrierFuncs = 0;
__glXHyperpipeFuncs = NULL;
......
......@@ -102,7 +102,7 @@ __glXRealloc(void *addr, size_t newSize)
if (addr) {
if (newSize == 0) {
xfree(addr);
free(addr);
return NULL;
} else {
newAddr = xrealloc(addr, newSize);
......@@ -125,7 +125,7 @@ void
__glXFree(void *addr)
{
if (addr) {
xfree(addr);
free(addr);
}
}
......
......@@ -516,7 +516,7 @@ static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
/* Free the private list created by DDX HW driver */
if (visualPrivates)
xfree(visualPrivates);
free(visualPrivates);
visualPrivates = NULL;
return TRUE;
......
......@@ -70,7 +70,7 @@ void XMesaDestroyImage(XMesaImage *image)
{
if (image->data)
free(image->data);
xfree(image);
free(image);
}
unsigned long XMesaGetPixel(XMesaImage *image, int x, int y)
......
......@@ -167,7 +167,7 @@ extmodSetup(void * module, void * opts, int *errmaj, int *errmin)
strcpy(s, "omit");
strcat(s, extensionModules[i].name);
o = xf86FindOption(opts, s);
xfree(s);
free(s);
if (o) {
xf86MarkOptionUsed(o);
continue;
......
......@@ -165,7 +165,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
if (pScreen->myNum == 0)
RegionUninit(&PanoramiXScreenRegion);
xfree ((void *) pScreenPriv);
free ((void *) pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
......@@ -337,7 +337,7 @@ XineramaDestroyClip(GCPtr pGC)
int
XineramaDeleteResource(void * data, XID id)
{
xfree(data);
free(data);
return 1;
}
......@@ -727,10 +727,10 @@ Bool PanoramiXCreateConnectionBlock(void)
connSetupPrefix.length = length >> 2;
xfree(PanoramiXVisuals);
free(PanoramiXVisuals);
for (i = 0; i < PanoramiXNumDepths; i++)
xfree(PanoramiXDepths[i].vids);
xfree(PanoramiXDepths);
free(PanoramiXDepths[i].vids);
free(PanoramiXDepths);
/*
* OK, change some dimensions so it looks as if it were one big screen
......@@ -752,7 +752,7 @@ Bool PanoramiXCreateConnectionBlock(void)
tmp = (void *)ConnectionCallbackList;
(*ConnectionCallbackList->func)();
ConnectionCallbackList = ConnectionCallbackList->next;
xfree(tmp);
free(tmp);
}
return TRUE;
......@@ -927,7 +927,7 @@ static void PanoramiXResetProc(ExtensionEntry* extEntry)
for (i = 256; i--; )
ProcVector[i] = SavedProcVector[i];
Xfree(panoramiXdataPtr);
free(panoramiXdataPtr);
}
......@@ -1292,7 +1292,7 @@ XineramaGetImageData(
}
if(ScratchMem)
xfree(ScratchMem);
free(ScratchMem);
RegionUninit(&SrcRegion);
RegionUninit(&GrabRegion);
......
......@@ -170,7 +170,7 @@ int PanoramiXCreateWindow(ClientPtr client)
if (result == Success)
AddResource(newWin->info[0].id, XRT_WINDOW, newWin);
else
xfree(newWin);
free(newWin);
return (result);
}
......@@ -679,7 +679,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
if (result == Success)
AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
else
xfree(newPix);
free(newPix);
return (result);
}
......@@ -784,7 +784,7 @@ int PanoramiXCreateGC(ClientPtr client)
if (result == Success)
AddResource(newGC->info[0].id, XRT_GC, newGC);
else
xfree(newGC);
free(newGC);
return (result);
}
......@@ -1049,7 +1049,7 @@ int PanoramiXCopyArea(ClientPtr client)
if(drawables[0]->depth != pDst->depth) {
client->errorValue = stuff->dstDrawable;
xfree(data);
free(data);
return (BadMatch);
}
......@@ -1060,7 +1060,7 @@ int PanoramiXCopyArea(ClientPtr client)
if(dstShared) break;
}
xfree(data);
free(data);
result = Success;
} else {
......@@ -1890,7 +1890,7 @@ int PanoramiXGetImage(ClientPtr client)
}
}
}
xfree(pBuf);
free(pBuf);
return (client->noClientException);
}
......@@ -2092,7 +2092,7 @@ int PanoramiXCreateColormap(ClientPtr client)
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
else
xfree(newCmap);
free(newCmap);
return (result);
}
......@@ -2159,7 +2159,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
else
xfree(newCmap);
free(newCmap);
return (result);
}
......
......@@ -274,7 +274,7 @@ CheckScreenPrivate (pScreen)
if (!pPriv->attr && !pPriv->events &&
!pPriv->hasWindow && pPriv->installedMap == None)
{
xfree (pPriv);
free (pPriv);
SetScreenPrivate (pScreen, NULL);
savedScreenInfo[pScreen->myNum].ExternalScreenSaver = NULL;
}
......@@ -340,7 +340,7 @@ setEventMask (pScreen, client, mask)
{
FreeResource (pEv->resource, EventType);
*pPrev = pEv->next;
xfree (pEv);
free (pEv);
CheckScreenPrivate (pScreen);
}
else
......@@ -386,8 +386,8 @@ FreeScreenAttr (pAttr)
ScreenSaverAttrPtr pAttr;
{
FreeAttrs (pAttr);
xfree (pAttr->values);
xfree (pAttr);
free (pAttr->values);
free (pAttr);
}
static int
......@@ -408,7 +408,7 @@ ScreenSaverFreeEvents (value, id)
if (!pEv)
return TRUE;
*pPrev = pEv->next;
xfree (pEv);
free (pEv);
CheckScreenPrivate (pScreen);
return TRUE;
}
......@@ -1172,8 +1172,8 @@ PatchUp:
FreeAttrs (pAttr);
bail:
CheckScreenPrivate (pScreen);
if (pAttr) xfree (pAttr->values);
xfree (pAttr);
if (pAttr) free (pAttr->values);
free (pAttr);
return ret;
}
......
......@@ -331,7 +331,7 @@ SecurityDeleteAuthorization(
}
SecurityAudit("revoked authorization ID %d\n", pAuth->id);
xfree(pAuth);
free(pAuth);
return Success;
} /* SecurityDeleteAuthorization */
......@@ -356,7 +356,7 @@ SecurityDeleteAuthorizationEventClient(
prev->next = pEventClient->next;
else
pAuth->eventClients = pEventClient->next;
xfree(pEventClient);
free(pEventClient);
return(Success);
}
prev = pEventClient;
......@@ -533,7 +533,7 @@ SecurityEventSelectForAuthorization(
if (!AddResource(pEventClient->resource, RTEventClient,
(void *)pAuth))
{
xfree(pEventClient);
free(pEventClient);
return BadAlloc;
}
pAuth->eventClients = pEventClient;
......@@ -734,7 +734,7 @@ bailout:
if (removeAuth)
RemoveAuthorization(stuff->nbytesAuthProto, protoname,
authdata_len, pAuthdata);
if (pAuth) xfree(pAuth);
if (pAuth) free(pAuth);
return err;
} /* ProcSecurityGenerateAuthorization */
......@@ -1486,7 +1486,7 @@ SecurityFreePropertyAccessList(void)
{
PropertyAccessPtr freeit = PropertyAccessList;
PropertyAccessList = PropertyAccessList->next;
xfree(freeit);
free(freeit);
}
} /* SecurityFreePropertyAccessList */
......@@ -1650,7 +1650,7 @@ SecurityParsePropertyAccessRule(
pacl->name = MakeAtom(propname, strlen(propname), TRUE);
if (pacl->name == BAD_RESOURCE)
{
Xfree(pacl);
free(pacl);
return FALSE;
}
if (mustHaveProperty)
......@@ -1659,7 +1659,7 @@ SecurityParsePropertyAccessRule(
strlen(mustHaveProperty), TRUE);
if (pacl->mustHaveProperty == BAD_RESOURCE)
{
Xfree(pacl);
free(pacl);
return FALSE;
}
}
......@@ -1724,7 +1724,7 @@ SecurityParseSitePolicy(
sizeof (char *) * (nSecurityPolicyStrings + 1));
if (!newStrings)
{
Xfree(copyPolicyStr);
free(copyPolicyStr);
return TRUE;
}
......@@ -1752,9 +1752,9 @@ SecurityFreeSitePolicyStrings(void)
assert(nSecurityPolicyStrings);
while (nSecurityPolicyStrings--)
{
Xfree(SecurityPolicyStrings[nSecurityPolicyStrings]);
free(SecurityPolicyStrings[nSecurityPolicyStrings]);
}
Xfree(SecurityPolicyStrings);
free(SecurityPolicyStrings);
SecurityPolicyStrings = NULL;
nSecurityPolicyStrings = 0;
}
......
......@@ -796,7 +796,7 @@ ShapeFreeClient (data, id)
*pHead = pShapeEvent->next;
}
}
xfree ((void *) pShapeEvent);
free ((void *) pShapeEvent);
return 1;
}
......@@ -812,9 +812,9 @@ ShapeFreeEvents (data, id)
for (pCur = *pHead; pCur; pCur = pNext) {
pNext = pCur->next;
FreeResource (pCur->clientResource, ClientType);
xfree ((void *) pCur);
free ((void *) pCur);
}
xfree ((void *) pHead);
free ((void *) pHead);
return 1;
}
......@@ -898,7 +898,7 @@ ProcShapeSelectInput (client)
pNewShapeEvent->next = pShapeEvent->next;
else
*pHead = pShapeEvent->next;
xfree (pShapeEvent);
free (pShapeEvent);
}
}
break;
......
......@@ -447,7 +447,7 @@ ProcShmAttach(client)
if ((shmdesc->addr == ((char *)-1)) ||
shmctl(stuff->shmid, IPC_STAT, &buf))
{
xfree(shmdesc);
free(shmdesc);
return BadAccess;
}
......@@ -457,7 +457,7 @@ ProcShmAttach(client)
if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) {
shmdt(shmdesc->addr);
xfree(shmdesc);
free(shmdesc);
return BadAccess;
}
......@@ -488,7 +488,7 @@ ShmDetachSegment(value, shmseg)
for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next)
;
*prev = shmdesc->next;
xfree(shmdesc);
free(shmdesc);
return Success;
}
......@@ -820,7 +820,7 @@ CreatePmap:
(*pScreen->DestroyPixmap)(pMap);
FreeResource(newPix->info[j].id, RT_NONE);
}
xfree(newPix);
free(newPix);
} else
AddResource(stuff->pid, XRT_PIXMAP, newPix);
......
......@@ -111,7 +111,7 @@ ClientSleepUntil (client, revive, notifyFunc, closure)
SertafiedWakeupHandler,
(void *) 0))
{
xfree (pRequest);
free (pRequest);
return FALSE;
}
BlockHandlerRegistered = TRUE;
......@@ -169,7 +169,7 @@ SertafiedDelete (value, id)
}
if (pRequest->notifyFunc)
(*pRequest->notifyFunc) (pRequest->pClient, pRequest->closure);
xfree (pRequest);
free (pRequest);
return TRUE;
}
......
......@@ -319,7 +319,7 @@ SyncDeleteTriggerFromCounter(pTrigger)
pPrev->next = pCur->next;
else
pTrigger->pCounter->pTriglist = pCur->next;
xfree(pCur);
free(pCur);
break;
}
}
......@@ -890,7 +890,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents)
pClients->delete_id = FakeClientID(client->index);
if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm))
{
xfree(pClients);
free(pClients);
return BadAlloc;
}
......@@ -1019,7 +1019,7 @@ SyncCreateCounter(client, id, initialvalue)
if (!AddResource(id, RTCounter, (void *) pCounter))
{
xfree((void *) pCounter);
free((void *) pCounter);
return (SyncCounter *)NULL;
}
......@@ -1214,7 +1214,7 @@ FreeAlarm(addr, id)
SyncDeleteTriggerFromCounter(&pAlarm->trigger);
xfree(pAlarm);
free(pAlarm);
return Success;
}
......@@ -1237,13 +1237,13 @@ FreeCounter(env, id)
{
(*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
pnext = ptl->next;
xfree(ptl); /* destroy the trigger list as we go */
free(ptl); /* destroy the trigger list as we go */
}
if (IsSystemCounter(pCounter))
{
int i, found = 0;
xfree(pCounter->pSysCounterInfo);
free(pCounter->pSysCounterInfo);
/* find the counter in the list of system counters and remove it */
......@@ -1267,7 +1267,7 @@ FreeCounter(env, id)
}
SyncNumSystemCounters--;
}
xfree(pCounter);
free(pCounter);
return Success;
}
......@@ -1298,7 +1298,7 @@ FreeAwait(addr, id)
if (pCounter && !pCounter->beingDestroyed)
SyncDeleteTriggerFromCounter(&pAwait->trigger);
}
xfree(pAwaitUnion);
free(pAwaitUnion);
return Success;
}
......@@ -1321,7 +1321,7 @@ FreeAlarmClient(value, id)
pPrev->next = pCur->next;
else
pAlarm->pEventClients = pCur->next;
xfree(pCur);
free(pCur);
return(Success);
}
}
......@@ -1679,7 +1679,7 @@ ProcSyncAwait(client)
pAwaitUnion->header.delete_id = FakeClientID(client->index);
if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion))
{
xfree(pAwaitUnion);
free(pAwaitUnion);
return BadAlloc;
}
......@@ -1838,7 +1838,7 @@ ProcSyncCreateAlarm(client)
status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger);
if (status != Success)
{
xfree(pAlarm);
free(pAlarm);
return status;
}
......@@ -1852,13 +1852,13 @@ ProcSyncCreateAlarm(client)
(CARD32 *)&stuff[1]);
if (status != Success)
{
xfree(pAlarm);
free(pAlarm);
return status;
}
if (!AddResource(stuff->id, RTAlarm, pAlarm))
{
xfree(pAlarm);
free(pAlarm);
return BadAlloc;
}
......@@ -2346,7 +2346,7 @@ static void
SyncResetProc(extEntry)
ExtensionEntry *extEntry;
{
xfree(SysCounterList);
free(SysCounterList);
SysCounterList = NULL;
RTCounter = 0;
}
......
......@@ -175,7 +175,7 @@ ProcXCMiscGetXIDList(client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
}
Xfree(pids);
free(pids);
return(client->noClientException);
}
......
......@@ -257,7 +257,7 @@ shmalloc(
if (shmid == -1) {
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, errno = %d\n",
size, errno);
xfree(pDesc);
free(pDesc);
return (ShmDescPtr) NULL;
}
......@@ -265,7 +265,7 @@ shmalloc(
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, errno = %d\n",
size, errno);
shmctl(shmid, IPC_RMID, (void *) 0);
xfree(pDesc);
free(pDesc);
return (ShmDescPtr) NULL;
}
......@@ -294,7 +294,7 @@ shmdealloc(
if (pDesc->next) pDesc->next->prev = pDesc->prev;
*pDesc->prev = pDesc->next;
xfree(pDesc);
free(pDesc);
}
#endif
......
......@@ -1281,7 +1281,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
SwapLongs((CARD32*)offsets, rep.length);
WriteToClient(client, rep.length << 2, (char*)offsets);
xfree(offsets);
free(offsets);
return Success;
}
......
......@@ -325,7 +325,7 @@ XvCloseScreen(
(* pxvs->ddCloseScreen)(ii, pScreen);
xfree(pxvs);
free(pxvs);
pScreen->devPrivates[XvScreenIndex].ptr = (void *)NULL;
......@@ -522,7 +522,7 @@ XvdiDestroyVideoNotifyList(void * pn, XID id)
{
npn = cpn->next;
if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify);
xfree(cpn);
free(cpn);
cpn = npn;
}
return Success;
......@@ -946,7 +946,7 @@ XvdiSelectVideoNotify(
tpn->next = (XvVideoNotifyPtr)NULL;
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
{
xfree(tpn);
free(tpn);
return BadAlloc;
}
}
......
......@@ -75,7 +75,7 @@ XvMCDestroyContextRes(void * data, XID id)
if(!pContext->refcnt) {
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroyContext)(pContext);
xfree(pContext);
free(pContext);
}
return Success;
......@@ -89,7 +89,7 @@ XvMCDestroySurfaceRes(void * data, XID id)
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySurface)(pSurface);
xfree(pSurface);
free(pSurface);
XvMCDestroyContextRes((void *)pContext, pContext->context_id);
......@@ -105,7 +105,7 @@ XvMCDestroySubpictureRes(void * data, XID id)
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
(*pScreenPriv->adaptors[pContext->adapt_num].DestroySubpicture)(pSubpict);
xfree(pSubpict);
free(pSubpict);
XvMCDestroyContextRes((void *)pContext, pContext->context_id);
......@@ -259,7 +259,7 @@ ProcXvMCCreateContext(ClientPtr client)
result = (*adaptor->CreateContext)(pPort, pContext, &dwords, &data);
if(result != Success) {
xfree(pContext);
free(pContext);
return result;
}
......@@ -276,7 +276,7 @@ ProcXvMCCreateContext(ClientPtr client)
AddResource(pContext->context_id, XvMCRTContext, pContext);
if(data)
xfree(data);
free(data);
return Success;
}
......@@ -324,7 +324,7 @@ ProcXvMCCreateSurface(ClientPtr client)
pSurface, &dwords, &data);
if(result != Success) {
xfree(pSurface);
free(pSurface);
return result;
}
......@@ -338,7 +338,7 @@ ProcXvMCCreateSurface(ClientPtr client)
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
if(data)
xfree(data);
free(data);
pContext->refcnt++;
......@@ -427,7 +427,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
pSubpicture, &dwords, &data);
if(result != Success) {
xfree(pSubpicture);
free(pSubpicture);
return result;
}
......@@ -449,7 +449,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
if(data)
xfree(data);
free(data);
pContext->refcnt++;
......@@ -708,7 +708,7 @@ XvMCCloseScreen (int i, ScreenPtr pScreen)
pScreen->CloseScreen = pScreenPriv->CloseScreen;
xfree(pScreenPriv);
free(pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}
......
......@@ -185,8 +185,8 @@ void
DeleteFocusClassDeviceStruct(dev)
DeviceIntPtr dev;
{
xfree(dev->focus->trace);
xfree(dev->focus);
free(dev->focus->trace);
free(dev->focus);
dev->focus = NULL;
}
......
......@@ -515,7 +515,7 @@ DeviceFocusEvent(dev, type, mode, detail, pWin)
(void) DeliverEventsToWindow(pWin, (xEvent *)sev, evcount,
DeviceStateNotifyMask, NullGrab, dev->id);
xfree (sev);
free (sev);
}
}
......@@ -830,17 +830,17 @@ InputClientGone(pWin, id)
if (prev)
{
prev->next = other->next;
xfree(other);
free(other);
}
else if (!(other->next))
{
if (ShouldFreeInputMasks(pWin, TRUE))
{
wOtherInputMasks(pWin)->inputClients = other->next;
xfree(wOtherInputMasks(pWin));
free(wOtherInputMasks(pWin));
pWin->optional->inputMasks = (OtherInputMasks *) NULL;
CheckWindowOptionalNeed (pWin);
xfree(other);
free(other);
}
else
{
......@@ -853,7 +853,7 @@ InputClientGone(pWin, id)
else
{
wOtherInputMasks(pWin)->inputClients = other->next;
xfree(other);
free(other);
}
RecalculateDeviceDeliverableEvents(pWin);
return(Success);
......@@ -1032,7 +1032,7 @@ SetModifierMapping(client, dev, len, rlen, numKeyPerModifier, inputMap, k)
return BadAlloc;
}
if ((*k)->modifierKeyMap)
xfree((*k)->modifierKeyMap);
free((*k)->modifierKeyMap);
if (inputMapLen) {
(*k)->modifierKeyMap = map;
memmove((char *)(*k)->modifierKeyMap, (char *)inputMap, inputMapLen);
......
......@@ -161,7 +161,7 @@ ProcXGetDeviceControl(client)
rep.length = (total_length+3) >> 2;
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
WriteToClient(client, total_length, savbuf);
xfree (savbuf);
free (savbuf);
return Success;
}
......
......@@ -190,7 +190,7 @@ ProcXGetFeedbackControl(client)
rep.length = (total_length+3) >> 2;
WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
WriteToClient(client, total_length, savbuf);
xfree (savbuf);
free (savbuf);
return Success;
}
......
......@@ -154,7 +154,7 @@ ProcXGetDeviceDontPropagateList (client)
{
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
xfree (buf);
free (buf);
}
return Success;
}
......
......@@ -168,7 +168,7 @@ ProcXGetSelectedExtensionEvents(client)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient( client, total_length, buf);
xfree (buf);
free (buf);
}
return Success;
}
......
......@@ -144,7 +144,7 @@ ProcXListInputDevices (client)
rep.length = (total_length + 3) >> 2;
WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep);
WriteToClient(client, total_length, savbuf);
xfree (savbuf);
free (savbuf);
return Success;
}
......
......@@ -190,7 +190,7 @@ ProcXQueryDeviceState(client)
WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep);
if (total_length > 0)
WriteToClient (client, total_length, savbuf);
xfree (savbuf);
free (savbuf);
return Success;
}
......
......@@ -159,7 +159,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
cw = xalloc (sizeof (CompWindowRec));
if (!cw)
{
xfree (ccw);
free (ccw);
return BadAlloc;
}
cw->damage = DamageCreate (compReportDamage,
......@@ -170,8 +170,8 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
pWin);
if (!cw->damage)
{
xfree (ccw);
xfree (cw);
free (ccw);
free (cw);
return BadAlloc;
}
......@@ -269,7 +269,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
*prev = ccw->next;
if (ccw->update == CompositeRedirectManual)
cw->update = CompositeRedirectAutomatic;
xfree (ccw);
free (ccw);
break;
}
}
......@@ -288,7 +288,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
RegionUninit(&cw->borderClip);
FAKE_DIX_SET_WINDOW_PRIVATE(pWin, NULL);
xfree (cw);
free (cw);
}
else if (cw->update == CompositeRedirectAutomatic &&
!cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone)
......@@ -368,7 +368,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
csw = xalloc (sizeof (CompSubwindowsRec));
if (!csw)
{
xfree (ccw);
free (ccw);
return BadAlloc;
}
csw->update = CompositeRedirectAutomatic;
......@@ -387,10 +387,10 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
(void) compUnredirectWindow (pClient, pChild, update);
if (!csw->clients)
{
xfree (csw);
free (csw);
FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL);
}
xfree (ccw);
free (ccw);
return ret;
}
}
......@@ -451,7 +451,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id)
for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
(void) compUnredirectWindow (pClient, pChild, ccw->update);
xfree (ccw);
free (ccw);
break;
}
}
......@@ -462,7 +462,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id)
if (!csw->clients)
{
FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL);
xfree (csw);
free (csw);
}
}
......
......@@ -76,7 +76,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->GetSpans = cs->GetSpans;
pScreen->SourceValidate = cs->SourceValidate;
xfree (cs);
free (cs);
FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, NULL);
ret = (*pScreen->CloseScreen) (index, pScreen);
return ret;
......@@ -422,7 +422,7 @@ compScreenInit (ScreenPtr pScreen)
if (!compAddAlternateVisuals (pScreen, cs))
{
xfree (cs);
free (cs);
return FALSE;
}
......
......@@ -214,7 +214,7 @@ ProcDamageCreate (ClientPtr client)
pDamageExt);
if (!pDamageExt->pDamage)
{
xfree (pDamageExt);
free (pDamageExt);
return BadAlloc;
}
if (!AddResource (stuff->damage, DamageExtType, (void *) pDamageExt))
......@@ -412,7 +412,7 @@ FreeDamageExt (void * value, XID did)
DamageUnregister (pDamageExt->pDrawable, pDamageExt->pDamage);
DamageDestroy (pDamageExt->pDamage);
}
xfree (pDamageExt);
free (pDamageExt);
return Success;
}
......
......@@ -476,7 +476,7 @@ ProcDbeAllocateBackBufferName(client)
}
/* Free what was allocated by the GetVisualInfo() call above. */
xfree(scrVisInfo.visinfo);
free(scrVisInfo.visinfo);
if (!visualMatched)
{
......@@ -499,7 +499,7 @@ ProcDbeAllocateBackBufferName(client)
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
(void *)pDbeWindowPriv))
{
xfree(pDbeWindowPriv);
free(pDbeWindowPriv);
return(BadAlloc);
}
......@@ -610,7 +610,7 @@ ProcDbeAllocateBackBufferName(client)
/* The DDX buffer allocation routine failed for the first buffer of
* this window.
*/
xfree(pDbeWindowPriv);
free(pDbeWindowPriv);
return(status);
}
......@@ -761,14 +761,14 @@ ProcDbeSwapBuffers(client)
if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
SecurityWriteAccess)))
{
Xfree(swapInfo);
free(swapInfo);
return(BadWindow);
}
/* Each window must be double-buffered - BadMatch. */
if (DBE_WINDOW_PRIV(pWin) == NULL)
{
Xfree(swapInfo);
free(swapInfo);
return(BadMatch);
}
......@@ -777,7 +777,7 @@ ProcDbeSwapBuffers(client)
{
if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
{
Xfree(swapInfo);
free(swapInfo);
return(BadMatch);
}
}
......@@ -788,7 +788,7 @@ ProcDbeSwapBuffers(client)
(dbeSwapInfo[i].swapAction != XdbeUntouched ) &&
(dbeSwapInfo[i].swapAction != XdbeCopied ))
{
Xfree(swapInfo);
free(swapInfo);
return(BadValue);
}
......@@ -818,12 +818,12 @@ ProcDbeSwapBuffers(client)
error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo);
if (error != Success)
{
Xfree(swapInfo);
free(swapInfo);
return(error);
}
}
Xfree(swapInfo);
free(swapInfo);
return(Success);
} /* ProcDbeSwapBuffers() */
......@@ -925,7 +925,7 @@ ProcDbeGetVisualInfo(client)
if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
drawables[i], client, SecurityReadAccess)))
{
Xfree(pDrawables);
free(pDrawables);
return(BadDrawable);
}
}
......@@ -937,7 +937,7 @@ ProcDbeGetVisualInfo(client)
{
if (pDrawables)
{
Xfree(pDrawables);
free(pDrawables);
}
return(BadAlloc);
......@@ -958,13 +958,13 @@ ProcDbeGetVisualInfo(client)
/* Free visinfos that we allocated for previous screen infos.*/
for (j = 0; j < i; j++)
{
xfree(pScrVisInfo[j].visinfo);
free(pScrVisInfo[j].visinfo);
}
/* Free pDrawables if we needed to allocate it above. */
if (pDrawables)
{
Xfree(pDrawables);
free(pDrawables);
}
return(BadAlloc);
......@@ -1039,13 +1039,13 @@ ProcDbeGetVisualInfo(client)
/* Clean up memory. */
for (i = 0; i < count; i++)
{
xfree(pScrVisInfo[i].visinfo);
free(pScrVisInfo[i].visinfo);
}
xfree(pScrVisInfo);
free(pScrVisInfo);
if (pDrawables)
{
Xfree(pDrawables);
free(pDrawables);
}
return(client->noClientException);
......@@ -1640,7 +1640,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id)
DBE_INIT_MAX_IDS * sizeof(XID));
/* Free the extended array; use the static array. */
xfree(pDbeWindowPriv->IDs);
free(pDbeWindowPriv->IDs);
pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs;
pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
}
......@@ -1671,7 +1671,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id)
(void *)NULL;
/* We are done with the window priv. */
xfree(pDbeWindowPriv);
free(pDbeWindowPriv);
}
return(Success);
......@@ -1719,10 +1719,10 @@ DbeResetProc(extEntry)
if (pDbeScreenPriv->winPrivPrivSizes)
{
xfree(pDbeScreenPriv->winPrivPrivSizes);
free(pDbeScreenPriv->winPrivPrivSizes);
}
xfree(pDbeScreenPriv);
free(pDbeScreenPriv);
}
}
......@@ -1882,7 +1882,7 @@ DbeExtensionInit()
for (j = 0; j < i; j++)
{
xfree(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr);
free(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr);
screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr = NULL;
}
return;
......@@ -1986,7 +1986,7 @@ DbeExtensionInit()
for (i = 0; i < screenInfo.numScreens; i++)
{
xfree(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr);
free(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr);
pScreen->devPrivates[dbeScreenPrivIndex].ptr = NULL;
}
return;
......
......@@ -120,7 +120,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
{
nd->string = (char *) xalloc(len + 1);
if (!nd->string) {
xfree(nd);
free(nd);
return BAD_RESOURCE;
}
strncpy(nd->string, string, (int)len);
......@@ -133,8 +133,8 @@ MakeAtom(const char *string, unsigned len, Bool makeit)
tableLength * (2 * sizeof(NodePtr)));
if (!table) {
if (nd->string != string)
xfree(nd->string);
xfree(nd);
free(nd->string);
free(nd);
return BAD_RESOURCE;
}
tableLength <<= 1;
......@@ -180,8 +180,8 @@ FreeAtom(NodePtr patom)
if(patom->right)
FreeAtom(patom->right);
if (patom->a > XA_LAST_PREDEFINED)
xfree(patom->string);
xfree(patom);
free(patom->string);
free(patom);
}
void
......@@ -191,7 +191,7 @@ FreeAllAtoms()
return;
FreeAtom(atomRoot);
atomRoot = (NodePtr)NULL;
xfree(nodeTable);
free(nodeTable);
nodeTable = (NodePtr *)NULL;
lastAtom = None;
}
......
......@@ -306,7 +306,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
ppix = (Pixel *)xalloc(size * sizeof(Pixel));
if (!ppix)
{
xfree(pmap);
free(pmap);
return (BadAlloc);
}
pmap->clientPixelsRed[client] = ppix;
......@@ -352,8 +352,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
ppix = (Pixel *) xalloc(size * sizeof(Pixel));
if (!ppix)
{
xfree(pmap->clientPixelsRed[client]);
xfree(pmap);
free(pmap->clientPixelsRed[client]);
free(pmap);
return(BadAlloc);
}
pmap->clientPixelsGreen[client] = ppix;
......@@ -368,9 +368,9 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
ppix = (Pixel *) xalloc(size * sizeof(Pixel));
if (!ppix)
{
xfree(pmap->clientPixelsGreen[client]);
xfree(pmap->clientPixelsRed[client]);
xfree(pmap);
free(pmap->clientPixelsGreen[client]);
free(pmap->clientPixelsRed[client]);
free(pmap);
return(BadAlloc);
}
pmap->clientPixelsBlue[client] = ppix;
......@@ -438,7 +438,7 @@ FreeColormap (void * value, XID mid)
if(pmap->clientPixelsRed)
{
for(i = 0; i < MAXCLIENTS; i++)
xfree(pmap->clientPixelsRed[i]);
free(pmap->clientPixelsRed[i]);
}
if ((pmap->class == PseudoColor) || (pmap->class == GrayScale))
......@@ -450,11 +450,11 @@ FreeColormap (void * value, XID mid)
if(pent->fShared)
{
if (--pent->co.shco.red->refcnt == 0)
xfree(pent->co.shco.red);
free(pent->co.shco.red);
if (--pent->co.shco.green->refcnt == 0)
xfree(pent->co.shco.green);
free(pent->co.shco.green);
if (--pent->co.shco.blue->refcnt == 0)
xfree(pent->co.shco.blue);
free(pent->co.shco.blue);
}
}
}
......@@ -462,15 +462,15 @@ FreeColormap (void * value, XID mid)
{
for(i = 0; i < MAXCLIENTS; i++)
{
xfree(pmap->clientPixelsGreen[i]);
xfree(pmap->clientPixelsBlue[i]);
free(pmap->clientPixelsGreen[i]);
free(pmap->clientPixelsBlue[i]);
}
}
if (pmap->devPrivates)
xfree(pmap->devPrivates);
free(pmap->devPrivates);
xfree(pmap);
free(pmap);
return(Success);
}
......@@ -721,11 +721,11 @@ FreeCell (ColormapPtr pmap, Pixel i, int channel)
if (pent->fShared)
{
if(--pent->co.shco.red->refcnt == 0)
xfree(pent->co.shco.red);
free(pent->co.shco.red);
if(--pent->co.shco.green->refcnt == 0)
xfree(pent->co.shco.green);
free(pent->co.shco.green);
if(--pent->co.shco.blue->refcnt == 0)
xfree(pent->co.shco.blue);
free(pent->co.shco.blue);
pent->fShared = FALSE;
}
pent->refcnt = 0;
......@@ -1518,7 +1518,7 @@ FreePixels(register ColormapPtr pmap, register int client)
}
}
xfree(ppixStart);
free(ppixStart);
pmap->clientPixelsRed[client] = (Pixel *) NULL;
pmap->numPixelsRed[client] = 0;
if ((class | DynamicClass) == DirectColor)
......@@ -1527,7 +1527,7 @@ FreePixels(register ColormapPtr pmap, register int client)
if (class & DynamicClass)
for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;)
FreeCell(pmap, *ppix++, GREENMAP);
xfree(ppixStart);
free(ppixStart);
pmap->clientPixelsGreen[client] = (Pixel *) NULL;
pmap->numPixelsGreen[client] = 0;
......@@ -1535,7 +1535,7 @@ FreePixels(register ColormapPtr pmap, register int client)
if (class & DynamicClass)
for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0; )
FreeCell(pmap, *ppix++, BLUEMAP);
xfree(ppixStart);
free(ppixStart);
pmap->clientPixelsBlue[client] = (Pixel *) NULL;
pmap->numPixelsBlue[client] = 0;
}
......@@ -1556,7 +1556,7 @@ FreeClientPixels (void * value, XID fakeid)
pmap = (ColormapPtr) LookupIDByType(pcr->mid, RT_COLORMAP);
if (pmap)
FreePixels(pmap, pcr->client);
xfree(pcr);
free(pcr);
return Success;
}
......@@ -1626,7 +1626,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr))
ok = BadAlloc;
} else if (pcr)
xfree(pcr);
free(pcr);
return (ok);
}
......@@ -1717,7 +1717,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (void *)pcr))
ok = BadAlloc;
} else if (pcr)
xfree(pcr);
free(pcr);
return (ok);
}
......@@ -2092,7 +2092,7 @@ AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b,
if (!(ppshared[z] = (SHAREDCOLOR *)xalloc(sizeof(SHAREDCOLOR))))
{
for (z++ ; z < npixShared; z++)
xfree(ppshared[z]);
free(ppshared[z]);
return FALSE;
}
}
......@@ -2372,7 +2372,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
else
{
npixClient = 0;
xfree(ppixClient);
free(ppixClient);
ppixClient = (Pixel *)NULL;
}
switch(color)
......
......@@ -81,10 +81,10 @@ FreeCursorBits(CursorBitsPtr bits)
{
if (--bits->refcnt > 0)
return;
xfree(bits->source);
xfree(bits->mask);
free(bits->source);
free(bits->mask);
#ifdef ARGB_CURSOR
xfree(bits->argb);
free(bits->argb);
#endif
if (bits->refcnt == 0)
{
......@@ -98,9 +98,9 @@ FreeCursorBits(CursorBitsPtr bits)
{
*prev = this->next;
CloseFont(this->font, (Font)0);
xfree(this);
free(this);
}
xfree(bits);
free(bits);
}
}
......@@ -126,7 +126,7 @@ FreeCursor(void * value, XID cid)
(void)( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(pCurs->bits);
xfree( pCurs);
free( pCurs);
return(Success);
}
......@@ -177,8 +177,8 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
pCurs = (CursorPtr)xalloc(sizeof(CursorRec) + sizeof(CursorBits));
if (!pCurs)
{
xfree(psrcbits);
xfree(pmaskbits);
free(psrcbits);
free(pmaskbits);
return (CursorPtr)NULL;
}
bits = (CursorBitsPtr)((char *)pCurs + sizeof(CursorRec));
......@@ -223,7 +223,7 @@ AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, CARD32 *argb,
( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(bits);
xfree(pCurs);
free(pCurs);
return (CursorPtr)NULL;
}
}
......@@ -329,7 +329,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
if ((res = ServerBitsFromGlyph(sourcefont, sourceChar, &cm, &srcbits)) != 0)
{
xfree(mskbits);
free(mskbits);
return res;
}
if (sourcefont != maskfont)
......@@ -350,9 +350,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
}
if (!bits)
{
xfree(pCurs);
xfree(mskbits);
xfree(srcbits);
free(pCurs);
free(mskbits);
free(srcbits);
return BadAlloc;
}
bits->source = srcbits;
......@@ -414,7 +414,7 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
( *pscr->UnrealizeCursor)( pscr, pCurs);
}
FreeCursorBits(pCurs->bits);
xfree(pCurs);
free(pCurs);
return BadAlloc;
}
}
......
......@@ -208,29 +208,29 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
xfree(dev->name);
free(dev->name);
if (dev->key)
{
#ifdef XKB
if (dev->key->xkbInfo)
XkbFreeInfo(dev->key->xkbInfo);
#endif
xfree(dev->key->curKeySyms.map);
xfree(dev->key->modifierKeyMap);
xfree(dev->key);
free(dev->key->curKeySyms.map);
free(dev->key->modifierKeyMap);
free(dev->key);
}
xfree(dev->valuator);
free(dev->valuator);
#ifdef XKB
if ((dev->button)&&(dev->button->xkb_acts))
xfree(dev->button->xkb_acts);
free(dev->button->xkb_acts);
#endif
xfree(dev->button);
free(dev->button);
if (dev->focus)
{
xfree(dev->focus->trace);
xfree(dev->focus);
free(dev->focus->trace);
free(dev->focus);
}
xfree(dev->proximity);
free(dev->proximity);
for (k=dev->kbdfeed; k; k=knext)
{
knext = k->next;
......@@ -238,29 +238,29 @@ CloseDevice(register DeviceIntPtr dev)
if (k->xkb_sli)
XkbFreeSrvLedInfo(k->xkb_sli);
#endif
xfree(k);
free(k);
}
for (p=dev->ptrfeed; p; p=pnext)
{
pnext = p->next;
xfree(p);
free(p);
}
for (i=dev->intfeed; i; i=inext)
{
inext = i->next;
xfree(i);
free(i);
}
for (s=dev->stringfeed; s; s=snext)
{
snext = s->next;
xfree(s->ctrl.symbols_supported);
xfree(s->ctrl.symbols_displayed);
xfree(s);
free(s->ctrl.symbols_supported);
free(s->ctrl.symbols_displayed);
free(s);
}
for (b=dev->bell; b; b=bnext)
{
bnext = b->next;
xfree(b);
free(b);
}
for (l=dev->leds; l; l=lnext)
{
......@@ -269,15 +269,15 @@ CloseDevice(register DeviceIntPtr dev)
if (l->xkb_sli)
XkbFreeSrvLedInfo(l->xkb_sli);
#endif
xfree(l);
free(l);
}
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
xfree(dev->sync.event);
xfree(dev);
free(dev->sync.event);
free(dev);
}
void
......@@ -471,7 +471,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src)
memmove((char *)&map[i*src->mapWidth],
(char *)&dst->map[i*dst->mapWidth],
dst->mapWidth * sizeof(KeySym));
xfree(dst->map);
free(dst->map);
}
dst->mapWidth = src->mapWidth;
dst->map = map;
......@@ -550,9 +550,9 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
keyc->modifierKeyCount[i] = 0;
if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc))
{
xfree(keyc->curKeySyms.map);
xfree(keyc->modifierKeyMap);
xfree(keyc);
free(keyc->curKeySyms.map);
free(keyc->modifierKeyMap);
free(keyc);
return FALSE;
}
dev->key = keyc;
......@@ -722,10 +722,10 @@ InitStringFeedbackClassDeviceStruct (
if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed)
{
if (feedc->ctrl.symbols_supported)
xfree(feedc->ctrl.symbols_supported);
free(feedc->ctrl.symbols_supported);
if (feedc->ctrl.symbols_displayed)
xfree(feedc->ctrl.symbols_displayed);
xfree(feedc);
free(feedc->ctrl.symbols_displayed);
free(feedc);
return FALSE;
}
for (i=0; i<num_symbols_supported; i++)
......@@ -1001,7 +1001,7 @@ ProcSetModifierMapping(ClientPtr client)
if (!map && inputMapLen)
return BadAlloc;
if (keyc->modifierKeyMap)
xfree(keyc->modifierKeyMap);
free(keyc->modifierKeyMap);
keyc->modifierKeyMap = map;
memmove((char *)map, (char *)inputMap, inputMapLen);
......
......@@ -214,7 +214,7 @@ void
InitSelections()
{
if (CurrentSelections)
xfree(CurrentSelections);
free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
}
......@@ -3090,7 +3090,7 @@ ProcCreateCursor (register ClientPtr client)
mskbits = (unsigned char *)xalloc(n);
if (!mskbits)
{
xfree(srcbits);
free(srcbits);
return (BadAlloc);
}
......@@ -3332,7 +3332,7 @@ ProcListHosts(register ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
WriteSwappedDataToClient(client, len, pdata);
}
xfree(pdata);
free(pdata);
return (client->noClientException);
}
......@@ -3600,7 +3600,7 @@ CloseDownClient(register ClientPtr client)
#ifdef SMART_SCHEDULE
SmartLastClient = NullClient;
#endif
xfree(client);
free(client);
while (!clients[currentMaxClients-1])
currentMaxClients--;
......@@ -3760,7 +3760,7 @@ ClientPtr NextAvailableClient(void * ospriv)
InitClientPrivates(client);
if (!InitClientResources(client))
{
xfree(client);
free(client);
return (ClientPtr)NULL;
}
data.reqType = 1;
......@@ -3768,7 +3768,7 @@ ClientPtr NextAvailableClient(void * ospriv)
if (!InsertFakeRequest(client, (char *)&data, sz_xReq))
{
FreeClientResources(client);
xfree(client);
free(client);
return (ClientPtr)NULL;
}
if (i == currentMaxClients)
......
......@@ -226,8 +226,8 @@ FreeFPE (FontPathElementPtr fpe)
fpe->refcount--;
if (fpe->refcount == 0) {
(*fpe_functions[fpe->type].free_fpe) (fpe);
xfree(fpe->name);
xfree(fpe);
free(fpe->name);
free(fpe);
}
}
......@@ -377,9 +377,9 @@ bail:
for (i = 0; i < c->num_fpes; i++) {
FreeFPE(c->fpe_list[i]);
}
xfree(c->fpe_list);
xfree(c->fontname);
xfree(c);
free(c->fpe_list);
free(c->fontname);
free(c);
return TRUE;
}
#endif /* NXAGENT_SERVER */
......@@ -397,7 +397,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
memmove(f, pfontname, lenfname);
f[lenfname] = '\0';
ErrorF("OpenFont: fontname is \"%s\"\n", f);
xfree(f);
free(f);
#endif
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
return BadName;
......@@ -437,7 +437,7 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
c->origFontName = pfontname;
c->origFontNameLen = lenfname;
if (!c->fontname) {
xfree(c);
free(c);
return BadAlloc;
}
/*
......@@ -447,8 +447,8 @@ OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, char *pfontna
c->fpe_list = (FontPathElementPtr *)
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
xfree(c->fontname);
xfree(c);
free(c->fontname);
free(c);
return BadAlloc;
}
memmove(c->fontname, pfontname, lenfname);
......@@ -679,7 +679,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
if (resolved) xfree(resolved);
if (resolved) free(resolved);
resolved = (char *) xalloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
......@@ -734,7 +734,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
xfree(c->savedName);
free(c->savedName);
c->savedName = (char *)xalloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
......@@ -829,11 +829,11 @@ bail:
ClientWakeup(client);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
if (c->savedName) xfree(c->savedName);
free(c->fpe_list);
if (c->savedName) free(c->savedName);
FreeFontNames(names);
xfree(c);
if (resolved) xfree(resolved);
free(c);
if (resolved) free(resolved);
return TRUE;
}
......@@ -858,14 +858,14 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
c->fpe_list = (FontPathElementPtr *)
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
xfree(c);
free(c);
return BadAlloc;
}
c->names = MakeFontNamesRecord(max_names < 100 ? max_names : 100);
if (!c->names)
{
xfree(c->fpe_list);
xfree(c);
free(c->fpe_list);
free(c);
return BadAlloc;
}
memmove( c->current.pattern, pattern, length);
......@@ -994,7 +994,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
if (c->savedName)
xfree(c->savedName);
free(c->savedName);
c->savedName = (char *)xalloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
......@@ -1084,8 +1084,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
(void) WriteToClient(client, namelen, name);
if (pFontInfo == &fontInfo)
{
xfree(fontInfo.props);
xfree(fontInfo.isStringProp);
free(fontInfo.props);
free(fontInfo.isStringProp);
}
--c->current.max_names;
}
......@@ -1103,10 +1103,10 @@ bail:
ClientWakeup(client);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->reply);
xfree(c->fpe_list);
if (c->savedName) xfree(c->savedName);
xfree(c);
free(c->reply);
free(c->fpe_list);
if (c->savedName) free(c->savedName);
free(c);
return TRUE;
}
#endif /* NXAGENT_SERVER */
......@@ -1133,7 +1133,7 @@ StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern,
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list)
{
xfree(c);
free(c);
goto badAlloc;
}
memmove(c->current.pattern, pattern, length);
......@@ -1330,7 +1330,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
c->data = (unsigned char *)xalloc(len);
if (!c->data)
{
xfree(c);
free(c);
err = BadAlloc;
goto bail;
}
......@@ -1343,8 +1343,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
if (!pGC)
{
xfree(c->data);
xfree(c);
free(c->data);
free(c);
err = BadAlloc;
goto bail;
}
......@@ -1366,8 +1366,8 @@ doPolyText(ClientPtr client, register PTclosurePtr c)
Success)
{
FreeScratchGC(pGC);
xfree(c->data);
xfree(c);
free(c->data);
free(c);
err = BadAlloc;
goto bail;
}
......@@ -1434,8 +1434,8 @@ bail:
c->pGC->font = NullFont;
FreeScratchGC(c->pGC);
xfree(c->data);
xfree(c);
free(c->data);
free(c);
}
return TRUE;
}
......@@ -1530,7 +1530,7 @@ doImageText(ClientPtr client, register ITclosurePtr c)
data = (unsigned char *)xalloc(c->nChars * c->itemSize);
if (!data)
{
xfree(c);
free(c);
c = old_closure;
err = BadAlloc;
goto bail;
......@@ -1541,8 +1541,8 @@ doImageText(ClientPtr client, register ITclosurePtr c)
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
if (!pGC)
{
xfree(c->data);
xfree(c);
free(c->data);
free(c);
c = old_closure;
err = BadAlloc;
goto bail;
......@@ -1562,8 +1562,8 @@ doImageText(ClientPtr client, register ITclosurePtr c)
GCClipYOrigin | GCClipMask)) != Success)
{
FreeScratchGC(pGC);
xfree(c->data);
xfree(c);
free(c->data);
free(c);
c = old_closure;
err = BadAlloc;
goto bail;
......@@ -1602,8 +1602,8 @@ bail:
c->pGC->font = NullFont;
FreeScratchGC(c->pGC);
xfree(c->data);
xfree(c);
free(c->data);
free(c);
}
return TRUE;
}
......@@ -1677,7 +1677,7 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
}
FreeFPE(list[i]);
}
xfree((char *) list);
free((char *) list);
}
static FontPathElementPtr
......@@ -1754,7 +1754,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
fpe->name = (char *) xalloc(len + 1);
if (!fpe->name)
{
xfree(fpe);
free(fpe);
err = BadAlloc;
goto bail;
}
......@@ -1777,8 +1777,8 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist)
fpe->name);
}
#endif /* NXAGENT_SERVER */
xfree (fpe->name);
xfree (fpe);
free (fpe->name);
free (fpe);
}
}
}
......@@ -1805,7 +1805,7 @@ bail:
*bad = i;
while (--valid_paths >= 0)
FreeFPE(fplist[valid_paths]);
xfree(fplist);
free(fplist);
return FontToXError(err);
}
......@@ -2037,7 +2037,7 @@ FreeFonts()
FreeFontPath(font_path_elements, num_fpes, TRUE);
font_path_elements = 0;
num_fpes = 0;
xfree(fpe_functions);
free(fpe_functions);
num_fpe_types = 0;
fpe_functions = (FPEFunctions *) 0;
}
......
......@@ -377,7 +377,7 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
}
else
{
xfree(client->saveSet);
free(client->saveSet);
client->saveSet = (SaveSetElt *)NULL;
}
client->numSaved = numnow;
......@@ -549,7 +549,7 @@ RemoveBlockAndWakeupHandlers (BlockHandlerProcPtr blockHandler,
void
InitBlockAndWakeupHandlers ()
{
xfree (handlers);
free (handlers);
handlers = (BlockHandlerPtr) 0;
numHandlers = 0;
sizeHandlers = 0;
......@@ -581,7 +581,7 @@ ProcessWorkQueue(void)
{
/* remove q from the list */
*p = q->next; /* don't fetch until after func called */
xfree (q);
free (q);
}
else
{
......@@ -604,7 +604,7 @@ ProcessWorkQueueZombies(void)
(void) (*q->function) (q->client, q->closure);
/* remove q from the list */
*p = q->next; /* don't fetch until after func called */
xfree (q);
free (q);
}
else
{
......@@ -692,7 +692,7 @@ ClientWakeup (ClientPtr client)
if (q->client == client)
{
*prev = q->next;
xfree (q);
free (q);
if (client->clientGone)
/* Oops -- new zombie cleanup code ensures this only
* happens from inside CloseDownClient; don't want to
......@@ -775,7 +775,7 @@ _DeleteCallback(
cbl->list = cbr->next;
else
pcbr->next = cbr->next;
xfree(cbr);
free(cbr);
}
return TRUE;
}
......@@ -820,12 +820,12 @@ _CallCallbacks(
if (pcbr)
{
cbr = cbr->next;
xfree(pcbr->next);
free(pcbr->next);
pcbr->next = cbr;
} else
{
cbr = cbr->next;
xfree(cbl->list);
free(cbl->list);
cbl->list = cbr;
}
cbl->numDeleted--;
......@@ -865,9 +865,9 @@ _DeleteCallbackList(
for (cbr = cbl->list; cbr != NULL; cbr = nextcbr)
{
nextcbr = cbr->next;
xfree(cbr);
free(cbr);
}
xfree(cbl);
free(cbl);
*pcbl = NULL;
}
......@@ -955,7 +955,7 @@ InitCallbackManager()
{
DeleteCallbackList(listsToCleanup[i]);
}
if (listsToCleanup) xfree(listsToCleanup);
if (listsToCleanup) free(listsToCleanup);
numCallbackListsToCleanup = 0;
listsToCleanup = NULL;
......
......@@ -1076,7 +1076,7 @@ PlayReleasedEvents(void)
#endif
(*qe->device->public.processInputProc)(qe->event, qe->device,
qe->evcount);
xfree(qe);
free(qe);
for (dev = inputInfo.devices; dev && dev->sync.frozen; dev = dev->next)
;
if (!dev)
......@@ -2959,7 +2959,7 @@ OtherClientGone(void * value, XID id)
if (!(pWin->optional->otherClients = other->next))
CheckWindowOptionalNeed (pWin);
}
xfree(other);
free(other);
RecalculateDeliverableEvents(pWin);
return(Success);
}
......@@ -3948,7 +3948,7 @@ InitEvents()
while (syncEvents.pending)
{
QdEventPtr next = syncEvents.pending->next;
xfree(syncEvents.pending);
free(syncEvents.pending);
syncEvents.pending = next;
}
syncEvents.pendtail = &syncEvents.pending;
......@@ -3968,7 +3968,7 @@ InitEvents()
void
CloseDownEvents(void)
{
xfree(spriteTrace);
free(spriteTrace);
spriteTrace = NULL;
spriteTraceSize = 0;
}
......
......@@ -103,7 +103,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
ext->aliases = (char **)NULL;
if (!ext->name)
{
xfree(ext);
free(ext);
return((ExtensionEntry *) NULL);
}
strcpy(ext->name, name);
......@@ -112,8 +112,8 @@ AddExtension(char *name, int NumEvents, int NumErrors,
(i + 1) * sizeof(ExtensionEntry *));
if (!newexts)
{
xfree(ext->name);
xfree(ext);
free(ext->name);
free(ext);
return((ExtensionEntry *) NULL);
}
NumExtensions++;
......@@ -263,13 +263,13 @@ CloseDownExtensions()
if (extensions[i]->CloseDown)
(* extensions[i]->CloseDown)(extensions[i]);
NumExtensions = i;
xfree(extensions[i]->name);
free(extensions[i]->name);
for (j = extensions[i]->num_aliases; --j >= 0;)
xfree(extensions[i]->aliases[j]);
xfree(extensions[i]->aliases);
xfree(extensions[i]);
free(extensions[i]->aliases[j]);
free(extensions[i]->aliases);
free(extensions[i]);
}
xfree(extensions);
free(extensions);
extensions = (ExtensionEntry **)NULL;
lastEvent = EXTENSION_EVENT_BASE;
lastError = FirstExtensionError;
......@@ -280,9 +280,9 @@ CloseDownExtensions()
while (spentry->num)
{
spentry->num--;
xfree(spentry->procList[spentry->num].name);
free(spentry->procList[spentry->num].name);
}
xfree(spentry->procList);
free(spentry->procList);
spentry->procList = (ProcEntryPtr)NULL;
}
}
......@@ -446,7 +446,7 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc)
sizeof(ProcEntryRec) * (spentry->num+1));
if (!procEntry)
{
xfree(newname);
free(newname);
return FALSE;
}
spentry->procList = procEntry;
......
......@@ -457,7 +457,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
{
if (pGC->dash != DefaultDash)
{
xfree(pGC->dash);
free(pGC->dash);
pGC->numInDashList = 2;
pGC->dash = DefaultDash;
}
......@@ -470,7 +470,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC
if (dash)
{
if (pGC->dash != DefaultDash)
xfree(pGC->dash);
free(pGC->dash);
pGC->numInDashList = 2;
pGC->dash = dash;
dash[0] = newdash;
......@@ -838,7 +838,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask)
{
if (pgcDst->dash != DefaultDash)
{
xfree(pgcDst->dash);
free(pgcDst->dash);
pgcDst->numInDashList = pgcSrc->numInDashList;
pgcDst->dash = pgcSrc->dash;
}
......@@ -853,7 +853,7 @@ CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask)
if (dash)
{
if (pgcDst->dash != DefaultDash)
xfree(pgcDst->dash);
free(pgcDst->dash);
pgcDst->numInDashList = pgcSrc->numInDashList;
pgcDst->dash = dash;
for (i=0; i<pgcSrc->numInDashList; i++)
......@@ -904,8 +904,8 @@ FreeGC(void * value, XID gid)
(*pGC->funcs->DestroyGC) (pGC);
if (pGC->dash != DefaultDash)
xfree(pGC->dash);
xfree(pGC);
free(pGC->dash);
free(pGC);
return(Success);
}
......@@ -1113,7 +1113,7 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd
}
if (pGC->dash != DefaultDash)
xfree(pGC->dash);
free(pGC->dash);
pGC->numInDashList = ndash;
pGC->dash = p;
if (ndash & 1)
......
......@@ -108,7 +108,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
(*pScreen->DestroyPixmap)(ppix);
if (pGC)
FreeScratchGC(pGC);
xfree(pbits);
free(pbits);
return BadAlloc;
}
......
......@@ -116,15 +116,15 @@ static void
FreeGrab(GrabPtr pGrab)
{
if (pGrab->modifiersDetail.pMask != NULL)
xfree(pGrab->modifiersDetail.pMask);
free(pGrab->modifiersDetail.pMask);
if (pGrab->detail.pMask != NULL)
xfree(pGrab->detail.pMask);
free(pGrab->detail.pMask);
if (pGrab->cursor)
FreeCursor(pGrab->cursor, (Cursor)0);
xfree(pGrab);
free(pGrab);
}
int
......@@ -410,7 +410,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
for (i = 0; i < nadds; i++)
FreeResource(adds[i]->resource, RT_NONE);
for (i = 0; i < nups; i++)
xfree(details[i]);
free(details[i]);
}
else
{
......@@ -424,7 +424,7 @@ DeletePassiveGrabFromList(GrabPtr pMinuendGrab)
}
for (i = 0; i < nups; i++)
{
xfree(*updates[i]);
free(*updates[i]);
*updates[i] = details[i];
}
}
......
......@@ -474,7 +474,7 @@ main(int argc, char *argv[], char *envp[])
#endif
FreeAuditTimer();
xfree(serverClient->devPrivates);
free(serverClient->devPrivates);
serverClient->devPrivates = NULL;
if (dispatchException & DE_TERMINATE)
......@@ -490,7 +490,7 @@ main(int argc, char *argv[], char *envp[])
break;
}
xfree(ConnectionInfo);
free(ConnectionInfo);
ConnectionInfo = NULL;
}
return(0);
......@@ -621,7 +621,7 @@ CreateConnectionBlock()
pBuf = (char *)xrealloc(ConnectionInfo, lenofblock);
if (!pBuf)
{
xfree(ConnectionInfo);
free(ConnectionInfo);
return FALSE;
}
ConnectionInfo = pBuf;
......@@ -697,7 +697,7 @@ AddScreen(
screenPrivateCount);
if (!pScreen->devPrivates && screenPrivateCount)
{
xfree(pScreen);
free(pScreen);
return -1;
}
pScreen->myNum = i;
......@@ -782,11 +782,11 @@ static void
FreeScreen(ScreenPtr pScreen)
{
pScreen->root = NullWindow;
xfree(pScreen->WindowPrivateSizes);
xfree(pScreen->GCPrivateSizes);
free(pScreen->WindowPrivateSizes);
free(pScreen->GCPrivateSizes);
#ifdef PIXPRIV
xfree(pScreen->PixmapPrivateSizes);
free(pScreen->PixmapPrivateSizes);
#endif
xfree(pScreen->devPrivates);
xfree(pScreen);
free(pScreen->devPrivates);
free(pScreen);
}
......@@ -66,7 +66,7 @@ ResetClientPrivates()
{
clientPrivateCount = 0;
clientPrivateLen = 0;
xfree(clientPrivateSizes);
free(clientPrivateSizes);
clientPrivateSizes = (unsigned *)NULL;
totalClientSize =
((sizeof(ClientRec) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
......
......@@ -290,7 +290,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
data = (void *)xalloc(totalSize);
if (!data && len)
{
xfree(pProp);
free(pProp);
return(BadAlloc);
}
pProp->propertyName = property;
......@@ -353,7 +353,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
memmove(&((char *)data)[totalSize], (char *)pProp->data,
(int)(pProp->size * sizeInBytes));
memmove((char *)data, (char *)value, totalSize);
xfree(pProp->data);
free(pProp->data);
pProp->data = data;
pProp->size += len;
}
......@@ -404,8 +404,8 @@ DeleteProperty(WindowPtr pWin, Atom propName)
event.u.property.atom = pProp->propertyName;
event.u.property.time = currentTime.milliseconds;
DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
xfree(pProp->data);
xfree(pProp);
free(pProp->data);
free(pProp);
}
return(Success);
}
......@@ -426,8 +426,8 @@ DeleteAllWindowProperties(WindowPtr pWin)
event.u.property.time = currentTime.milliseconds;
DeliverEvents(pWin, &event, 1, (WindowPtr)NULL);
pNextProp = pProp->next;
xfree(pProp->data);
xfree(pProp);
free(pProp->data);
free(pProp);
pProp = pNextProp;
}
}
......@@ -599,8 +599,8 @@ ProcGetProperty(ClientPtr client)
}
else
prevProp->next = pProp->next;
xfree(pProp->data);
xfree(pProp);
free(pProp->data);
free(pProp);
}
return(client->noClientException);
}
......
......@@ -172,7 +172,7 @@ Equipment Corporation.
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
#define RECTALLOC_BAIL(pReg,n,bail) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
......@@ -342,7 +342,7 @@ RegionDestroy(pReg)
good(pReg);
xfreeData(pReg);
if (pReg != &RegionBrokenRegion)
xfree(pReg);
free(pReg);
}
Bool
......@@ -795,7 +795,7 @@ RegionOp(
}
if (oldData)
xfree(oldData);
free(oldData);
if (!(numRects = newReg->data->numRects))
{
......@@ -1355,13 +1355,13 @@ NextRect: ;
numRI -= half;
}
*badreg = ri[0].reg;
xfree(ri);
free(ri);
good(badreg);
return ret;
bail:
for (i = 0; i < numRI; i++)
xfreeData(&ri[i].reg);
xfree (ri);
free (ri);
return RegionBreak (badreg);
}
......@@ -1443,7 +1443,7 @@ RegionFromRects(nrects, prect, ctype)
}
else
{
xfree (pData);
free (pData);
}
return pRgn;
}
......
......@@ -231,7 +231,7 @@ InitClientResources(ClientPtr client)
lastResourceClass = RC_LASTPREDEF;
TypeMask = RC_LASTPREDEF - 1;
if (DeleteFuncs)
xfree(DeleteFuncs);
free(DeleteFuncs);
DeleteFuncs = (DeleteType *)xalloc((lastResourceType + 1) *
sizeof(DeleteType));
if (!DeleteFuncs)
......@@ -249,7 +249,7 @@ InitClientResources(ClientPtr client)
#ifdef XResExtension
if(ResourceNames)
xfree(ResourceNames);
free(ResourceNames);
ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom));
if(!ResourceNames)
return FALSE;
......@@ -505,7 +505,7 @@ RebuildTable(int client)
}
DEALLOCATE_LOCAL(tails);
clientTable[client].buckets *= 2;
xfree(clientTable[client].resources);
free(clientTable[client].resources);
clientTable[client].resources = resources;
}
......@@ -535,7 +535,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
elements = --*eltptr;
if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
xfree(res);
free(res);
if (*eltptr != elements)
prev = head; /* prev may no longer be valid */
gotOne = TRUE;
......@@ -568,7 +568,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
*prev = res->next;
if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id);
xfree(res);
free(res);
break;
}
else
......@@ -723,7 +723,7 @@ FreeClientNeverRetainResources(ClientPtr client)
{
*prev = this->next;
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
xfree(this);
free(this);
}
else
prev = &this->next;
......@@ -767,10 +767,10 @@ FreeClientResources(ClientPtr client)
RESTYPE rtype = this->type;
*head = this->next;
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
xfree(this);
free(this);
}
}
xfree(clientTable[client->index].resources);
free(clientTable[client->index].resources);
clientTable[client->index].resources = NULL;
clientTable[client->index].buckets = 0;
}
......
......@@ -682,7 +682,7 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w,
{
if (!MakeWindowOptional (pWin))
{
xfree (pWin);
free (pWin);
*error = BadAlloc;
return NullWindow;
}
......@@ -864,7 +864,7 @@ CrushTree(WindowPtr pWin)
(*UnrealizeWindow)(pChild);
}
FreeWindowResources(pChild);
xfree(pChild);
free(pChild);
if ( (pChild = pSib) )
break;
pChild = pParent;
......@@ -916,7 +916,7 @@ DeleteWindow(void * value, XID wid)
if (pWin->prevSib)
pWin->prevSib->nextSib = pWin->nextSib;
}
xfree(pWin);
free(pWin);
return Success;
}
#endif /* NXAGENT_SERVER */
......@@ -3147,7 +3147,7 @@ HandleSaveSet(register ClientPtr client)
MapWindow(pWin, client);
}
}
xfree(client->saveSet);
free(client->saveSet);
client->numSaved = 0;
client->saveSet = (SaveSetElt *)NULL;
}
......@@ -3449,8 +3449,8 @@ TileScreenSaver(int i, int kind)
mskbits = (unsigned char *)xalloc( BitmapBytePad(32)*16);
if (!srcbits || !mskbits)
{
xfree(srcbits);
xfree(mskbits);
free(srcbits);
free(mskbits);
cursor = 0;
}
else
......@@ -3471,8 +3471,8 @@ TileScreenSaver(int i, int kind)
}
else
{
xfree (srcbits);
xfree (mskbits);
free (srcbits);
free (mskbits);
}
}
......@@ -3660,7 +3660,7 @@ DisposeWindowOptional (register WindowPtr pWin)
}
else
pWin->cursorIsNone = TRUE;
xfree (pWin->optional);
free (pWin->optional);
pWin->optional = NULL;
}
......
......@@ -491,8 +491,8 @@ fbInitVisuals (VisualPtr *visualp,
visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
if (!depth || !visual)
{
xfree (depth);
xfree (visual);
free (depth);
free (visual);
return FALSE;
}
*depthp = depth;
......@@ -549,7 +549,7 @@ fbInitVisuals (VisualPtr *visualp,
vid++;
visual++;
}
xfree (visuals);
free (visuals);
}
fbVisuals = NULL;
visual = *visualp;
......
......@@ -282,7 +282,7 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
pPriv->and, pPriv->xor,
pPriv->bgand, pPriv->bgxor);
xfree (tmp);
free (tmp);
}
pbox++;
}
......
......@@ -104,7 +104,7 @@ fbDestroyPixmap (PixmapPtr pPixmap)
{
if(--pPixmap->refcnt)
return TRUE;
xfree(pPixmap);
free(pPixmap);
return TRUE;
}
......@@ -309,7 +309,7 @@ fbPixmapToRegion(PixmapPtr pPix)
pReg->extents.y2 = RegionEnd(pReg)->y2;
if (pReg->data->numRects == 1)
{
xfree(pReg->data);
free(pReg->data);
pReg->data = (RegDataPtr)NULL;
}
}
......
......@@ -277,7 +277,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
if (!pPixmap) {
xfree(pBits);
free(pBits);
return FALSE;
}
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
......@@ -285,7 +285,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
BitsPerPixel(depth),
PixmapBytePad(pScreen->width, depth),
pBits)) {
xfree(pBits);
free(pBits);
return FALSE;
}
if (pScreen->rootDepth == pScrPriv->myDepth) {
......@@ -295,7 +295,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
PixmapBytePad(pScreen->width,
pScrPriv->depth),
0)) {
xfree(pBits);
free(pBits);
return FALSE;
}
}
......@@ -328,9 +328,9 @@ xxCloseScreen (int iScreen, ScreenPtr pScreen)
unwrap (pScrPriv,pScreen, CloseScreen);
ret = pScreen->CloseScreen(iScreen,pScreen);
xfree(pScrPriv->pBits);
xfree(pScrPriv->InstalledCmaps);
xfree(pScrPriv);
free(pScrPriv->pBits);
free(pScrPriv->InstalledCmaps);
free(pScrPriv);
return TRUE;
}
......@@ -456,8 +456,8 @@ xxDestroyColormap(ColormapPtr pmap)
tmpCmapPriv = tmpCmapPriv->next;
}
xfree(pCmapPriv->cmap);
xfree(pCmapPriv);
free(pCmapPriv->cmap);
free(pCmapPriv);
}
unwrap(pScrPriv,pmap->pScreen, DestroyColormap);
......
......@@ -36,12 +36,12 @@ fbCloseScreen (int index, ScreenPtr pScreen)
DepthPtr depths = pScreen->allowedDepths;
for (d = 0; d < pScreen->numDepths; d++)
xfree (depths[d].vids);
xfree (depths);
xfree (pScreen->visuals);
xfree (pScreen->devPrivate);
free (depths[d].vids);
free (depths);
free (pScreen->visuals);
free (pScreen->devPrivate);
#ifdef FB_SCREEN_PRIVATE
xfree (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
free (pScreen->devPrivates[fbScreenPrivateIndex].ptr);
#endif
return TRUE;
}
......
......@@ -355,7 +355,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (nxagentOptionFile != NULL)
{
xfree(nxagentOptionFile);
free(nxagentOptionFile);
nxagentOptionFile = NULL;
}
......@@ -719,7 +719,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
if (nxagentKeyboard != NULL)
{
xfree(nxagentKeyboard);
free(nxagentKeyboard);
nxagentKeyboard = NULL;
}
......@@ -1591,7 +1591,7 @@ nxagentProcessOptionsFileFree:
if (data != NULL)
{
Xfree(data);
free(data);
}
nxagentProcessOptionsFileClose:
......
......@@ -745,7 +745,7 @@ void nxagentCollectPropertyEvent(int resource)
if (pszReturnData != NULL)
{
Xfree(pszReturnData);
free(pszReturnData);
}
return;
......@@ -787,7 +787,7 @@ void nxagentCollectPropertyEvent(int resource)
if (pszReturnData != NULL)
{
Xfree(pszReturnData);
free(pszReturnData);
}
return;
......@@ -1487,7 +1487,7 @@ int nxagentInitClipboard(WindowPtr pWin)
if (lastSelectionOwner != NULL)
{
xfree(lastSelectionOwner);
free(lastSelectionOwner);
lastSelectionOwner = NULL;
}
......
......@@ -112,7 +112,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].red;
pCmap->red[i].co.local.blue = colors[i].red;
}
xfree(colors);
free(colors);
break;
case StaticColor: /* read only */
......@@ -125,7 +125,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->red[i].co.local.green = colors[i].green;
pCmap->red[i].co.local.blue = colors[i].blue;
}
xfree(colors);
free(colors);
break;
case TrueColor: /* read only */
......@@ -149,7 +149,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
pCmap->green[i].co.local.green = colors[i].green;
pCmap->blue[i].co.local.blue = colors[i].blue;
}
xfree(colors);
free(colors);
break;
case GrayScale: /* read and write */
......@@ -168,7 +168,7 @@ Bool nxagentCreateColormap(ColormapPtr pCmap)
void nxagentDestroyColormap(ColormapPtr pCmap)
{
XFreeColormap(nxagentDisplay, nxagentColormap(pCmap));
xfree(pCmap->devPriv);
free(pCmap->devPriv);
}
#define SEARCH_PREDICATE \
......@@ -246,11 +246,11 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
numWindows = 0;
}
xfree(icws.cmapIDs);
free(icws.cmapIDs);
if (!nxagentSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
if (nxagentOldInstalledColormapWindows)
xfree(nxagentOldInstalledColormapWindows);
free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64
{
......@@ -261,7 +261,7 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
windows[i] = icws.windows[i];
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
windows, numWindows);
xfree(windows);
free(windows);
}
#else
XSetWMColormapWindows(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum],
......@@ -310,13 +310,13 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#endif /* DUMB_WINDOW_MANAGERS */
}
else
if (icws.windows) xfree(icws.windows);
if (icws.windows) free(icws.windows);
}
void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen)
{
if (nxagentOldInstalledColormapWindows)
xfree(nxagentOldInstalledColormapWindows);
free(nxagentOldInstalledColormapWindows);
#ifdef _XSERVER64
{
......@@ -448,7 +448,7 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
pColors64[i].flags = pColors[i].flags;
}
XStoreColors(nxagentDisplay, nxagentColormap(pCmap), pColors64, nColors);
xfree(pColors64);
free(pColors64);
}
#else
XStoreColors(nxagentDisplay, nxagentColormap(pCmap),
......
......@@ -267,7 +267,7 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
nxagentCursor(pCursor, pScreen) = None;
}
xfree(nxagentCursorPriv(pCursor, pScreen));
free(nxagentCursorPriv(pCursor, pScreen));
return True;
}
......@@ -366,7 +366,7 @@ void nxagentReconnectCursor(void * p0, XID x1, void * p2)
}
else
{
xfree(nxagentCursorPriv(pCursor, nxagentDefaultScreen));
free(nxagentCursorPriv(pCursor, nxagentDefaultScreen));
if (!nxagentRealizeCursor(nxagentDefaultScreen, pCursor))
{
fprintf(stderr, "nxagentReconnectCursor: nxagentRealizeCursor failed\n");
......
......@@ -1814,13 +1814,13 @@ void nxagentCloseDisplay()
* traffic
*/
xfree(nxagentDefaultColormaps);
free(nxagentDefaultColormaps);
nxagentDefaultColormaps = NULL;
XFree(nxagentVisuals);
nxagentVisuals = NULL;
xfree(nxagentDepths);
free(nxagentDepths);
nxagentDepths = NULL;
XFree(nxagentPixmapFormats);
......@@ -2060,7 +2060,7 @@ void nxagentBackupDisplayInfo(void)
nxagentNumVisualsRecBackup = nxagentNumVisuals;
if (nxagentVisualHasBeenIgnored)
{
xfree(nxagentVisualHasBeenIgnored);
free(nxagentVisualHasBeenIgnored);
nxagentVisualHasBeenIgnored = NULL;
}
nxagentVisualHasBeenIgnored = xalloc(nxagentNumVisuals * sizeof(Bool));
......@@ -2074,17 +2074,17 @@ void nxagentBackupDisplayInfo(void)
void nxagentCleanupBackupDisplayInfo(void)
{
xfree(nxagentDepthsRecBackup);
free(nxagentDepthsRecBackup);
nxagentNumDepthsRecBackup = 0;
nxagentNumDefaultColormapsRecBackup = 0;
xfree(nxagentVisualsRecBackup);
free(nxagentVisualsRecBackup);
nxagentNumVisualsRecBackup = 0;
if (nxagentVisualHasBeenIgnored)
{
xfree(nxagentVisualHasBeenIgnored);
free(nxagentVisualHasBeenIgnored);
nxagentVisualHasBeenIgnored = NULL;
}
......@@ -2107,7 +2107,7 @@ void nxagentCleanupBackupDisplayInfo(void)
}
else
{
xfree(nxagentBitmapGCBackup);
free(nxagentBitmapGCBackup);
}
nxagentBitmapGCBackup = NULL;
......
......@@ -359,7 +359,7 @@ nxagentSynchronizeDrawableDataFree:
if (data != NULL)
{
xfree(data);
free(data);
}
nxagentSynchronizeDrawableDataEnd:
......@@ -860,7 +860,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
if (cmpData != NULL)
{
xfree(cmpData);
free(cmpData);
}
}
}
......@@ -1060,7 +1060,7 @@ nxagentSynchronizeRegionFree:
if (data != NULL)
{
xfree(data);
free(data);
}
RegionUninit(&exposeRegion);
......@@ -2161,7 +2161,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel)
fprintf(stderr, "nxagentGetColor: WARNING! Failed to create the XImage.\n");
#endif
xfree(data);
free(data);
return -1;
}
......@@ -2387,7 +2387,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion)
XFillRectangles(nxagentDisplay, nxagentDrawable(pDrawable), nxagentGC(pGC),
pRects, nrects);
xfree(pRects);
free(pRects);
}
}
......
......@@ -196,11 +196,11 @@ void nxagentFreeFontCache(void)
nxagentFreeFont(CACHE_FSTRUCT(i));
}
xfree(CACHE_NAME(i));
xfree(CACHE_ENTRY(i));
free(CACHE_NAME(i));
free(CACHE_ENTRY(i));
}
xfree(CACHE_ENTRY_PTR);
free(CACHE_ENTRY_PTR);
CACHE_ENTRY_PTR = NULL;
CACHE_INDEX = 0;
CACHE_SIZE = 0;
......@@ -364,10 +364,10 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
{
if (listRec -> list[l])
{
xfree(listRec -> list[l] -> name);
free(listRec -> list[l] -> name);
listRec -> list[l] -> name = NULL;
xfree(listRec -> list[l]);
free(listRec -> list[l]);
listRec -> list[l] = NULL;
}
}
......@@ -686,7 +686,7 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (nxagentFontPriv(pFont) -> mirrorID)
FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE);
xfree(nxagentFontPriv(pFont));
free(nxagentFontPriv(pFont));
FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL);
}
......@@ -1640,7 +1640,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name);
#endif
Xfree(fs);
free(fs);
return (XFontStruct *) NULL;
}
......@@ -1674,7 +1674,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Failed allocation of XFontProp.");
#endif
Xfree((char *) fs);
free((char *) fs);
return (XFontStruct *) NULL;
}
......@@ -1714,13 +1714,13 @@ int nxagentFreeFont(XFontStruct *fs)
#ifdef USE_XF86BIGFONT
_XF86BigfontFreeFontMetrics(fs);
#else
Xfree ((char *) fs->per_char);
free ((char *) fs->per_char);
#endif
}
if (fs -> properties)
{
Xfree (fs->properties);
free (fs->properties);
}
XFree(fs);
......
......@@ -686,7 +686,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y,
pRects, nRects, Unsorted);
xfree((char *) pRects);
free((char *) pRects);
}
break;
......@@ -770,7 +770,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
xfree(pValue);
free(pValue);
pValue = pGC->clientClip;
......@@ -904,7 +904,7 @@ static void nxagentFreeGCRec(struct nxagentGCRec *t)
(void *) t, (void *) t -> gc);
#endif
xfree(t -> gc);
free(t -> gc);
free(t);
}
......@@ -918,7 +918,7 @@ static void nxagentRestoreGCRec(struct nxagentGCRec *t)
if (nxagentGC(t -> pGC))
{
xfree(nxagentGC(t -> pGC));
free(nxagentGC(t -> pGC));
}
nxagentGC(t -> pGC) = t -> gc;
......@@ -1298,7 +1298,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y,
pRects, nRects, Unsorted);
xfree((char *) pRects);
free((char *) pRects);
}
else
{
......@@ -1369,7 +1369,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
xfree(pValue);
free(pValue);
pValue = pGC->clientClip;
type = CT_REGION;
......
......@@ -779,7 +779,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx, srcy, width, height);
#endif
xfree(data);
free(data);
/*
* If the source is a shared memory pixmap, the
......@@ -999,7 +999,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
srcx, srcy, width, height);
#endif
xfree(data);
free(data);
/*
* If the source is a shared memory pixmap, the
......@@ -1539,7 +1539,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
if (newPoints != NULL)
{
xfree(newPoints);
free(newPoints);
}
}
......
......@@ -447,7 +447,7 @@ FIXME: Here the split trap is always set and so the caching of
if (nxagentUnpackAlpha[resource] != NULL)
{
Xfree(nxagentUnpackAlpha[resource] -> data);
free(nxagentUnpackAlpha[resource] -> data);
}
else if ((nxagentUnpackAlpha[resource] = Xmalloc(sizeof(UnpackAlphaRec))) == NULL)
{
......@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
fprintf(stderr, "nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.\n");
#endif
Xfree(data);
free(data);
return;
}
......@@ -475,7 +475,7 @@ FIXME: Here the split trap is always set and so the caching of
resource, size);
#endif
Xfree(data);
free(data);
}
}
......@@ -1561,7 +1561,7 @@ nxagentPutSubImageEnd:
if (packedChecksum != NULL)
{
Xfree(packedChecksum);
free(packedChecksum);
}
if (packedImage != NULL)
......@@ -1569,13 +1569,13 @@ nxagentPutSubImageEnd:
if (packedImage -> data != NULL &&
packedImage -> data != plainImage -> data)
{
Xfree(packedImage -> data);
free(packedImage -> data);
}
Xfree(packedImage);
free(packedImage);
}
Xfree(plainImage);
free(plainImage);
}
void nxagentGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
......@@ -1629,9 +1629,9 @@ void nxagentResetAlphaCache()
{
if (nxagentUnpackAlpha[i])
{
Xfree(nxagentUnpackAlpha[i] -> data);
free(nxagentUnpackAlpha[i] -> data);
Xfree(nxagentUnpackAlpha[i]);
free(nxagentUnpackAlpha[i]);
nxagentUnpackAlpha[i] = NULL;
}
......@@ -1711,7 +1711,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if (newImage -> data == NULL)
{
Xfree(newImage);
free(newImage);
#ifdef PANIC
fprintf(stderr, "nxagentScaleImage: PANIC! Failed to create the target image data.\n");
......@@ -1781,10 +1781,10 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if (image -> obdata != NULL)
{
Xfree((char *) image -> obdata);
free((char *) image -> obdata);
}
Xfree((char *) image);
free((char *) image);
*pImage = newImage;
......
......@@ -1138,7 +1138,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#ifdef _XSERVER64
xfree(keymap);
free(keymap);
#else
XFree(keymap);
#endif
......@@ -1473,17 +1473,17 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
}
#endif
xfree(dev->key->curKeySyms.map);
xfree(dev->key->modifierKeyMap);
xfree(dev->key);
free(dev->key->curKeySyms.map);
free(dev->key->modifierKeyMap);
free(dev->key);
dev->key=NULL;
}
if (dev->focus)
{
xfree(dev->focus->trace);
xfree(dev->focus);
free(dev->focus->trace);
free(dev->focus);
dev->focus=NULL;
}
......@@ -1494,7 +1494,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (k->xkb_sli)
XkbFreeSrvLedInfo(k->xkb_sli);
#endif
xfree(k);
free(k);
}
#ifdef DEBUG
......
......@@ -197,7 +197,7 @@ void
InitSelections()
{
if (CurrentSelections)
xfree(CurrentSelections);
free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
......@@ -1316,7 +1316,7 @@ CloseDownClient(register ClientPtr client)
#ifdef SMART_SCHEDULE
SmartLastClient = NullClient;
#endif
xfree(client);
free(client);
while (!clients[currentMaxClients-1])
currentMaxClients--;
......
......@@ -326,9 +326,9 @@ bail:
for (i = 0; i < c->num_fpes; i++) {
FreeFPE(c->fpe_list[i]);
}
xfree(c->fpe_list);
xfree(c->fontname);
xfree(c);
free(c->fpe_list);
free(c->fontname);
free(c);
return TRUE;
}
......@@ -441,7 +441,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
return TRUE;
}
if (err == FontNameAlias) {
if (resolved) xfree(resolved);
if (resolved) free(resolved);
resolved = (char *) xalloc(resolvedlen + 1);
if (resolved)
memmove(resolved, tmpname, resolvedlen + 1);
......@@ -496,7 +496,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
xfree(c->savedName);
free(c->savedName);
c->savedName = (char *)xalloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
......@@ -614,11 +614,11 @@ bail:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
if (c->savedName) xfree(c->savedName);
free(c->fpe_list);
if (c->savedName) free(c->savedName);
FreeFontNames(names);
xfree(c);
if (resolved) xfree(resolved);
free(c);
if (resolved) free(resolved);
return TRUE;
}
......@@ -643,14 +643,14 @@ ListFonts(ClientPtr client, unsigned char *pattern, unsigned length,
c->fpe_list = (FontPathElementPtr *)
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
xfree(c);
free(c);
return BadAlloc;
}
c->names = MakeFontNamesRecord(max_names < nxagentMaxFontNames ? max_names : nxagentMaxFontNames);
if (!c->names)
{
xfree(c->fpe_list);
xfree(c);
free(c->fpe_list);
free(c);
return BadAlloc;
}
memmove( c->current.pattern, pattern, length);
......@@ -785,7 +785,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
c->haveSaved = TRUE;
c->savedNumFonts = numFonts;
if (c->savedName)
xfree(c->savedName);
free(c->savedName);
c->savedName = (char *)xalloc(namelen + 1);
if (c->savedName)
memmove(c->savedName, name, namelen + 1);
......@@ -886,8 +886,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
(void) WriteToClient(client, namelen, name);
if (pFontInfo == &fontInfo)
{
xfree(fontInfo.props);
xfree(fontInfo.isStringProp);
free(fontInfo.props);
free(fontInfo.isStringProp);
}
--c->current.max_names;
}
......@@ -910,10 +910,10 @@ bail:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->reply);
xfree(c->fpe_list);
if (c->savedName) xfree(c->savedName);
xfree(c);
free(c->reply);
free(c->fpe_list);
if (c->savedName) free(c->savedName);
free(c);
return TRUE;
}
......@@ -1085,7 +1085,7 @@ nxdoListFontsAndAliases(client, fss)
return TRUE;
}
if (err == FontNameAlias) {
if (resolved) xfree(resolved);
if (resolved) free(resolved);
resolved = (char *) xalloc(resolvedlen + 1);
if (resolved)
{
......@@ -1154,7 +1154,7 @@ nxdoListFontsAndAliases(client, fss)
c->saved = c->current;
c->haveSaved = TRUE;
if (c->savedName)
xfree(c->savedName);
free(c->savedName);
c->savedName = (char *)xalloc(namelen + 1);
if (c->savedName)
{
......@@ -1249,12 +1249,12 @@ finish:
}
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
if (c->savedName) xfree(c->savedName);
free(c->fpe_list);
if (c->savedName) free(c->savedName);
FreeFontNames(c->names);
xfree(c);
xfree(fss);
if (resolved) xfree(resolved);
free(c);
free(fss);
if (resolved) free(resolved);
return doOpenFont(client, oc);
}
......@@ -1279,7 +1279,7 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
memmove(f, pfontname, lenfname);
f[lenfname] = '\0';
ErrorF("OpenFont: fontname is \"%s\"\n", f);
xfree(f);
free(f);
#endif
if (!lenfname || lenfname > XLFDMAXFONTNAMELEN)
return BadName;
......@@ -1317,22 +1317,22 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
if (!(c = (LFclosurePtr) xalloc(sizeof *c)))
{
xfree(fss);
free(fss);
return BadAlloc;
}
c->fpe_list = (FontPathElementPtr *)
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!c->fpe_list) {
xfree(c);
xfree(fss);
free(c);
free(fss);
return BadAlloc;
}
c->names = MakeFontNamesRecord(100);
if (!c->names)
{
xfree(c->fpe_list);
xfree(c);
xfree(fss);
free(c->fpe_list);
free(c);
free(fss);
return BadAlloc;
}
memmove( c->current.pattern, pfontname, lenfname);
......@@ -1356,9 +1356,9 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
{
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
xfree(c);
xfree(fss);
free(c->fpe_list);
free(c);
free(fss);
return BadAlloc;
}
oc->fontname = (char *) xalloc(256);/* I don't want to deal with future reallocs errors */
......@@ -1367,10 +1367,10 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
if (!oc->fontname) {
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
xfree(c);
xfree(oc);
xfree(fss);
free(c->fpe_list);
free(c);
free(oc);
free(fss);
return BadAlloc;
}
/*
......@@ -1380,13 +1380,13 @@ nxOpenFont(client, fid, flags, lenfname, pfontname)
oc->fpe_list = (FontPathElementPtr *)
xalloc(sizeof(FontPathElementPtr) * num_fpes);
if (!oc->fpe_list) {
xfree(oc->fontname);
xfree(oc);
free(oc->fontname);
free(oc);
for (i = 0; i < c->num_fpes; i++)
FreeFPE(c->fpe_list[i]);
xfree(c->fpe_list);
xfree(c);
xfree(fss);
free(c->fpe_list);
free(c);
free(fss);
return BadAlloc;
}
memmove(oc->fontname, pfontname, lenfname);
......
......@@ -65,7 +65,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph);
if (gr->glyph && gr->glyph != DeletedGlyph)
{
xfree (glyph);
free (glyph);
glyph = gr->glyph;
}
else
......@@ -175,7 +175,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
++newHash.tableEntries;
}
}
xfree (hash->table);
free (hash->table);
}
*hash = newHash;
if (global)
......
......@@ -115,7 +115,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
fbDestroyPixmap(ppix);
if (pGC)
FreeScratchGC(pGC);
xfree(pbits);
free(pbits);
return BadAlloc;
}
......
......@@ -284,7 +284,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill));
if (!pPicture->pSourcePict) {
*error = BadAlloc;
xfree(pPicture);
free(pPicture);
return 0;
}
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
......@@ -361,12 +361,12 @@ FreePicture (void * value,
nxagentDestroyPicture(pPicture);
if (pPicture->transform)
xfree (pPicture->transform);
free (pPicture->transform);
if (!pPicture->pDrawable) {
if (pPicture->pSourcePict) {
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
xfree(pPicture->pSourcePict->linear.stops);
xfree(pPicture->pSourcePict);
free(pPicture->pSourcePict->linear.stops);
free(pPicture->pSourcePict);
}
} else {
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
......@@ -397,7 +397,7 @@ FreePicture (void * value,
(*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
}
}
xfree (pPicture);
free (pPicture);
}
return Success;
}
......@@ -502,7 +502,7 @@ Bool nxagentReconnectAllPictFormat(void *p)
}
}
xfree(formats);
free(formats);
/* TODO: Perhaps do i have to do PictureFinishInit ?. */
/* TODO: We have to check for new Render protocol version. */
......
......@@ -233,7 +233,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
data = (void *)xalloc(totalSize);
if (!data && len)
{
xfree(pProp);
free(pProp);
return(BadAlloc);
}
pProp->propertyName = property;
......@@ -296,7 +296,7 @@ ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format,
memmove(&((char *)data)[totalSize], (char *)pProp->data,
(int)(pProp->size * sizeInBytes));
memmove((char *)data, (char *)value, totalSize);
xfree(pProp->data);
free(pProp->data);
pProp->data = data;
pProp->size += len;
}
......@@ -521,8 +521,8 @@ ProcGetProperty(ClientPtr client)
}
else
prevProp->next = pProp->next;
xfree(pProp->data);
xfree(pProp);
free(pProp->data);
free(pProp);
}
return(client->noClientException);
}
......@@ -636,8 +636,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
}
else
prevProp->next = pProp->next;
xfree(pProp->data);
xfree(pProp);
free(pProp->data);
free(pProp);
}
return(Success);
}
......
......@@ -362,7 +362,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
swapl (&reply->numSubpixel, n);
}
WriteToClient(client, rlength, (char *) reply);
xfree (reply);
free (reply);
return client->noClientException;
}
......@@ -730,7 +730,7 @@ ProcRenderTrapezoids (ClientPtr client)
if (nxagentTrapezoidExtents != NullBox)
{
xfree(nxagentTrapezoidExtents);
free(nxagentTrapezoidExtents);
nxagentTrapezoidExtents = NullBox;
}
......@@ -1132,7 +1132,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase);
}
xfree(nxagentGlyphsExtents);
free(nxagentGlyphsExtents);
nxagentGlyphsExtents = NullBox;
if (glyphsBase != glyphsLocal)
......@@ -1140,7 +1140,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
if (listsBase != listsLocal)
DEALLOCATE_LOCAL (listsBase);
xfree(elementsBase);
free(elementsBase);
return client->noClientException;
}
......@@ -1228,14 +1228,14 @@ ProcRenderCreateCursor (ClientPtr client)
srcbits = (unsigned char *)xalloc(nbytes_mono);
if (!srcbits)
{
xfree (argbbits);
free (argbbits);
return (BadAlloc);
}
mskbits = (unsigned char *)xalloc(nbytes_mono);
if (!mskbits)
{
xfree(argbbits);
xfree(srcbits);
free(argbbits);
free(srcbits);
return (BadAlloc);
}
bzero ((char *) mskbits, nbytes_mono);
......@@ -1257,26 +1257,26 @@ ProcRenderCreateCursor (ClientPtr client)
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
xfree (argbbits);
xfree (srcbits);
xfree (mskbits);
free (argbbits);
free (srcbits);
free (mskbits);
return (BadImplementation);
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
if (!pPixmap)
{
xfree (argbbits);
xfree (srcbits);
xfree (mskbits);
free (argbbits);
free (srcbits);
free (mskbits);
return (BadAlloc);
}
pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
client, &error);
if (!pPicture)
{
xfree (argbbits);
xfree (srcbits);
xfree (mskbits);
free (argbbits);
free (srcbits);
free (mskbits);
return error;
}
(*pScreen->DestroyPixmap) (pPixmap);
......@@ -1360,7 +1360,7 @@ ProcRenderCreateCursor (ClientPtr client)
}
else
{
xfree (argbbits);
free (argbbits);
argbbits = 0;
}
......@@ -1488,7 +1488,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
RT_CURSOR, SecurityReadAccess);
if (!cursors[i])
{
xfree (cursors);
free (cursors);
client->errorValue = elt->cursor;
return BadCursor;
}
......@@ -1496,7 +1496,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
elt++;
}
ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor);
xfree (cursors);
free (cursors);
if (ret != Success)
return ret;
......
......@@ -313,7 +313,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
#endif
if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
xfree(res);
free(res);
if (*eltptr != elements)
prev = head; /* prev may no longer be valid */
gotOne = TRUE;
......@@ -349,7 +349,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
#endif
if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id);
xfree(res);
free(res);
break;
}
else
......
......@@ -239,7 +239,7 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
fbGetImage((DrawablePtr) pPixmap, sx, sy, sw, sh, format, AllPlanes, newdata);
(*pGC->ops->PutImage)(dst, pGC, depth, dx, dy, sw, sh, 0, format, newdata);
xfree(newdata);
free(newdata);
}
else
{
......
......@@ -336,7 +336,7 @@ DeleteWindow(void * value, XID wid)
nxagentSetInstalledColormapWindows(pWin -> drawable.pScreen);
}
xfree(pWin);
free(pWin);
return Success;
}
......
......@@ -487,7 +487,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
FreeResource(pPixmapPriv -> mid, RT_NONE);
}
xfree(pPixmap);
free(pPixmap);
return True;
}
......@@ -1259,7 +1259,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentPutImage(pDrawable, pGC, depth, xPict, yPict,
width, height, 0, format, data);
xfree(data);
free(data);
}
#ifdef WARNING
else
......@@ -1409,7 +1409,7 @@ FIXME: If the pixmap has a different depth from the window, the
if (data != NULL)
{
xfree(data);
free(data);
}
return False;
......@@ -1571,7 +1571,7 @@ Bool nxagentFbOnShadowDisplay()
if (data)
{
xfree(data);
free(data);
}
return False;
......
......@@ -444,7 +444,7 @@ Bool nxagentReconnectSession(void)
if (nxagentKeyboard)
{
xfree(nxagentKeyboard);
free(nxagentKeyboard);
nxagentKeyboard = NULL;
}
......@@ -609,7 +609,7 @@ Bool nxagentReconnectSession(void)
if (nxagentOldKeyboard != NULL)
{
xfree(nxagentOldKeyboard);
free(nxagentOldKeyboard);
nxagentOldKeyboard = NULL;
}
......@@ -734,7 +734,7 @@ nxagentReconnectError:
if (nxagentOldKeyboard != NULL)
{
xfree(nxagentOldKeyboard);
free(nxagentOldKeyboard);
nxagentOldKeyboard = NULL;
}
......
......@@ -2284,7 +2284,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
if (normalizedImages != images)
{
xfree(normalizedImages);
free(normalizedImages);
}
#ifdef DEBUG
......@@ -2392,7 +2392,7 @@ FIXME: Is this useful or just a waste of bandwidth?
nparams);
#endif
Xfree(szFilter);
free(szFilter);
}
......
......@@ -389,7 +389,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
#endif
xfree(toplevel);
free(toplevel);
return;
}
......@@ -797,7 +797,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (freeMem)
{
xfree(output);
free(output);
}
return export;
......@@ -1104,7 +1104,7 @@ void nxagentImportProperty(Window window,
if (freeMem)
{
xfree(output);
free(output);
}
return;
......@@ -1156,7 +1156,7 @@ void nxagentRemovePropertyFromList()
nxagentPropertyList.last = NULL;
}
xfree(tmp);
free(tmp);
}
}
......
......@@ -1358,8 +1358,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
* by fbScreenInit with our own.
*/
xfree(pScreen -> visuals);
xfree(pScreen -> allowedDepths);
free(pScreen -> visuals);
free(pScreen -> allowedDepths);
pScreen -> visuals = visuals;
pScreen -> allowedDepths = depths;
......@@ -2079,18 +2079,18 @@ Bool nxagentCloseScreen(int index, ScreenPtr pScreen)
for (i = 0; i < pScreen->numDepths; i++)
{
xfree(pScreen->allowedDepths[i].vids);
free(pScreen->allowedDepths[i].vids);
}
/*
* Free the frame buffer.
*/
xfree(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr);
free(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr);
xfree(pScreen->allowedDepths);
xfree(pScreen->visuals);
xfree(pScreen->devPrivate);
free(pScreen->allowedDepths);
free(pScreen->visuals);
free(pScreen->devPrivate);
/*
* Reset the geometry and alpha information
......@@ -3065,7 +3065,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
if (tBuffer)
{
xfree(tBuffer);
free(tBuffer);
}
tBuffer = xalloc(length);
......@@ -3125,7 +3125,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr
if (tBuffer)
{
xfree(tBuffer);
free(tBuffer);
}
RegionUninit(&updateRegion);
......@@ -3346,7 +3346,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height,
if (cBuffer != NULL)
{
xfree(cBuffer);
free(cBuffer);
}
}
......@@ -3529,7 +3529,7 @@ FIXME: The port information is not used at the moment and produces a
strlen(local_buf), local_buf, 1);
}
xfree(local_buf);
free(local_buf);
}
}
}
......@@ -3769,7 +3769,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
number = 1;
if (screeninfo) {
xfree(screeninfo);
free(screeninfo);
}
if (!(screeninfo = xalloc(sizeof(XineramaScreenInfo)))) {
return FALSE;
......@@ -4061,7 +4061,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
/* release allocated memory */
if (screeninfo) {
xfree(screeninfo);
free(screeninfo);
screeninfo = NULL;
}
......@@ -4170,7 +4170,7 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg,
XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted);
xfree((char *) pRects);
free((char *) pRects);
extents = *RegionExtents(&cleanRegion);
......@@ -4316,7 +4316,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg,
XSetClipRectangles(nxagentDisplay, gc, 0, 0, pRects, nRects, Unsorted);
xfree(pRects);
free(pRects);
extents = *RegionExtents(clipRegion);
......@@ -4537,7 +4537,7 @@ FIXME
if (data)
{
xfree(data);
free(data);
}
return;
......@@ -4573,7 +4573,7 @@ FIXME
if (data != NULL)
{
xfree(data);
free(data);
}
/*
......@@ -4628,7 +4628,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc,
if (data)
{
xfree(data);
free(data);
}
return;
......@@ -4691,7 +4691,7 @@ FIXME
FIXME
if (data)
{
xfree(data);
free(data);
}
*/
}
......
......@@ -53,7 +53,7 @@ SOFTWARE.
#include "misc.h"
#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((void *)(_ptr))
#define DEALLOCATE_LOCAL_FALLBACK(_ptr) free((void *)(_ptr))
#include <nx-X11/Xalloca.h>
#ifndef IN_MODULE
#include <stdarg.h>
......
......@@ -450,7 +450,7 @@ miFreeArcCache (data, id)
{
cent->lrustamp = 0;
cent->lw = 0;
xfree(cent->spdata);
free(cent->spdata);
cent->spdata = NULL;
}
}
......@@ -911,7 +911,7 @@ miComputeWideEllipse(
if (!spdata || spdata->k != k)
{
if (spdata)
xfree(spdata);
free(spdata);
spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) +
sizeof(miArcSpan) * (k + 2));
lruent->spdata = spdata;
......@@ -1054,7 +1054,7 @@ miFillWideEllipse(
}
}
if (mustFree)
xfree(spdata);
free(spdata);
(*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
DEALLOCATE_LOCAL(widths);
......@@ -1412,7 +1412,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
}
xfree(pArcPts);
free(pArcPts);
return;
case JoinMiter:
/*
......@@ -1543,7 +1543,7 @@ miRoundCap(
* rest of the line */
miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
}
xfree(pArcPts);
free(pArcPts);
}
/*
......@@ -1840,13 +1840,13 @@ miFreeArcs(
iphase--)
{
if (arcs[iphase].narcs > 0)
xfree(arcs[iphase].arcs);
free(arcs[iphase].arcs);
if (arcs[iphase].njoins > 0)
xfree(arcs[iphase].joins);
free(arcs[iphase].joins);
if (arcs[iphase].ncaps > 0)
xfree(arcs[iphase].caps);
free(arcs[iphase].caps);
}
xfree(arcs);
free(arcs);
}
/*
......@@ -3169,11 +3169,11 @@ disposeFinalSpans (void)
for (chunk = chunks; chunk; chunk = next) {
next = chunk->next;
xfree (chunk);
free (chunk);
}
chunks = 0;
freeFinalSpans = 0;
xfree(finalSpans);
free(finalSpans);
finalSpans = 0;
}
......@@ -3265,7 +3265,7 @@ realFindSpan (int y)
memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
(char *) finalSpans,
finalSize * sizeof (struct finalSpan *));
xfree (finalSpans);
free (finalSpans);
}
if ((i = finalMiny - newMiny) > 0)
bzero ((char *)newSpans, i * sizeof (struct finalSpan *));
......@@ -3610,7 +3610,7 @@ drawArc (
}
}
if (mustFree)
xfree(spdata);
free(spdata);
}
static void
......
......@@ -1709,7 +1709,7 @@ miBankCloseScreen(
if (pScreenPriv->pBanks[i])
RegionDestroy(pScreenPriv->pBanks[i]);
Xfree(pScreenPriv->pBanks);
free(pScreenPriv->pBanks);
SCREEN_UNWRAP(CreateScreenResources);
SCREEN_UNWRAP(ModifyPixmapHeader);
......@@ -1722,7 +1722,7 @@ miBankCloseScreen(
SCREEN_UNWRAP(CopyWindow);
SCREEN_UNWRAP(BackingStoreFuncs);
Xfree(pScreenPriv);
free(pScreenPriv);
return (*pScreen->CloseScreen)(nIndex, pScreen);
}
......@@ -2249,7 +2249,7 @@ miInitializeBanking(
if (!(pScreenPriv->pBanks = /* Allocate and clear */
(RegionPtr *)Xcalloc(nBanks * sizeof(RegionPtr))))
{
Xfree(pScreenPriv);
free(pScreenPriv);
return FALSE;
}
......@@ -2360,8 +2360,8 @@ miInitializeBanking(
if (pScreenPriv->pBanks[i])
RegionDestroy(pScreenPriv->pBanks[i]);
Xfree(pScreenPriv->pBanks);
Xfree(pScreenPriv);
free(pScreenPriv->pBanks);
free(pScreenPriv);
return FALSE;
}
......
......@@ -258,7 +258,7 @@ miCopyArea(pSrcDrawable, pDstDrawable,
(*pGC->ops->SetSpans)(pDstDrawable, pGC, (char *)pbits, pptFirst,
(int *)pwidthFirst, height, TRUE);
xfree(pbits);
free(pbits);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
......@@ -622,7 +622,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable,
miOpqStipDrawable(pDstDrawable, pGC, prgnSrc, ptile, 0,
box.x2 - box.x1, box.y2 - box.y1,
dstx + box.x1 - srcx, dsty + box.y1 - srcy);
xfree(ptile);
free(ptile);
}
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
......
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