[PATCH sis 02/15] Replace deprecated x(c)alloc/xfree with m/calloc/free

Timo Aaltonen tjaalton at ubuntu.com
Wed Apr 6 09:50:04 PDT 2011


and xrealloc with realloc.

Signed-off-by: Timo Aaltonen <timo.aaltonen at canonical.com>
---
 src/initextx.c      |   18 ++++----
 src/sis6326_video.c |    6 +-
 src/sis_dga.c       |    6 +-
 src/sis_dri.c       |   24 +++++-----
 src/sis_driver.c    |  128 +++++++++++++++++++++++++-------------------------
 src/sis_memcpy.c    |   10 ++--
 src/sis_opt.c       |   12 ++--
 src/sis_utility.c   |    6 +-
 src/sis_vga.c       |    2 +-
 src/sis_video.c     |    8 ++--
 10 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/src/initextx.c b/src/initextx.c
index 5c00398..1e84d0f 100644
--- a/src/initextx.c
+++ b/src/initextx.c
@@ -238,10 +238,10 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 	 continue;
       }
 
-      if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+      if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
       memset(new, 0, sizeof(DisplayModeRec));
-      if(!(new->name = xalloc(10))) {
-	 xfree(new);
+      if(!(new->name = malloc(10))) {
+	 free(new);
 	 return first;
       }
       if(!first) first = new;
@@ -385,11 +385,11 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 		     }
 		  }
 
-		  if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+		  if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
 
 		  memset(new, 0, sizeof(DisplayModeRec));
-		  if(!(new->name = xalloc(12))) {
-		     xfree(new);
+		  if(!(new->name = malloc(12))) {
+		     free(new);
 		     return first;
 		  }
 		  if(!first) first = new;
@@ -470,11 +470,11 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
 
 	 if(pSiS->SiS_Pr->CP_DataValid[i]) {
 
-	    if(!(new = xalloc(sizeof(DisplayModeRec)))) return first;
+	    if(!(new = malloc(sizeof(DisplayModeRec)))) return first;
 
 	    memset(new, 0, sizeof(DisplayModeRec));
-	    if(!(new->name = xalloc(10))) {
-	       xfree(new);
+	    if(!(new->name = malloc(10))) {
+	       free(new);
 	       return first;
 	    }
 	    if(!first) first = new;
diff --git a/src/sis6326_video.c b/src/sis6326_video.c
index c6b18e2..66352b7 100644
--- a/src/sis6326_video.c
+++ b/src/sis6326_video.c
@@ -170,7 +170,7 @@ void SIS6326InitVideo(ScreenPtr pScreen)
 		adaptors = &newAdaptor;
 	} else {
 		/* need to free this someplace */
-		newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+		newAdaptors = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
 		if(newAdaptors) {
 			memcpy(newAdaptors, adaptors, num_adaptors *
 				sizeof(XF86VideoAdaptorPtr));
@@ -185,7 +185,7 @@ void SIS6326InitVideo(ScreenPtr pScreen)
 	xf86XVScreenInit(pScreen, adaptors, num_adaptors);
 
     if(newAdaptors)
-	xfree(newAdaptors);
+	free(newAdaptors);
 }
 
 /* client libraries expect an encoding */
@@ -531,7 +531,7 @@ SIS6326SetupImageVideo(ScreenPtr pScreen)
        return NULL;
 #endif
 
-    if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+    if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
                             sizeof(SISPortPrivRec) +
                             sizeof(DevUnion))))
        return NULL;
diff --git a/src/sis_dga.c b/src/sis_dga.c
index d358645..16b0ee4 100644
--- a/src/sis_dga.c
+++ b/src/sis_dga.c
@@ -150,18 +150,18 @@ SISSetupDGAMode(
 
 	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;
 	}
 	modes = newmodes;
diff --git a/src/sis_dri.c b/src/sis_dri.c
index 3a476a2..97ed951 100644
--- a/src/sis_dri.c
+++ b/src/sis_dri.c
@@ -149,19 +149,19 @@ SISInitVisualConfigs(ScreenPtr pScreen)
   case 32:
     numConfigs = (useZ16) ? 8 : 16;
 
-    if(!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig),
+    if(!(pConfigs = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
 						   numConfigs))) {
        return FALSE;
     }
