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
parent 96c7ab27c3
commit 3f3ff971ec
345 changed files with 3011 additions and 3011 deletions

View File

@@ -98,10 +98,10 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen)
if (s->pixmap_data_size < rowbytes) {
if (s->pixmap_data != NULL)
xfree(s->pixmap_data);
free(s->pixmap_data);
s->pixmap_data_size = rowbytes;
s->pixmap_data = xalloc(s->pixmap_data_size);
s->pixmap_data = malloc(s->pixmap_data_size);
if (s->pixmap_data == NULL)
return;
@@ -157,12 +157,12 @@ RootlessCloseScreen(int i, ScreenPtr pScreen)
pScreen->CloseScreen = s->CloseScreen;
if (s->pixmap_data != NULL) {
xfree (s->pixmap_data);
free(s->pixmap_data);
s->pixmap_data = NULL;
s->pixmap_data_size = 0;
}
xfree(s);
free(s);
return pScreen->CloseScreen(i, pScreen);
}
@@ -641,7 +641,7 @@ RootlessAllocatePrivates(ScreenPtr pScreen)
if (!dixRequestPrivate(rootlessGCPrivateKey, sizeof(RootlessGCRec)))
return FALSE;
s = xalloc(sizeof(RootlessScreenRec));
s = malloc(sizeof(RootlessScreenRec));
if (! s) return FALSE;
SETSCREENREC(pScreen, s);

View File

@@ -187,7 +187,7 @@ RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
REGION_UNINIT(pScreen, &winRec->damage);
#endif
xfree(winRec);
free(winRec);
SETWINREC(pWin, NULL);
}
@@ -421,7 +421,7 @@ RootlessEnsureFrame(WindowPtr pWin)
if (pWin->drawable.class != InputOutput)
return NULL;
winRec = xalloc(sizeof(RootlessWindowRec));
winRec = malloc(sizeof(RootlessWindowRec));
if (!winRec)
return NULL;
@@ -448,7 +448,7 @@ RootlessEnsureFrame(WindowPtr pWin)
pShape))
{
RL_DEBUG_MSG("implementation failed to create frame!\n");
xfree(winRec);
free(winRec);
SETWINREC(pWin, NULL);
return NULL;
}
@@ -984,7 +984,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
copy_rect_width = copy_rect.x2 - copy_rect.x1;
copy_rect_height = copy_rect.y2 - copy_rect.y1;
copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31;
gResizeDeathBits = xalloc(copy_rowbytes
gResizeDeathBits = malloc(copy_rowbytes
* copy_rect_height);
if (copy_rect_width * copy_rect_height >
@@ -1028,7 +1028,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
RootlessStartDrawing(pWin);
gResizeDeathBits = xalloc(winRec->bytesPerRow * winRec->height);
gResizeDeathBits = malloc(winRec->bytesPerRow * winRec->height);
memcpy(gResizeDeathBits, winRec->pixelData,
winRec->bytesPerRow * winRec->height);
@@ -1170,7 +1170,7 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY,
}
if (gResizeDeathBits != NULL) {
xfree(gResizeDeathBits);
free(gResizeDeathBits);
gResizeDeathBits = NULL;
}