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 /hw/dmx/dmx.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 'hw/dmx/dmx.c')
-rw-r--r-- | hw/dmx/dmx.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index a1afe76cf..95e7adca9 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -419,7 +419,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) if (!_DMXXineramaActive()) goto noxinerama; - if (!(attribs = xalloc(stuff->screenCount * sizeof(*attribs)))) + if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs)))) return BadAlloc; for (i = 0; i < stuff->screenCount; i++) { @@ -438,7 +438,7 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) &errorScreen); #endif - xfree(attribs); + free(attribs); if (status == BadValue) return status; @@ -484,7 +484,7 @@ static int ProcDMXAddScreen(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list); - if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) + if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -492,7 +492,7 @@ static int ProcDMXAddScreen(ClientPtr client) status = dmxAttachScreen(stuff->physicalScreen, &attr); - xfree(name); + free(name); rep.type = X_Reply; rep.sequenceNumber = client->sequence; @@ -612,30 +612,30 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); - if (!(screens = xalloc(count * sizeof(*screens)))) + if (!(screens = malloc(count * sizeof(*screens)))) return BadAlloc; - if (!(windows = xalloc(count * sizeof(*windows)))) { - xfree(screens); + if (!(windows = malloc(count * sizeof(*windows)))) { + free(screens); return BadAlloc; } - if (!(pos = xalloc(count * sizeof(*pos)))) { - xfree(windows); - xfree(screens); + if (!(pos = malloc(count * sizeof(*pos)))) { + free(windows); + free(screens); return BadAlloc; } - if (!(vis = xalloc(count * sizeof(*vis)))) { - xfree(pos); - xfree(windows); - xfree(screens); + if (!(vis = malloc(count * sizeof(*vis)))) { + free(pos); + free(windows); + free(screens); return BadAlloc; } if ((count = dmxPopulate(client, stuff->window, screens, windows, pos, vis)) < 0) { - xfree(vis); - xfree(pos); - xfree(windows); - xfree(screens); + free(vis); + free(pos); + free(windows); + free(screens); return BadWindow; } @@ -673,10 +673,10 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) WriteToClient(client, count * sizeof(*vis), (char *)vis); } - xfree(vis); - xfree(pos); - xfree(windows); - xfree(screens); + free(vis); + free(pos); + free(windows); + free(screens); return client->noClientException; } @@ -837,7 +837,7 @@ static int ProcDMXAddInput(ClientPtr client) value_list = (CARD32 *)(stuff + 1); count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list); - if (!(name = xalloc(stuff->displayNameLength + 1 + 4))) + if (!(name = malloc(stuff->displayNameLength + 1 + 4))) return BadAlloc; memcpy(name, &value_list[count], stuff->displayNameLength); name[stuff->displayNameLength] = '\0'; @@ -845,7 +845,7 @@ static int ProcDMXAddInput(ClientPtr client) status = dmxAddInput(&attr, &id); - xfree(name); + free(name); if (status) return status; |