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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user