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:
@@ -277,7 +277,7 @@ XvScreenInit(ScreenPtr pScreen)
|
||||
|
||||
/* ALLOCATE SCREEN PRIVATE RECORD */
|
||||
|
||||
pxvs = xalloc (sizeof (XvScreenRec));
|
||||
pxvs = malloc(sizeof (XvScreenRec));
|
||||
if (!pxvs)
|
||||
{
|
||||
ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
|
||||
@@ -314,7 +314,7 @@ XvCloseScreen(
|
||||
|
||||
(* pxvs->ddCloseScreen)(ii, pScreen);
|
||||
|
||||
xfree(pxvs);
|
||||
free(pxvs);
|
||||
|
||||
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
|
||||
|
||||
@@ -509,7 +509,7 @@ XvdiDestroyVideoNotifyList(pointer pn, XID id)
|
||||
{
|
||||
npn = cpn->next;
|
||||
if (cpn->client) FreeResource(cpn->id, XvRTVideoNotify);
|
||||
xfree(cpn);
|
||||
free(cpn);
|
||||
cpn = npn;
|
||||
}
|
||||
return Success;
|
||||
@@ -928,12 +928,12 @@ XvdiSelectVideoNotify(
|
||||
|
||||
if (!pn)
|
||||
{
|
||||
if (!(tpn = xalloc(sizeof(XvVideoNotifyRec))))
|
||||
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
||||
return BadAlloc;
|
||||
tpn->next = NULL;
|
||||
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
|
||||
{
|
||||
xfree(tpn);
|
||||
free(tpn);
|
||||
return BadAlloc;
|
||||
}
|
||||
}
|
||||
@@ -966,7 +966,7 @@ XvdiSelectVideoNotify(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(tpn = xalloc(sizeof(XvVideoNotifyRec))))
|
||||
if (!(tpn = malloc(sizeof(XvVideoNotifyRec))))
|
||||
return BadAlloc;
|
||||
tpn->next = pn->next;
|
||||
pn->next = tpn;
|
||||
@@ -1024,7 +1024,7 @@ XvdiSelectPortNotify(
|
||||
|
||||
if (!tpn)
|
||||
{
|
||||
if (!(tpn = xalloc(sizeof(XvPortNotifyRec))))
|
||||
if (!(tpn = malloc(sizeof(XvPortNotifyRec))))
|
||||
return BadAlloc;
|
||||
tpn->next = pPort->pNotify;
|
||||
pPort->pNotify = tpn;
|
||||
|
||||
Reference in New Issue
Block a user