-    if(!(pSISConfigs = (SISConfigPrivPtr)xcalloc(sizeof(SISConfigPrivRec),
+    if(!(pSISConfigs = (SISConfigPrivPtr)calloc(sizeof(SISConfigPrivRec),
 						    numConfigs))) {
-       xfree(pConfigs);
+       free(pConfigs);
        return FALSE;
     }
-    if(!(pSISConfigPtrs = (SISConfigPrivPtr*)xcalloc(sizeof(SISConfigPrivPtr),
+    if(!(pSISConfigPtrs = (SISConfigPrivPtr*)calloc(sizeof(SISConfigPrivPtr),
 							  numConfigs))) {
-       xfree(pConfigs);
-       xfree(pSISConfigs);
+       free(pConfigs);
+       free(pSISConfigs);
        return FALSE;
     }
     for(i=0; i<numConfigs; i++) pSISConfigPtrs[i] = &pSISConfigs[i];
@@ -319,7 +319,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
      pDRIInfo->busIdString = DRICreatePCIBusID(pSIS->PciInfo);
   } else {
 #endif
-     pDRIInfo->busIdString = xalloc(64);
+     pDRIInfo->busIdString = malloc(64);
      sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
 	     pSIS->PciBus, pSIS->PciDevice, pSIS->PciFunc);
 #ifdef SISHAVECREATEBUSID
@@ -383,7 +383,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
   pDRIInfo->SAREASize = SAREA_MAX;
 #endif
 
-  if(!(pSISDRI = (SISDRIPtr)xcalloc(sizeof(SISDRIRec), 1))) {
+  if(!(pSISDRI = (SISDRIPtr)calloc(sizeof(SISDRIRec), 1))) {
      DRIDestroyInfoRec(pSIS->pDRIInfo);
      pSIS->pDRIInfo = 0;
      return FALSE;
@@ -401,7 +401,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
 
   if(!DRIScreenInit(pScreen, pDRIInfo, &pSIS->drmSubFD)) {
      xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling the DRI.\n");
-     xfree(pDRIInfo->devPrivate);
+     free(pDRIInfo->devPrivate);
      pDRIInfo->devPrivate = 0;
      DRIDestroyInfoRec(pSIS->pDRIInfo);
      pSIS->pDRIInfo = 0;
@@ -794,7 +794,7 @@ SISDRICloseScreen(ScreenPtr pScreen)
 
   if(pSIS->pDRIInfo) {
      if(pSIS->pDRIInfo->devPrivate) {
-	xfree(pSIS->pDRIInfo->devPrivate);
+	free(pSIS->pDRIInfo->devPrivate);
 	pSIS->pDRIInfo->devPrivate = NULL;
      }
      DRIDestroyInfoRec(pSIS->pDRIInfo);
@@ -802,12 +802,12 @@ SISDRICloseScreen(ScreenPtr pScreen)
   }
 
   if(pSIS->pVisualConfigs) {
-     xfree(pSIS->pVisualConfigs);
+     free(pSIS->pVisualConfigs);
      pSIS->pVisualConfigs = NULL;
   }
 
   if(pSIS->pVisualConfigsPriv) {
-     xfree(pSIS->pVisualConfigsPriv);
+     free(pSIS->pVisualConfigsPriv);
      pSIS->pVisualConfigsPriv = NULL;
   }
 
diff --git a/src/sis_driver.c b/src/sis_driver.c
index d95b5f1..8ce1cdd 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -299,9 +299,9 @@ SISFreeRec(ScrnInfoPtr pScrn)
     pSiSEnt = pSiS->entityPrivate;
 #endif
 
-    if(pSiS->pstate) xfree(pSiS->pstate);
+    if(pSiS->pstate) free(pSiS->pstate);
     pSiS->pstate = NULL;
-    if(pSiS->fonts) xfree(pSiS->fonts);
+    if(pSiS->fonts) free(pSiS->fonts);
     pSiS->fonts = NULL;
 
 #ifdef SISDUALHEAD
@@ -312,11 +312,11 @@ SISFreeRec(ScrnInfoPtr pScrn)
 	   * and we need the BIOS image and SiS_Private for the first
 	   * head.
 	   */
-	  if(pSiSEnt->BIOS) xfree(pSiSEnt->BIOS);
+	  if(pSiSEnt->BIOS) free(pSiSEnt->BIOS);
 	  pSiSEnt->BIOS = pSiS->BIOS = NULL;
-	  if(pSiSEnt->SiS_Pr) xfree(pSiSEnt->SiS_Pr);
+	  if(pSiSEnt->SiS_Pr) free(pSiSEnt->SiS_Pr);
 	  pSiSEnt->SiS_Pr = pSiS->SiS_Pr = NULL;
-	  if(pSiSEnt->RenderAccelArray) xfree(pSiSEnt->RenderAccelArray);
+	  if(pSiSEnt->RenderAccelArray) free(pSiSEnt->RenderAccelArray);
 	  pSiSEnt->RenderAccelArray = pSiS->RenderAccelArray = NULL;
 	  pSiSEnt->pScrn_1 = NULL;
        } else {
@@ -327,21 +327,21 @@ SISFreeRec(ScrnInfoPtr pScrn)
        }
     } else {
 #endif
-       if(pSiS->BIOS) xfree(pSiS->BIOS);
+       if(pSiS->BIOS) free(pSiS->BIOS);
        pSiS->BIOS = NULL;
-       if(pSiS->SiS_Pr) xfree(pSiS->SiS_Pr);
+       if(pSiS->SiS_Pr) free(pSiS->SiS_Pr);
        pSiS->SiS_Pr = NULL;
-       if(pSiS->RenderAccelArray) xfree(pSiS->RenderAccelArray);
+       if(pSiS->RenderAccelArray) free(pSiS->RenderAccelArray);
        pSiS->RenderAccelArray = NULL;
 #ifdef SISDUALHEAD
     }
 #endif
 #ifdef SISMERGED
-    if(pSiS->CRT2HSync) xfree(pSiS->CRT2HSync);
+    if(pSiS->CRT2HSync) free(pSiS->CRT2HSync);
     pSiS->CRT2HSync = NULL;
-    if(pSiS->CRT2VRefresh) xfree(pSiS->CRT2VRefresh);
+    if(pSiS->CRT2VRefresh) free(pSiS->CRT2VRefresh);
     pSiS->CRT2VRefresh = NULL;
-    if(pSiS->MetaModes) xfree(pSiS->MetaModes);
+    if(pSiS->MetaModes) free(pSiS->MetaModes);
     pSiS->MetaModes = NULL;
     if(pSiS->CRT2pScrn) {
        if(pSiS->CRT2pScrn->modes) {
@@ -353,10 +353,10 @@ SISFreeRec(ScrnInfoPtr pScrn)
 	     while(pSiS->CRT2pScrn->monitor->Modes)
 	        xf86DeleteMode(&pSiS->CRT2pScrn->monitor->Modes, pSiS->CRT2pScrn->monitor->Modes);
 	  }
-	  if(pSiS->CRT2pScrn->monitor->DDC) xfree(pSiS->CRT2pScrn->monitor->DDC);
-	  xfree(pSiS->CRT2pScrn->monitor);
+	  if(pSiS->CRT2pScrn->monitor->DDC) free(pSiS->CRT2pScrn->monitor->DDC);
+	  free(pSiS->CRT2pScrn->monitor);
        }
-       xfree(pSiS->CRT2pScrn);
+       free(pSiS->CRT2pScrn);
        pSiS->CRT2pScrn = NULL;
     }
     if(pSiS->CRT1Modes) {
@@ -366,8 +366,8 @@ SISFreeRec(ScrnInfoPtr pScrn)
 	     do {
 	        DisplayModePtr p = pScrn->currentMode->next;
 	        if(pScrn->currentMode->Private)
-	 	  xfree(pScrn->currentMode->Private);
-	        xfree(pScrn->currentMode);
+	 	  free(pScrn->currentMode->Private);
+	        free(pScrn->currentMode);
 	        pScrn->currentMode = p;
 	     } while(pScrn->currentMode != pScrn->modes);
 	  }
@@ -380,7 +380,7 @@ SISFreeRec(ScrnInfoPtr pScrn)
 #endif
     while(pSiS->SISVESAModeList) {
        sisModeInfoPtr mp = pSiS->SISVESAModeList->next;
-       xfree(pSiS->SISVESAModeList);
+       free(pSiS->SISVESAModeList);
        pSiS->SISVESAModeList = mp;
     }
     if(pSiS->pVbe) vbeFree(pSiS->pVbe);
@@ -392,7 +392,7 @@ SISFreeRec(ScrnInfoPtr pScrn)
 
     if(pScrn->driverPrivate == NULL)
         return;
-    xfree(pScrn->driverPrivate);
+    free(pScrn->driverPrivate);
     pScrn->driverPrivate = NULL;
 }
 
@@ -501,7 +501,7 @@ SISProbe(DriverPtr drv, int flags)
 			numDevSections, drv, &usedChipsXGI);
 
     /* Free it since we don't need that list after this */
-    xfree(devSections);
+    free(devSections);
 
     numUsed = numUsedSiS + numUsedXGI;
 
@@ -577,8 +577,8 @@ SISProbe(DriverPtr drv, int flags)
 
     }
 
-    if(usedChipsSiS) xfree(usedChipsSiS);
-    if(usedChipsXGI) xfree(usedChipsXGI);
+    if(usedChipsSiS) free(usedChipsSiS);
+    if(usedChipsXGI) free(usedChipsXGI);
 
     return foundScreen;
 }
@@ -642,10 +642,10 @@ SISCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn)
    if(!(nramp = xf86GetGammaRampSize(pScreen))) return;
 
    for(i=0; i<3; i++) {
-      ramp[i] = (UShort *)xalloc(nramp * sizeof(UShort));
+      ramp[i] = (UShort *)malloc(nramp * sizeof(UShort));
       if(!ramp[i]) {
-	 if(ramp[0]) { xfree(ramp[0]); ramp[0] = NULL; }
-	 if(ramp[1]) { xfree(ramp[1]); ramp[1] = NULL; }
+	 if(ramp[0]) { free(ramp[0]); ramp[0] = NULL; }
+	 if(ramp[1]) { free(ramp[1]); ramp[1] = NULL; }
 	 return;
       }
    }
