mirror of
https://github.com/X11Libre/xf86-video-nv.git
synced 2026-03-24 01:24:21 +00:00
Don't use libcwrappers for calloc and free
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
@@ -173,7 +173,7 @@ G80DacDestroy(xf86OutputPtr output)
|
||||
{
|
||||
G80OutputDestroy(output);
|
||||
|
||||
xfree(output->driver_private);
|
||||
free(output->driver_private);
|
||||
output->driver_private = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ static Bool
|
||||
G80GetRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
if(pScrn->driverPrivate == NULL)
|
||||
pScrn->driverPrivate = xcalloc(sizeof(G80Rec), 1);
|
||||
pScrn->driverPrivate = calloc(sizeof(G80Rec), 1);
|
||||
|
||||
return (pScrn->driverPrivate != NULL);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ G80GetRec(ScrnInfoPtr pScrn)
|
||||
static void
|
||||
G80FreeRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Process options */
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
if(!(pNv->Options = xalloc(sizeof(G80Options)))) goto fail;
|
||||
if(!(pNv->Options = malloc(sizeof(G80Options)))) goto fail;
|
||||
memcpy(pNv->Options, G80Options, sizeof(G80Options));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNv->Options);
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ G80I2CInit(ScrnInfoPtr pScrn, const char *name, const int port)
|
||||
if(xf86I2CBusInit(i2c)) {
|
||||
return i2c;
|
||||
} else {
|
||||
xfree(i2c);
|
||||
free(i2c);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ G80SorDestroy(xf86OutputPtr output)
|
||||
|
||||
xf86DeleteMode(&pPriv->nativeMode, pPriv->nativeMode);
|
||||
|
||||
xfree(output->driver_private);
|
||||
free(output->driver_private);
|
||||
output->driver_private = NULL;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ G80CreateSor(ScrnInfoPtr pScrn, ORNum or, PanelType panelType)
|
||||
if(!pPriv->nativeMode) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Failed to find LVDS native mode\n");
|
||||
xfree(pPriv);
|
||||
free(pPriv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,18 +119,18 @@ TransformCursor (NVPtr pNv)
|
||||
/* convert to color cursor */
|
||||
if(pNv->alphaCursor) {
|
||||
dwords = 64 * 64;
|
||||
if(!(tmp = Xcalloc(dwords * 4))) return;
|
||||
if(!(tmp = calloc(1, dwords * 4))) return;
|
||||
ConvertCursor8888(pNv, pNv->curImage, tmp);
|
||||
} else {
|
||||
dwords = (32 * 32) >> 1;
|
||||
if(!(tmp = Xcalloc(dwords * 4))) return;
|
||||
if(!(tmp = calloc(1, dwords * 4))) return;
|
||||
ConvertCursor1555(pNv, pNv->curImage, (CARD16*)tmp);
|
||||
}
|
||||
|
||||
for(i = 0; i < dwords; i++)
|
||||
pNv->CURSOR[i] = tmp[i];
|
||||
|
||||
xfree(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -69,7 +69,7 @@ SECOND_PASS:
|
||||
if(secondPitch)
|
||||
pitch = secondPitch;
|
||||
|
||||
if(!(newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
break;
|
||||
|
||||
modes = newmodes;
|
||||
|
||||
@@ -629,7 +629,7 @@ NVFreeRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
if (pScrn->driverPrivate == NULL)
|
||||
return;
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -847,7 +847,7 @@ static Bool NVKernelModesettingEnabled(struct pci_device *device)
|
||||
busIdString = DRICreatePCIBusID(device);
|
||||
|
||||
ret = drmCheckModesettingSupported(busIdString);
|
||||
xfree(busIdString);
|
||||
free(busIdString);
|
||||
|
||||
return (ret == 0);
|
||||
}
|
||||
@@ -994,8 +994,8 @@ NVProbe(DriverPtr drv, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
xfree(devSections);
|
||||
xfree(usedChips);
|
||||
free(devSections);
|
||||
free(usedChips);
|
||||
|
||||
return foundScreen;
|
||||
}
|
||||
@@ -1177,13 +1177,13 @@ NVCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
if (pNv->CursorInfoRec)
|
||||
xf86DestroyCursorInfoRec(pNv->CursorInfoRec);
|
||||
if (pNv->ShadowPtr)
|
||||
xfree(pNv->ShadowPtr);
|
||||
free(pNv->ShadowPtr);
|
||||
if (pNv->DGAModes)
|
||||
xfree(pNv->DGAModes);
|
||||
free(pNv->DGAModes);
|
||||
if (pNv->overlayAdaptor)
|
||||
xfree(pNv->overlayAdaptor);
|
||||
free(pNv->overlayAdaptor);
|
||||
if (pNv->blitAdaptor)
|
||||
xfree(pNv->blitAdaptor);
|
||||
free(pNv->blitAdaptor);
|
||||
|
||||
pScrn->vtSema = FALSE;
|
||||
pScreen->CloseScreen = pNv->CloseScreen;
|
||||
@@ -1306,7 +1306,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
return FALSE;
|
||||
|
||||
i = pEnt->index;
|
||||
xfree(pEnt);
|
||||
free(pEnt);
|
||||
|
||||
nvProbeDDC(pScrn, i);
|
||||
return TRUE;
|
||||
@@ -1503,7 +1503,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
|
||||
/* Process the options */
|
||||
if (!(pNv->Options = xalloc(sizeof(NVOptions))))
|
||||
if (!(pNv->Options = malloc(sizeof(NVOptions))))
|
||||
return FALSE;
|
||||
memcpy(pNv->Options, NVOptions, sizeof(NVOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNv->Options);
|
||||
@@ -2439,7 +2439,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
|
||||
if(pNv->ShadowFB) {
|
||||
pNv->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
|
||||
pNv->ShadowPtr = xalloc(pNv->ShadowPitch * shadowHeight);
|
||||
pNv->ShadowPtr = malloc(pNv->ShadowPitch * shadowHeight);
|
||||
displayWidth = pNv->ShadowPitch / (pScrn->bitsPerPixel >> 3);
|
||||
FBStart = pNv->ShadowPtr;
|
||||
} else {
|
||||
|
||||
@@ -668,11 +668,11 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
(!monitorA->features.input_type && !pNv->FlatPanel))
|
||||
{
|
||||
if(monitorB) {
|
||||
xfree(monitorB);
|
||||
free(monitorB);
|
||||
monitorB = NULL;
|
||||
}
|
||||
} else {
|
||||
xfree(monitorA);
|
||||
free(monitorA);
|
||||
monitorA = NULL;
|
||||
}
|
||||
}
|
||||
@@ -681,7 +681,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
|
||||
if((monitorB->features.input_type && !pNv->FlatPanel) ||
|
||||
(!monitorB->features.input_type && pNv->FlatPanel))
|
||||
{
|
||||
xfree(monitorB);
|
||||
free(monitorB);
|
||||
} else {
|
||||
monitorA = monitorB;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ void NVInitVideo (ScreenPtr pScreen)
|
||||
if(overlayAdaptor) size++;
|
||||
if(blitAdaptor) size++;
|
||||
|
||||
if((newAdaptors = xalloc(size * sizeof(XF86VideoAdaptorPtr*)))) {
|
||||
if((newAdaptors = malloc(size * sizeof(XF86VideoAdaptorPtr*)))) {
|
||||
if(num_adaptors) {
|
||||
memcpy(newAdaptors, adaptors,
|
||||
num_adaptors * sizeof(XF86VideoAdaptorPtr));
|
||||
@@ -336,7 +336,7 @@ void NVInitVideo (ScreenPtr pScreen)
|
||||
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
|
||||
|
||||
if (newAdaptors)
|
||||
xfree(newAdaptors);
|
||||
free(newAdaptors);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ NVSetupBlitVideo (ScreenPtr pScreen)
|
||||
NVPortPrivPtr pPriv;
|
||||
int i;
|
||||
|
||||
if (!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
sizeof(NVPortPrivRec) +
|
||||
(sizeof(DevUnion) * NUM_BLIT_PORTS))))
|
||||
{
|
||||
@@ -411,7 +411,7 @@ NVSetupOverlayVideo (ScreenPtr pScreen)
|
||||
XF86VideoAdaptorPtr adapt;
|
||||
NVPortPrivPtr pPriv;
|
||||
|
||||
if (!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
|
||||
sizeof(NVPortPrivRec) +
|
||||
sizeof(DevUnion))))
|
||||
{
|
||||
|
||||
@@ -72,13 +72,13 @@ RivaTransformCursor (RivaPtr pRiva)
|
||||
int i, dwords;
|
||||
|
||||
dwords = (32 * 32) >> 1;
|
||||
if(!(tmp = Xcalloc(dwords * 4))) return;
|
||||
if(!(tmp = calloc(1, dwords * 4))) return;
|
||||
RivaConvertCursor1555(pRiva, pRiva->curImage, (CARD16*)tmp);
|
||||
|
||||
for(i = 0; i < dwords; i++)
|
||||
pRiva->riva.CURSOR[i] = tmp[i];
|
||||
|
||||
xfree(tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -69,7 +69,7 @@ SECOND_PASS:
|
||||
if(secondPitch)
|
||||
pitch = secondPitch;
|
||||
|
||||
if(!(newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
if(!(newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec))))
|
||||
break;
|
||||
|
||||
modes = newmodes;
|
||||
|
||||
@@ -121,7 +121,7 @@ RivaFreeRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
if (pScrn->driverPrivate == NULL)
|
||||
return;
|
||||
xfree(pScrn->driverPrivate);
|
||||
free(pScrn->driverPrivate);
|
||||
pScrn->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -261,11 +261,11 @@ RivaCloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||
if (pRiva->CursorInfoRec)
|
||||
xf86DestroyCursorInfoRec(pRiva->CursorInfoRec);
|
||||
if (pRiva->ShadowPtr)
|
||||
xfree(pRiva->ShadowPtr);
|
||||
free(pRiva->ShadowPtr);
|
||||
if (pRiva->DGAModes)
|
||||
xfree(pRiva->DGAModes);
|
||||
free(pRiva->DGAModes);
|
||||
if ( pRiva->expandBuffer )
|
||||
xfree(pRiva->expandBuffer);
|
||||
free(pRiva->expandBuffer);
|
||||
|
||||
pScrn->vtSema = FALSE;
|
||||
pScreen->CloseScreen = pRiva->CloseScreen;
|
||||
@@ -345,7 +345,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
return FALSE;
|
||||
|
||||
i = pEnt->index;
|
||||
xfree(pEnt);
|
||||
free(pEnt);
|
||||
|
||||
rivaProbeDDC(pScrn, i);
|
||||
return TRUE;
|
||||
@@ -492,7 +492,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
xf86CollectOptions(pScrn, NULL);
|
||||
|
||||
/* Process the options */
|
||||
if (!(pRiva->Options = xalloc(sizeof(RivaOptions))))
|
||||
if (!(pRiva->Options = malloc(sizeof(RivaOptions))))
|
||||
return FALSE;
|
||||
memcpy(pRiva->Options, RivaOptions, sizeof(RivaOptions));
|
||||
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pRiva->Options);
|
||||
@@ -1103,7 +1103,7 @@ RivaScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
|
||||
if(pRiva->ShadowFB) {
|
||||
pRiva->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
|
||||
pRiva->ShadowPtr = xalloc(pRiva->ShadowPitch * height);
|
||||
pRiva->ShadowPtr = malloc(pRiva->ShadowPitch * height);
|
||||
displayWidth = pRiva->ShadowPitch / (pScrn->bitsPerPixel >> 3);
|
||||
FBStart = pRiva->ShadowPtr;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user