[PATCH 3/3 xgi] Replace alloc for malloc

Paulo Zanoni pzanoni at mandriva.com
Mon Dec 13 10:02:31 PST 2010


alloc is not declared
Signed-off-by: Paulo Zanoni <pzanoni at mandriva.com>
---
 src/xgi_driver.c |   14 +++++++-------
 src/xgi_opt.c    |    2 +-
 src/xgi_video.c  |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index debef31..614ee2d 100755
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -907,10 +907,10 @@ XGICopyModeNLink(ScrnInfoPtr pScrn, DisplayModePtr dest,
 
 	ErrorF("XGICopyModeNLink()...Use Virtual Size-1\n");
 
-    if (!((mode = alloc(sizeof(DisplayModeRec)))))
+    if (!((mode = malloc(sizeof(DisplayModeRec)))))
         return dest;
     memcpy(mode, i, sizeof(DisplayModeRec));
-    if (!((mode->Private = alloc(sizeof(XGIMergedDisplayModeRec))))) {
+    if (!((mode->Private = malloc(sizeof(XGIMergedDisplayModeRec))))) {
         free(mode);
         return dest;
     }
@@ -2296,7 +2296,7 @@ XGIDDCPreInit(ScrnInfoPtr pScrn)
 
 #ifdef XGIMERGED
     if (pXGI->MergedFB) {
-        pXGI->CRT2pScrn->monitor = alloc(sizeof(MonRec));
+        pXGI->CRT2pScrn->monitor = malloc(sizeof(MonRec));
         if (pXGI->CRT2pScrn->monitor) {
             DisplayModePtr tempm = NULL, currentm = NULL, newm = NULL;
             memcpy(pXGI->CRT2pScrn->monitor, pScrn->monitor, sizeof(MonRec));
@@ -2304,10 +2304,10 @@ XGIDDCPreInit(ScrnInfoPtr pScrn)
             pXGI->CRT2pScrn->monitor->Modes = NULL;
             tempm = pScrn->monitor->Modes;
             while (tempm) {
-                if (!(newm = alloc(sizeof(DisplayModeRec))))
+                if (!(newm = malloc(sizeof(DisplayModeRec))))
                     break;
                 memcpy(newm, tempm, sizeof(DisplayModeRec));
-                if (!(newm->name = alloc(strlen(tempm->name) + 1))) {
+                if (!(newm->name = malloc(strlen(tempm->name) + 1))) {
                     free(newm);
                     break;
                 }
@@ -3393,7 +3393,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
         /* Do some MergedFB mode initialisation */
 #ifdef XGIMERGED
         if (pXGI->MergedFB) {
-        pXGI->CRT2pScrn = alloc(sizeof(ScrnInfoRec));
+        pXGI->CRT2pScrn = malloc(sizeof(ScrnInfoRec));
         if (!pXGI->CRT2pScrn) {
             XGIErrorLog(pScrn,
                         "Failed to allocate memory for 2nd pScrn, %s\n",
@@ -4745,7 +4745,7 @@ XGIScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
     if (pXGI->ShadowFB) {
         pXGI->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width);
-        pXGI->ShadowPtr = alloc(pXGI->ShadowPitch * height);
+        pXGI->ShadowPtr = malloc(pXGI->ShadowPitch * height);
         displayWidth = pXGI->ShadowPitch / (pScrn->bitsPerPixel >> 3);
         FBStart = pXGI->ShadowPtr;
     }
diff --git a/src/xgi_opt.c b/src/xgi_opt.c
index 2f11e6e..c0608d5 100755
--- a/src/xgi_opt.c
+++ b/src/xgi_opt.c
@@ -195,7 +195,7 @@ xgiOptions(ScrnInfoPtr pScrn)
     xf86CollectOptions(pScrn, NULL);
 
     /* Process the options */
-    if(!(pXGI->Options = alloc(sizeof(XGIOptions)))) return;
+    if(!(pXGI->Options = malloc(sizeof(XGIOptions)))) return;
 
     memcpy(pXGI->Options, XGIOptions, sizeof(XGIOptions));
 
diff --git a/src/xgi_video.c b/src/xgi_video.c
index 929ef05..df76d14 100755
--- a/src/xgi_video.c
+++ b/src/xgi_video.c
@@ -142,7 +142,7 @@ void XGIInitVideo(ScreenPtr pScreen)
             adaptors = &newAdaptor;
         } else {
             newAdaptors =  /* need to free this someplace */
-                alloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
+                malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
             if(newAdaptors) {
                 memcpy(newAdaptors, adaptors, num_adaptors *
                                         sizeof(XF86VideoAdaptorPtr));
-- 
1.7.1



More information about the xorg-devel mailing list