@@ -705,9 +705,9 @@ SISCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 
    xf86ChangeGammaRamp(pScreen, nramp, ramp[0], ramp[1], ramp[2]);
 
-   xfree(ramp[0]);
-   xfree(ramp[1]);
-   xfree(ramp[2]);
+   free(ramp[0]);
+   free(ramp[1]);
+   free(ramp[2]);
    ramp[0] = ramp[1] = ramp[2] = NULL;
 }
 #endif
@@ -1135,10 +1135,10 @@ SiSCopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest,
     DisplayModePtr mode;
     int dx = 0,dy = 0;
 
-    if(!((mode = xalloc(sizeof(DisplayModeRec))))) return dest;
+    if(!((mode = malloc(sizeof(DisplayModeRec))))) return dest;
     memcpy(mode, i, sizeof(DisplayModeRec));
-    if(!((mode->Private = xalloc(sizeof(SiSMergedDisplayModeRec))))) {
-       xfree(mode);
+    if(!((mode->Private = malloc(sizeof(SiSMergedDisplayModeRec))))) {
+       free(mode);
        return dest;
     }
     ((SiSMergedDisplayModePtr)mode->Private)->CRT1 = i;
@@ -1223,8 +1223,8 @@ SiSCopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest,
        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		"Skipped \"%s\" (%dx%d), not enough video RAM or beyond hardware specs\n",
 		mode->name, mode->HDisplay, mode->VDisplay);
-       xfree(mode->Private);
-       xfree(mode);
+       free(mode->Private);
+       free(mode);
 
        return dest;
     }
@@ -2389,7 +2389,7 @@ SiSXineramaResetProc(ExtensionEntry* extEntry)
 {
     /* Called by CloseDownExtensions() */
     if(SiSXineramadataPtr) {
-       Xfree(SiSXineramadataPtr);
+       free(SiSXineramadataPtr);
        SiSXineramadataPtr = NULL;
     }
 }
@@ -2454,7 +2454,7 @@ SiSXineramaExtensionInit(ScrnInfoPtr pScrn)
 	  if(!pSiS->XineramaExtEntry) break;
 
 	  if(!(SiSXineramadataPtr = (SiSXineramaData *)
-	        xcalloc(SiSXineramaNumScreens, sizeof(SiSXineramaData)))) break;
+	        calloc(SiSXineramaNumScreens, sizeof(SiSXineramaData)))) break;
 
 	  SiSXineramaGeneration = serverGeneration;
 	  success = TRUE;
@@ -2493,10 +2493,10 @@ SiSFreeCRT2Structs(SISPtr pSiS)
 	     while(pSiS->CRT2pScrn->monitor->Modes)
 		xf86DeleteMode(&pSiS->CRT2pScrn->monitor->Modes, pSiS->CRT2pScrn->monitor->Modes);
 	  }
