diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /miext | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'miext')
-rw-r--r-- | miext/cw/cw.c | 4 | ||||
-rw-r--r-- | miext/cw/cw_render.c | 6 | ||||
-rw-r--r-- | miext/damage/damage.c | 12 | ||||
-rw-r--r-- | miext/rootless/rootlessScreen.c | 10 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 12 | ||||
-rw-r--r-- | miext/shadow/shadow.c | 6 | ||||
-rw-r--r-- | miext/shadow/shalloc.c | 2 |
7 files changed, 26 insertions, 26 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 247cb83e1..1959c8b73 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -480,7 +480,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) if (!dixRequestPrivate(cwGCKey, sizeof(cwGCRec))) return; - pScreenPriv = xalloc(sizeof(cwScreenRec)); + pScreenPriv = malloc(sizeof(cwScreenRec)); if (!pScreenPriv) return; @@ -516,7 +516,7 @@ cwCloseScreen (int i, ScreenPtr pScreen) if (ps) cwFiniRender(pScreen); - xfree((pointer)pScreenPriv); + free((pointer)pScreenPriv); return (*pScreen->CloseScreen)(i, pScreen); } diff --git a/miext/cw/cw_render.c b/miext/cw/cw_render.c index dfe2681e0..165c44f46 100644 --- a/miext/cw/cw_render.c +++ b/miext/cw/cw_render.c @@ -73,7 +73,7 @@ cwCreatePicturePrivate (PicturePtr pPicture) int error; cwPicturePtr pPicturePrivate; - pPicturePrivate = xalloc (sizeof (cwPictureRec)); + pPicturePrivate = malloc(sizeof (cwPictureRec)); if (!pPicturePrivate) return NULL; @@ -83,7 +83,7 @@ cwCreatePicturePrivate (PicturePtr pPicture) &error); if (!pPicturePrivate->pBackingPicture) { - xfree (pPicturePrivate); + free(pPicturePrivate); return NULL; } @@ -107,7 +107,7 @@ cwDestroyPicturePrivate (PicturePtr pPicture) { if (pPicturePrivate->pBackingPicture) FreePicture (pPicturePrivate->pBackingPicture, 0); - xfree (pPicturePrivate); + free(pPicturePrivate); setCwPicture(pPicture, NULL); } } diff --git a/miext/damage/damage.c b/miext/damage/damage.c index de1857355..551cb721e 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1511,7 +1511,7 @@ damageText (DrawablePtr pDrawable, imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); - charinfo = xalloc(count * sizeof(CharInfoPtr)); + charinfo = malloc(count * sizeof(CharInfoPtr)); if (!charinfo) return x; @@ -1533,7 +1533,7 @@ damageText (DrawablePtr pDrawable, (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font)); } - xfree(charinfo); + free(charinfo); return x + w; } @@ -1848,7 +1848,7 @@ damageCloseScreen (int i, ScreenPtr pScreen) unwrap (pScrPriv, pScreen, CreateGC); unwrap (pScrPriv, pScreen, CopyWindow); unwrap (pScrPriv, pScreen, CloseScreen); - xfree (pScrPriv); + free(pScrPriv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -1890,7 +1890,7 @@ DamageSetup (ScreenPtr pScreen) if (!dixRequestPrivate(damageGCPrivateKey, sizeof(DamageGCPrivRec))) return FALSE; - pScrPriv = xalloc (sizeof (DamageScrPrivRec)); + pScrPriv = malloc(sizeof (DamageScrPrivRec)); if (!pScrPriv) return FALSE; @@ -1926,7 +1926,7 @@ DamageCreate (DamageReportFunc damageReport, damageScrPriv(pScreen); DamagePtr pDamage; - pDamage = xalloc (sizeof (DamageRec)); + pDamage = malloc(sizeof (DamageRec)); if (!pDamage) return 0; pDamage->pNext = 0; @@ -2054,7 +2054,7 @@ DamageDestroy (DamagePtr pDamage) pDamage->devPrivates = NULL; REGION_UNINIT (pScreen, &pDamage->damage); REGION_UNINIT (pScreen, &pDamage->pendingDamage); - xfree (pDamage); + free(pDamage); } Bool diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 5f249467b..7a24af842 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -98,10 +98,10 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) if (s->pixmap_data_size < rowbytes) { if (s->pixmap_data != NULL) - xfree(s->pixmap_data); + free(s->pixmap_data); s->pixmap_data_size = rowbytes; - s->pixmap_data = xalloc(s->pixmap_data_size); + s->pixmap_data = malloc(s->pixmap_data_size); if (s->pixmap_data == NULL) return; @@ -157,12 +157,12 @@ RootlessCloseScreen(int i, ScreenPtr pScreen) pScreen->CloseScreen = s->CloseScreen; if (s->pixmap_data != NULL) { - xfree (s->pixmap_data); + free(s->pixmap_data); s->pixmap_data = NULL; s->pixmap_data_size = 0; } - xfree(s); + free(s); return pScreen->CloseScreen(i, pScreen); } @@ -641,7 +641,7 @@ RootlessAllocatePrivates(ScreenPtr pScreen) if (!dixRequestPrivate(rootlessGCPrivateKey, sizeof(RootlessGCRec))) return FALSE; - s = xalloc(sizeof(RootlessScreenRec)); + s = malloc(sizeof(RootlessScreenRec)); if (! s) return FALSE; SETSCREENREC(pScreen, s); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 55c7b9689..22a548a0f 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -187,7 +187,7 @@ RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec) REGION_UNINIT(pScreen, &winRec->damage); #endif - xfree(winRec); + free(winRec); SETWINREC(pWin, NULL); } @@ -421,7 +421,7 @@ RootlessEnsureFrame(WindowPtr pWin) if (pWin->drawable.class != InputOutput) return NULL; - winRec = xalloc(sizeof(RootlessWindowRec)); + winRec = malloc(sizeof(RootlessWindowRec)); if (!winRec) return NULL; @@ -448,7 +448,7 @@ RootlessEnsureFrame(WindowPtr pWin) pShape)) { RL_DEBUG_MSG("implementation failed to create frame!\n"); - xfree(winRec); + free(winRec); SETWINREC(pWin, NULL); return NULL; } @@ -984,7 +984,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity, copy_rect_width = copy_rect.x2 - copy_rect.x1; copy_rect_height = copy_rect.y2 - copy_rect.y1; copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31; - gResizeDeathBits = xalloc(copy_rowbytes + gResizeDeathBits = malloc(copy_rowbytes * copy_rect_height); if (copy_rect_width * copy_rect_height > @@ -1028,7 +1028,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity, RootlessStartDrawing(pWin); - gResizeDeathBits = xalloc(winRec->bytesPerRow * winRec->height); + gResizeDeathBits = malloc(winRec->bytesPerRow * winRec->height); memcpy(gResizeDeathBits, winRec->pixelData, winRec->bytesPerRow * winRec->height); @@ -1170,7 +1170,7 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, } if (gResizeDeathBits != NULL) { - xfree(gResizeDeathBits); + free(gResizeDeathBits); gResizeDeathBits = NULL; } diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index 608ccd234..e027e76d9 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -107,7 +107,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen) #endif if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); - xfree(pBuf); + free(pBuf); return pScreen->CloseScreen(i, pScreen); } @@ -139,7 +139,7 @@ shadowSetup(ScreenPtr pScreen) if (!DamageSetup(pScreen)) return FALSE; - pBuf = xalloc(sizeof(shadowBufRec)); + pBuf = malloc(sizeof(shadowBufRec)); if (!pBuf) return FALSE; #ifdef BACKWARDS_COMPATIBILITY @@ -154,7 +154,7 @@ shadowSetup(ScreenPtr pScreen) TRUE, pScreen, pScreen); #endif if (!pBuf->pDamage) { - xfree(pBuf); + free(pBuf); return FALSE; } diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c index 72aa28b14..f57cb5266 100644 --- a/miext/shadow/shalloc.c +++ b/miext/shadow/shalloc.c @@ -45,6 +45,6 @@ shadowAlloc (int width, int height, int bpp) /* Cant use PixmapBytePad -- the structure is probably not initialized yet */ stride = BitmapBytePad (width * bpp); - fb = xalloc (stride * height); + fb = malloc(stride * height); return fb; } |