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 /randr/rrmode.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 'randr/rrmode.c')
-rw-r--r-- | randr/rrmode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/randr/rrmode.c b/randr/rrmode.c index 139619367..01511e2fd 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -58,7 +58,7 @@ RRModeCreate (xRRModeInfo *modeInfo, if (!RRInit ()) return NULL; - mode = xalloc (sizeof (RRModeRec) + modeInfo->nameLength + 1); + mode = malloc(sizeof (RRModeRec) + modeInfo->nameLength + 1); if (!mode) return NULL; mode->refcnt = 1; @@ -69,13 +69,13 @@ RRModeCreate (xRRModeInfo *modeInfo, mode->userScreen = userScreen; if (num_modes) - newModes = xrealloc (modes, (num_modes + 1) * sizeof (RRModePtr)); + newModes = realloc(modes, (num_modes + 1) * sizeof (RRModePtr)); else - newModes = xalloc (sizeof (RRModePtr)); + newModes = malloc(sizeof (RRModePtr)); if (!newModes) { - xfree (mode); + free(mode); return NULL; } @@ -164,7 +164,7 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret) RRModePtr *screen_modes; int num_screen_modes = 0; - screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); + screen_modes = malloc((num_modes ? num_modes : 1) * sizeof (RRModePtr)); if (!screen_modes) return NULL; @@ -243,14 +243,14 @@ RRModeDestroy (RRModePtr mode) num_modes--; if (!num_modes) { - xfree (modes); + free(modes); modes = NULL; } break; } } - xfree (mode); + free(mode); } static int |