-	  if(pSiS->CRT2pScrn->monitor->DDC) xfree(pSiS->CRT2pScrn->monitor->DDC);
-	  xfree(pSiS->CRT2pScrn->monitor);
+	  if(pSiS->CRT2pScrn->monitor->DDC) free(pSiS->CRT2pScrn->monitor->DDC);
+	  free(pSiS->CRT2pScrn->monitor);
        }
-       xfree(pSiS->CRT2pScrn);
+       free(pSiS->CRT2pScrn);
        pSiS->CRT2pScrn = NULL;
    }
 }
@@ -2902,22 +2902,22 @@ SiS_CheckKernelFB(ScrnInfoPtr pScrn)
 	     Bool gotit = FALSE;
 
  	     if(!ioctl(fd, SISFB_GET_INFO_SIZE, &sisfbinfosize)) {
- 		if((mysisfbinfo = xalloc(sisfbinfosize))) {
+ 		if((mysisfbinfo = malloc(sisfbinfosize))) {
  		   if(!ioctl(fd, (SISFB_GET_INFO | (sisfbinfosize << 16)), mysisfbinfo)) {
  		      gotit = TRUE;
  		   } else {
- 		      xfree(mysisfbinfo);
+ 		      free(mysisfbinfo);
  		      mysisfbinfo = NULL;
  		   }
  		}
  	     } else {
- 		if((mysisfbinfo = xalloc(sizeof(*mysisfbinfo) + 16))) {
+ 		if((mysisfbinfo = malloc(sizeof(*mysisfbinfo) + 16))) {
  		   if(!ioctl(fd, SISFB_GET_INFO_OLD, mysisfbinfo)) {
  		      gotit = TRUE;
 		      xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 				"Possibly old version of sisfb detected. Please update.\n");
 		   } else {
-		      xfree(mysisfbinfo);
+		      free(mysisfbinfo);
 		      mysisfbinfo = NULL;
 		   }
 		}
@@ -3056,7 +3056,7 @@ SiS_CheckKernelFB(ScrnInfoPtr pScrn)
 		      }
 		   }
 	        }
-		xfree(mysisfbinfo);
+		free(mysisfbinfo);
 		mysisfbinfo = NULL;
 	     }
 	     close (fd);
@@ -4078,7 +4078,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
        }
 #endif
        if(!pSiS->BIOS) {
-	  if(!(pSiS->BIOS = xcalloc(1, BIOS_SIZE))) {
+	  if(!(pSiS->BIOS = calloc(1, BIOS_SIZE))) {
 	     xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		"Could not allocate memory for video BIOS image\n");
 	  } else {
@@ -4173,7 +4173,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 	     } else {
 	        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 			 "Could not find/read video BIOS\n");
-		xfree(pSiS->BIOS);
+		free(pSiS->BIOS);
 		pSiS->BIOS = NULL;
 	     }
           }
@@ -5559,7 +5559,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
     /* Do some MergedFB mode initialisation */
 #ifdef SISMERGED
     if(pSiS->MergedFB) {
-       pSiS->CRT2pScrn = xalloc(sizeof(ScrnInfoRec));
+       pSiS->CRT2pScrn = malloc(sizeof(ScrnInfoRec));
        if(!pSiS->CRT2pScrn) {
           SISErrorLog(pScrn, "Failed to allocate memory for 2nd pScrn, %s\n", mergeddisstr);
 	  pSiS->MergedFB = FALSE;
@@ -5592,7 +5592,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 		} else {
 		   SISErrorLog(pScrn, mergednocrt1, mergeddisstr);
 		}
-		if(pSiS->CRT2pScrn) xfree(pSiS->CRT2pScrn);
+		if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn);
 		pSiS->CRT2pScrn = NULL;
 		pSiS->MergedFB = FALSE;
 	     }
@@ -5639,7 +5639,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 		} else {
 		   SISErrorLog(pScrn, mergednocrt2, mergeddisstr);
 		}
-		if(pSiS->CRT2pScrn) xfree(pSiS->CRT2pScrn);
+		if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn);
 		pSiS->CRT2pScrn = NULL;
 		pSiS->MergedFB = FALSE;
 	     }
