mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
96c7ab27c3
commit
3f3ff971ec
345 changed files with 3011 additions and 3011 deletions
14
os/xdmcp.c
14
os/xdmcp.c
|
|
@ -391,7 +391,7 @@ XdmcpRegisterAuthentication (
|
|||
AuthenticationNames.length + 1) &&
|
||||
XdmcpReallocARRAYofARRAY8 (&AuthenticationDatas,
|
||||
AuthenticationDatas.length + 1) &&
|
||||
(newFuncs = xalloc ((AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec)))))
|
||||
(newFuncs = malloc((AuthenticationNames.length + 1) * sizeof (AuthenticationFuncsRec)))))
|
||||
{
|
||||
XdmcpDisposeARRAY8 (&AuthenticationName);
|
||||
XdmcpDisposeARRAY8 (&AuthenticationData);
|
||||
|
|
@ -402,7 +402,7 @@ XdmcpRegisterAuthentication (
|
|||
newFuncs[AuthenticationNames.length-1].Validator = Validator;
|
||||
newFuncs[AuthenticationNames.length-1].Generator = Generator;
|
||||
newFuncs[AuthenticationNames.length-1].AddAuth = AddAuth;
|
||||
xfree (AuthenticationFuncsList);
|
||||
free(AuthenticationFuncsList);
|
||||
AuthenticationFuncsList = newFuncs;
|
||||
AuthenticationNames.data[AuthenticationNames.length-1] = AuthenticationName;
|
||||
AuthenticationDatas.data[AuthenticationDatas.length-1] = AuthenticationData;
|
||||
|
|
@ -492,18 +492,18 @@ XdmcpRegisterConnection (
|
|||
}
|
||||
if (ConnectionAddresses.length + 1 == 256)
|
||||
return;
|
||||
newAddress = xalloc (addrlen * sizeof (CARD8));
|
||||
newAddress = malloc(addrlen * sizeof (CARD8));
|
||||
if (!newAddress)
|
||||
return;
|
||||
if (!XdmcpReallocARRAY16 (&ConnectionTypes, ConnectionTypes.length + 1))
|
||||
{
|
||||
xfree (newAddress);
|
||||
free(newAddress);
|
||||
return;
|
||||
}
|
||||
if (!XdmcpReallocARRAYofARRAY8 (&ConnectionAddresses,
|
||||
ConnectionAddresses.length + 1))
|
||||
{
|
||||
xfree (newAddress);
|
||||
free(newAddress);
|
||||
return;
|
||||
}
|
||||
ConnectionTypes.data[ConnectionTypes.length - 1] = (CARD16) type;
|
||||
|
|
@ -533,12 +533,12 @@ XdmcpRegisterAuthorization (const char *name, int namelen)
|
|||
ARRAY8 authName;
|
||||
int i;
|
||||
|
||||
authName.data = xalloc (namelen * sizeof (CARD8));
|
||||
authName.data = malloc(namelen * sizeof (CARD8));
|
||||
if (!authName.data)
|
||||
return;
|
||||
if (!XdmcpReallocARRAYofARRAY8 (&AuthorizationNames, AuthorizationNames.length +1))
|
||||
{
|
||||
xfree (authName.data);
|
||||
free(authName.data);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < namelen; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue