diff options
author | Julien Cristau <jcristau@debian.org> | 2012-05-12 13:44:58 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2012-05-12 13:44:58 +0200 |
commit | db87c42485f7748a7a5ccdc94f4fc6065766bd0f (patch) | |
tree | 160cb2bd4245f1003e86282c188b8e9d6100cae1 | |
parent | fb368727b9251b23f937a6432946dd376a153e27 (diff) |
Use standard allocation functions
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | src/s3_bios.c | 4 | ||||
-rw-r--r-- | src/s3_dga.c | 6 | ||||
-rw-r--r-- | src/s3_driver.c | 18 | ||||
-rw-r--r-- | src/s3_video.c | 9 |
4 files changed, 16 insertions, 21 deletions
diff --git a/src/s3_bios.c b/src/s3_bios.c index 6ea9181..323e2ce 100644 --- a/src/s3_bios.c +++ b/src/s3_bios.c @@ -45,7 +45,7 @@ static unsigned char *find_bios_string(ScrnInfoPtr pScrn, int BIOSbase, S3Ptr pS3 = S3PTR(pScrn); - bios = xalloc(BIOS_BSIZE); + bios = malloc(BIOS_BSIZE); if (bios = NULL) return NULL; @@ -86,7 +86,7 @@ static unsigned char *find_bios_string(ScrnInfoPtr pScrn, int BIOSbase, return &bios[j+l2]; } error: - xfree(bios); + free(bios); return NULL; } diff --git a/src/s3_dga.c b/src/s3_dga.c index 680aa02..d585ba8 100644 --- a/src/s3_dga.c +++ b/src/s3_dga.c @@ -82,15 +82,15 @@ static DGAModePtr S3SetupDGAMode(ScrnInfoPtr pScrn, DGAModePtr modes, otherPitch = secondPitch ? secondPitch : pMode->HDisplay; if (pMode->HDisplay != otherPitch) { - newmodes = xrealloc(modes, (*num + 2) * sizeof(DGAModeRec)); + newmodes = realloc(modes, (*num + 2) * sizeof(DGAModeRec)); oneMore = TRUE; } else { - newmodes = xrealloc(modes, (*num + 1) * sizeof(DGAModeRec)); + newmodes = realloc(modes, (*num + 1) * sizeof(DGAModeRec)); oneMore = FALSE; } if (!newmodes) { - xfree(modes); + free(modes); return NULL; } diff --git a/src/s3_driver.c b/src/s3_driver.c index 2011dfc..df74357 100644 --- a/src/s3_driver.c +++ b/src/s3_driver.c @@ -237,10 +237,7 @@ static Bool S3GetRec(ScrnInfoPtr pScrn) static void S3FreeRec(ScrnInfoPtr pScrn) { - if (!pScrn->driverPrivate) - return; - - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } @@ -271,7 +268,7 @@ static Bool S3Probe(DriverPtr drv, int flags) devSections, numDevSections, drv, &usedChips); - xfree(devSections); + free(devSections); if (numUsed <= 0) return FALSE; @@ -298,7 +295,7 @@ static Bool S3Probe(DriverPtr drv, int flags) foundScreen = TRUE; } - xfree(usedChips); + free(usedChips); return foundScreen; } @@ -427,7 +424,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags) pEnt = xf86GetEntityInfo(pScrn->entityList[0]); #ifndef XSERVER_LIBPCIACCESS if (pEnt->resources) { - xfree(pEnt); + free(pEnt); S3FreeRec(pScrn); return FALSE; } @@ -487,7 +484,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags) } else pS3->ChipRev = PCI_DEV_REVISION(pS3->PciInfo); - xfree(pEnt); + free(pEnt); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); @@ -795,7 +792,7 @@ static Bool S3ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, /* no screen rotation assumed */ if(pS3->shadowFB) { pS3->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pS3->ShadowPtr = xalloc(pS3->ShadowPitch * height); + pS3->ShadowPtr = malloc(pS3->ShadowPitch * height); displayWidth = pS3->ShadowPitch / (pScrn->bitsPerPixel >> 3); } else { pS3->ShadowPtr = NULL; @@ -1105,8 +1102,7 @@ Bool S3CloseScreen(int scrnIndex, ScreenPtr pScreen) S3UnmapMem(pScrn); } - if (pS3->DGAModes) - xfree(pS3->DGAModes); + free(pS3->DGAModes); pS3->DGAModes = NULL; pScrn->vtSema = FALSE; diff --git a/src/s3_video.c b/src/s3_video.c index 9a2d458..f47bf20 100644 --- a/src/s3_video.c +++ b/src/s3_video.c @@ -79,7 +79,7 @@ void S3InitVideo(ScreenPtr pScreen) adaptors = &newAdaptor; } else { newAdaptors = /* need to free this someplace */ - xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); if(newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); @@ -93,8 +93,7 @@ void S3InitVideo(ScreenPtr pScreen) if(num_adaptors) xf86XVScreenInit(pScreen, adaptors, num_adaptors); - if(newAdaptors) - xfree(newAdaptors); + free(newAdaptors); } @@ -211,10 +210,10 @@ static XF86VideoAdaptorPtr S3AllocAdaptor(ScrnInfoPtr pScrn) if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) return NULL; - if(!(pPriv = xcalloc(1, sizeof(S3PortPrivRec) + + if(!(pPriv = calloc(1, sizeof(S3PortPrivRec) + (sizeof(DevUnion) * S3_MAX_PORTS)))) { - xfree(adapt); + free(adapt); return NULL; } |