Replace deprecated xalloc/xfree with malloc/free.
This commit is contained in:
parent
7a02c9510a
commit
40c4e40724
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: wsfb_driver.c,v 1.23 2010/08/29 15:20:40 matthieu Exp $ */
|
||||
/* $OpenBSD: wsfb_driver.c,v 1.24 2011/11/05 14:40:51 matthieu Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Matthieu Herrb
|
||||
* All rights reserved.
|
||||
@ -277,7 +277,7 @@ WsfbFreeRec(ScrnInfoPtr pScrn)
|
||||
|
||||
if (pScrn->driverPrivate == NULL)
|
||||
return;
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@ -391,7 +391,7 @@ WsfbProbe(DriverPtr drv, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
xfree(devSections);
|
||||
free(devSections);
|
||||
TRACE("probe done");
|
||||
return foundScreen;
|
||||
}
|
||||
@ -538,27 +538,27 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
*/
|
||||
if (fPtr->info.cmsize != 0) {
|
||||
fPtr->saved_cmap.red =
|
||||
(unsigned char *)xalloc(fPtr->info.cmsize);
|
||||
(unsigned char *)malloc(fPtr->info.cmsize);
|
||||
if (fPtr->saved_cmap.red == NULL) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Cannot malloc %d bytes\n", fPtr->info.cmsize);
|
||||
return FALSE;
|
||||
}
|
||||
fPtr->saved_cmap.green =
|
||||
(unsigned char *)xalloc(fPtr->info.cmsize);
|
||||
(unsigned char *)malloc(fPtr->info.cmsize);
|
||||
if (fPtr->saved_cmap.green == NULL) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Cannot malloc %d bytes\n", fPtr->info.cmsize);
|
||||
xfree(fPtr->saved_cmap.red);
|
||||
free(fPtr->saved_cmap.red);
|
||||
return FALSE;
|
||||
}
|
||||
fPtr->saved_cmap.blue =
|
||||
(unsigned char *)xalloc(fPtr->info.cmsize);
|
||||
(unsigned char *)malloc(fPtr->info.cmsize);
|
||||
if (fPtr->saved_cmap.blue == NULL) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Cannot malloc %d bytes\n", fPtr->info.cmsize);
|
||||
xfree(fPtr->saved_cmap.red);
|
||||
xfree(fPtr->saved_cmap.green);
|
||||
free(fPtr->saved_cmap.red);
|
||||
free(fPtr->saved_cmap.green);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -663,7 +663,8 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Handle options. */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if (!(fPtr->Options = xalloc(sizeof(WsfbOptions))))
|
||||
fPtr->Options = (OptionInfoRec *)malloc(sizeof(WsfbOptions));
|
||||
if (fPtr->Options == NULL)
|
||||
return FALSE;
|
||||
memcpy(fPtr->Options, WsfbOptions, sizeof(WsfbOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options,
|
||||
@ -714,7 +715,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
/* Fake video mode struct. */
|
||||
mode = (DisplayModePtr)xalloc(sizeof(DisplayModeRec));
|
||||
mode = (DisplayModePtr)malloc(sizeof(DisplayModeRec));
|
||||
mode->prev = mode;
|
||||
mode->next = mode;
|
||||
mode->name = "wsfb current mode";
|
||||
@ -918,7 +919,7 @@ WsfbScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
fPtr->fbstart = fPtr->fbmem;
|
||||
|
||||
if (fPtr->shadowFB) {
|
||||
fPtr->shadow = xcalloc(1, pScrn->virtualX * pScrn->virtualY *
|
||||
fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY *
|
||||
pScrn->bitsPerPixel/8);
|
||||
|
||||
if (!fPtr->shadow) {
|
||||
@ -1081,7 +1082,7 @@ WsfbCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
}
|
||||
#ifdef XFreeXDGA
|
||||
if (fPtr->pDGAMode) {
|
||||
xfree(fPtr->pDGAMode);
|
||||
free(fPtr->pDGAMode);
|
||||
fPtr->pDGAMode = NULL;
|
||||
fPtr->nDGAMode = 0;
|
||||
}
|
||||
@ -1413,7 +1414,7 @@ WsfbDGAAddModes(ScrnInfoPtr pScrn)
|
||||
DGAModePtr pDGAMode;
|
||||
|
||||
do {
|
||||
pDGAMode = xrealloc(fPtr->pDGAMode,
|
||||
pDGAMode = realloc(fPtr->pDGAMode,
|
||||
(fPtr->nDGAMode + 1) * sizeof(DGAModeRec));
|
||||
if (!pDGAMode)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user