@@ -6016,7 +6016,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 
 #ifdef SISMERGED
     if(pSiS->MergedFB) {
-       pSiS->CRT2pScrn->monitor = xalloc(sizeof(MonRec));
+       pSiS->CRT2pScrn->monitor = malloc(sizeof(MonRec));
        if(pSiS->CRT2pScrn->monitor) {
 	  DisplayModePtr tempm = NULL, currentm = NULL, newm = NULL;
 	  memcpy(pSiS->CRT2pScrn->monitor, pScrn->monitor, sizeof(MonRec));
@@ -6025,10 +6025,10 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 	  pSiS->CRT2pScrn->monitor->id = (char *)crt2monname;
 	  tempm = pScrn->monitor->Modes;
 	  while(tempm) {
-	     if(!(newm = xalloc(sizeof(DisplayModeRec)))) break;
+	     if(!(newm = malloc(sizeof(DisplayModeRec)))) break;
 	     memcpy(newm, tempm, sizeof(DisplayModeRec));
-	     if(!(newm->name = xalloc(strlen(tempm->name) + 1))) {
-	        xfree(newm);
+	     if(!(newm->name = malloc(strlen(tempm->name) + 1))) {
+	        free(newm);
 		break;
 	     }
 	     strcpy(newm->name, tempm->name);
@@ -6070,7 +6070,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
        } else {
 	  SISErrorLog(pScrn, "Failed to allocate memory for CRT2 monitor, %s.\n",
 	  		mergeddisstr);
-	  if(pSiS->CRT2pScrn) xfree(pSiS->CRT2pScrn);
+	  if(pSiS->CRT2pScrn) free(pSiS->CRT2pScrn);
 	  pSiS->CRT2pScrn = NULL;
 	  pSiS->MergedFB = FALSE;
        }
@@ -7454,7 +7454,7 @@ SISVESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function)
 	     (function == MODE_SAVE)) {
 	     /* don't rely on the memory not being touched */
 	     if(!pSiS->pstate) {
-		pSiS->pstate = xalloc(pSiS->stateSize);
+		pSiS->pstate = malloc(pSiS->stateSize);
 	     }
 	     memcpy(pSiS->pstate, pSiS->state, pSiS->stateSize);
 	  }
@@ -8675,7 +8675,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
     if(pSiS->ShadowFB) {
        pSiS->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
-       pSiS->ShadowPtr = xalloc(pSiS->ShadowPitch * height);
+       pSiS->ShadowPtr = malloc(pSiS->ShadowPitch * height);
        displayWidth = pSiS->ShadowPitch / (pScrn->bitsPerPixel >> 3);
        FBStart = pSiS->ShadowPtr;
     } else {
@@ -8849,14 +8849,14 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
 	  pSiS->CRT2ColNum = 1 << pScrn->rgbBits;
 
-	  if((pSiS->crt2gcolortable = xalloc(pSiS->CRT2ColNum * 2 * sizeof(LOCO)))) {
+	  if((pSiS->crt2gcolortable = malloc(pSiS->CRT2ColNum * 2 * sizeof(LOCO)))) {
 	     pSiS->crt2colors = &pSiS->crt2gcolortable[pSiS->CRT2ColNum];
-	     if((pSiS->crt2cindices = xalloc(256 * sizeof(int)))) {
+	     if((pSiS->crt2cindices = malloc(256 * sizeof(int)))) {
 		int i = pSiS->CRT2ColNum;
 		SISCalculateGammaRampCRT2(pScrn);
 		while(i--) pSiS->crt2cindices[i] = i;
 	     } else {
-		xfree(pSiS->crt2gcolortable);
+		free(pSiS->crt2gcolortable);
 		pSiS->crt2gcolortable = NULL;
 		pSiS->CRT2SepGamma = FALSE;
 	     }
@@ -9941,7 +9941,7 @@ SISCloseScreen(int scrnIndex, ScreenPtr pScreen)
     if(pSiS->useEXA) {
        if(pSiS->EXADriverPtr) {
           exaDriverFini(pScreen);
-          xfree(pSiS->EXADriverPtr);
+          free(pSiS->EXADriverPtr);
           pSiS->EXADriverPtr = NULL;
           pSiS->exa_scratch = NULL;
        }
@@ -9954,33 +9954,33 @@ SISCloseScreen(int scrnIndex, ScreenPtr pScreen)
     }
 
     if(pSiS->ShadowPtr) {
-       xfree(pSiS->ShadowPtr);
+       free(pSiS->ShadowPtr);
        pSiS->ShadowPtr = NULL;
     }
 
     if(pSiS->DGAModes) {
-       xfree(pSiS->DGAModes);
+       free(pSiS->DGAModes);
        pSiS->DGAModes = NULL;
     }
 
     if(pSiS->adaptor) {
-       xfree(pSiS->adaptor);
+       free(pSiS->adaptor);
        pSiS->adaptor = NULL;
        pSiS->ResetXv = pSiS->ResetXvGamma = pSiS->ResetXvDisplay = NULL;
     }
 
     if(pSiS->blitadaptor) {
-       xfree(pSiS->blitadaptor);
+       free(pSiS->blitadaptor);
        pSiS->blitadaptor = NULL;
     }
 
     if(pSiS->crt2gcolortable) {
-       xfree(pSiS->crt2gcolortable);
+       free(pSiS->crt2gcolortable);
        pSiS->crt2gcolortable = NULL;
     }
 
     if(pSiS->crt2cindices) {
-       xfree(pSiS->crt2cindices);
+       free(pSiS->crt2cindices);
        pSiS->crt2cindices = NULL;
     }
 
diff --git a/src/sis_memcpy.c b/src/sis_memcpy.c
index 6ad62e8..3634401 100644
--- a/src/sis_memcpy.c
+++ b/src/sis_memcpy.c
@@ -638,13 +638,13 @@ SiS_AllocBuffers(ScrnInfoPtr pScrn, UChar **buf1, UChar **buf2, UChar **buf3)
     (*buf1) = (UChar *)pSiS->FbBase + offset;
     (*buf1) = (UChar *)(((ULong)(*buf1) + 31) & ~31);
 
-    if(!((*buf2) = (UChar *)xalloc(BUFFERSIZE + 15))) {
+    if(!((*buf2) = (UChar *)malloc(BUFFERSIZE + 15))) {
        SISFreeFBMemory(pScrn, &handle);
        return NULL;
     }
 
-    if(!((*buf3) = (UChar *)xalloc(BUFFERSIZE + 15))) {
-       xfree((*buf2));
+    if(!((*buf3) = (UChar *)malloc(BUFFERSIZE + 15))) {
+       free((*buf2));
        SISFreeFBMemory(pScrn, &handle);
        return NULL;
     }
@@ -1098,8 +1098,8 @@ SiSVidCopyInitGen(ScreenPtr pScreen, SISMCFuncData *MCFunctions, vidCopyFunc *UM
 
     /* Free buffers */
     SISFreeFBMemory(pScrn, &fbhandle);
-    xfree(buf2);
-    xfree(buf3);
+    free(buf2);
+    free(buf3);
 
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
 	       "Using %s method for aligned data transfers %s video RAM\n",
diff --git a/src/sis_opt.c b/src/sis_opt.c
index 3517549..d39ff6e 100644
--- a/src/sis_opt.c
+++ b/src/sis_opt.c
@@ -448,7 +448,7 @@ SiSOptions(ScrnInfoPtr pScrn)
     xf86CollectOptions(pScrn, NULL);
 
     /* Process the options */
-    if(!(pSiS->Options = xalloc(sizeof(SISOptions)))) return;
+    if(!(pSiS->Options = malloc(sizeof(SISOptions)))) return;
 
     memcpy(pSiS->Options, SISOptions, sizeof(SISOptions));
 
@@ -888,7 +888,7 @@ SiSOptions(ScrnInfoPtr pScrn)
 	  if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2POS))) {
 	     int result;
 	     Bool valid = FALSE;
-	     char *tempstr = xalloc(strlen(strptr) + 1);
+	     char *tempstr = malloc(strlen(strptr) + 1);
 	     result = sscanf(strptr, "%s %d", tempstr, &ival);
 	     if(result >= 1) {
 		if(!xf86NameCmp(tempstr,"LeftOf")) {
@@ -946,18 +946,18 @@ SiSOptions(ScrnInfoPtr pScrn)
 		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		    "Except for \"Clone\", the parameter may be followed by an integer.\n");
 	     }
-	     xfree(tempstr);
+	     free(tempstr);
 	  }
 	  if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_METAMODES))) {
-	     pSiS->MetaModes = xalloc(strlen(strptr) + 1);
+	     pSiS->MetaModes = malloc(strlen(strptr) + 1);
 	     if(pSiS->MetaModes) memcpy(pSiS->MetaModes, strptr, strlen(strptr) + 1);
 	  }
 	  if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2HSYNC))) {
-	     pSiS->CRT2HSync = xalloc(strlen(strptr) + 1);
+	     pSiS->CRT2HSync = malloc(strlen(strptr) + 1);
 	     if(pSiS->CRT2HSync) memcpy(pSiS->CRT2HSync, strptr, strlen(strptr) + 1);
 	  }
 	  if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_CRT2VREFRESH))) {
-	     pSiS->CRT2VRefresh = xalloc(strlen(strptr) + 1);
+	     pSiS->CRT2VRefresh = malloc(strlen(strptr) + 1);
 	     if(pSiS->CRT2VRefresh) memcpy(pSiS->CRT2VRefresh, strptr, strlen(strptr) + 1);
 	  }
 	  if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_MERGEDDPI))) {
diff --git a/src/sis_utility.c b/src/sis_utility.c
index 1624683..64d8919 100644
--- a/src/sis_utility.c
+++ b/src/sis_utility.c
@@ -2005,7 +2005,7 @@ SiSCtrlResetProc(ExtensionEntry* extEntry)
      * in SiSCtrlExtUnregister())
      */
     if(extEntry->extPrivate) {
-       xfree(extEntry->extPrivate);
+       free(extEntry->extPrivate);
        extEntry->extPrivate = NULL;
     }
 }
