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:
Mikhail Gusarov 2010-05-06 01:44:06 +07:00
commit 3f3ff971ec
345 changed files with 3011 additions and 3011 deletions

View file

@ -764,7 +764,7 @@ ShapeFreeClient (pointer data, XID id)
*pHead = pShapeEvent->next;
}
}
xfree ((pointer) pShapeEvent);
free((pointer) pShapeEvent);
return 1;
}
@ -778,9 +778,9 @@ ShapeFreeEvents (pointer data, XID id)
for (pCur = *pHead; pCur; pCur = pNext) {
pNext = pCur->next;
FreeResource (pCur->clientResource, ClientType);
xfree ((pointer) pCur);
free((pointer) pCur);
}
xfree ((pointer) pHead);
free((pointer) pHead);
return 1;
}
@ -817,7 +817,7 @@ ProcShapeSelectInput (ClientPtr client)
}
/* build the entry */
pNewShapeEvent = xalloc (sizeof (ShapeEventRec));
pNewShapeEvent = malloc(sizeof (ShapeEventRec));
if (!pNewShapeEvent)
return BadAlloc;
pNewShapeEvent->next = 0;
@ -839,7 +839,7 @@ ProcShapeSelectInput (ClientPtr client)
*/
if (!pHead)
{
pHead = xalloc (sizeof (ShapeEventPtr));
pHead = malloc(sizeof (ShapeEventPtr));
if (!pHead ||
!AddResource (pWin->drawable.id, ShapeEventType, (pointer)pHead))
{
@ -866,7 +866,7 @@ ProcShapeSelectInput (ClientPtr client)
pNewShapeEvent->next = pShapeEvent->next;
else
*pHead = pShapeEvent->next;
xfree (pShapeEvent);
free(pShapeEvent);
}
}
break;
@ -1030,7 +1030,7 @@ ProcShapeGetRectangles (ClientPtr client)
}
if (!region) {
nrects = 1;
rects = xalloc (sizeof (xRectangle));
rects = malloc(sizeof (xRectangle));
if (!rects)
return BadAlloc;
switch (stuff->kind) {
@ -1057,7 +1057,7 @@ ProcShapeGetRectangles (ClientPtr client)
BoxPtr box;
nrects = REGION_NUM_RECTS(region);
box = REGION_RECTS(region);
rects = xalloc (nrects * sizeof (xRectangle));
rects = malloc(nrects * sizeof (xRectangle));
if (!rects && nrects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
@ -1080,7 +1080,7 @@ ProcShapeGetRectangles (ClientPtr client)
}
WriteToClient (client, sizeof (rep), (char *) &rep);
WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
xfree (rects);
free(rects);
return client->noClientException;
}