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 /Xext/shm.c | |
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 'Xext/shm.c')
-rw-r--r-- | Xext/shm.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index ab58c2750..39b392943 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -226,7 +226,7 @@ ShmCloseScreen(int i, ScreenPtr pScreen) ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); pScreen->CloseScreen = screen_priv->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL); - xfree (screen_priv); + free(screen_priv); return (*pScreen->CloseScreen) (i, pScreen); } @@ -236,7 +236,7 @@ ShmInitScreenPriv(ScreenPtr pScreen) ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); if (!screen_priv) { - screen_priv = xcalloc (1, sizeof (ShmScrPrivateRec)); + screen_priv = calloc(1, sizeof (ShmScrPrivateRec)); screen_priv->CloseScreen = pScreen->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv); pScreen->CloseScreen = ShmCloseScreen; @@ -454,7 +454,7 @@ ProcShmAttach(ClientPtr client) } else { - shmdesc = xalloc(sizeof(ShmDescRec)); + shmdesc = malloc(sizeof(ShmDescRec)); if (!shmdesc) return BadAlloc; shmdesc->addr = shmat(stuff->shmid, 0, @@ -462,7 +462,7 @@ ProcShmAttach(ClientPtr client) if ((shmdesc->addr == ((char *)-1)) || SHMSTAT(stuff->shmid, &buf)) { - xfree(shmdesc); + free(shmdesc); return BadAccess; } @@ -472,7 +472,7 @@ ProcShmAttach(ClientPtr client) if (shm_access(client, &(SHM_PERM(buf)), stuff->readOnly) == -1) { shmdt(shmdesc->addr); - xfree(shmdesc); + free(shmdesc); return BadAccess; } @@ -502,7 +502,7 @@ ShmDetachSegment(pointer value, /* must conform to DeleteType */ for (prev = &Shmsegs; *prev != shmdesc; prev = &(*prev)->next) ; *prev = shmdesc->next; - xfree(shmdesc); + free(shmdesc); return Success; } @@ -671,7 +671,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) return(BadMatch); } - drawables = xcalloc(PanoramiXNumScreens, sizeof(DrawablePtr)); + drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr)); if(!drawables) return(BadAlloc); @@ -681,7 +681,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) DixReadAccess); if (rc != Success) { - xfree(drawables); + free(drawables); return rc; } } @@ -722,7 +722,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) } } } - xfree(drawables); + free(drawables); if (client->swapped) { int n; @@ -795,7 +795,7 @@ CreatePmap: VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client); - if(!(newPix = xalloc(sizeof(PanoramiXRes)))) + if(!(newPix = malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPix->type = XRT_PIXMAP; @@ -836,7 +836,7 @@ CreatePmap: (*pScreen->DestroyPixmap)(pMap); FreeResource(newPix->info[j].id, RT_NONE); } - xfree(newPix); + free(newPix); } else AddResource(stuff->pid, XRT_PIXMAP, newPix); |