@@ -2026,7 +2026,7 @@ SiSCtrlExtInit(ScrnInfoPtr pScrn)
 
    if(!(myext = CheckExtension(SISCTRL_PROTOCOL_NAME))) {
 
-      if(!(myctrl = xcalloc(sizeof(xSiSCtrlScreenTable), 1)))
+      if(!(myctrl = calloc(sizeof(xSiSCtrlScreenTable), 1)))
          return;
 
       if(!(myext = AddExtension(SISCTRL_PROTOCOL_NAME, 0, 0,
@@ -2036,7 +2036,7 @@ SiSCtrlExtInit(ScrnInfoPtr pScrn)
 				StandardMinorOpcode))) {
          xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 	 		"Failed to add SISCTRL extension\n");
-	 xfree(myctrl);
+	 free(myctrl);
 	 return;
       }
 
diff --git a/src/sis_vga.c b/src/sis_vga.c
index 3f6219b..5e6d0b4 100644
--- a/src/sis_vga.c
+++ b/src/sis_vga.c
@@ -1429,7 +1429,7 @@ SiSVGASaveFonts(ScrnInfoPtr pScrn)
     attr10 = SiS_ReadAttr(pSiS, 0x10);
     if(attr10 & 0x01) return;
 
-    if(!(pSiS->fonts = xalloc(SIS_FONTS_SIZE * 2))) {
+    if(!(pSiS->fonts = malloc(SIS_FONTS_SIZE * 2))) {
        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		"Could not save console fonts, mem allocation failed\n");
        return;
diff --git a/src/sis_video.c b/src/sis_video.c
index 7322efb..2006858 100644
--- a/src/sis_video.c
+++ b/src/sis_video.c
@@ -326,7 +326,7 @@ SISInitVideo(ScreenPtr pScreen)
        if(newAdaptor)     size++;
        if(newBlitAdaptor) size++;
 
-       newAdaptors = xalloc(size * sizeof(XF86VideoAdaptorPtr*));
+       newAdaptors = malloc(size * sizeof(XF86VideoAdaptorPtr*));
        if(newAdaptors) {
           if(num_adaptors) {
              memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr));
@@ -356,7 +356,7 @@ SISInitVideo(ScreenPtr pScreen)
     }
 
     if(newAdaptors) {
-       xfree(newAdaptors);
+       free(newAdaptors);
     }
 }
 
@@ -877,7 +877,7 @@ SISSetupImageVideo(ScreenPtr pScreen)
     }
 #endif
 
-    if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+    if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
                             sizeof(SISPortPrivRec) +
                             sizeof(DevUnion)))) {
        return NULL;
@@ -4067,7 +4067,7 @@ SISSetupBlitVideo(ScreenPtr pScreen)
    }
 #endif
 
-   if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) +
+   if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
     			   (sizeof(DevUnion) * NUM_BLIT_PORTS) +
                            sizeof(SISBPortPrivRec)))) {
       return NULL;
-- 
1.7.4.1



More information about the xorg-devel mailing list