summaryrefslogtreecommitdiff
path: root/dix/extension.c
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-05-06 01:44:06 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-05-13 00:22:37 +0700
commit3f3ff971ecff9936cebafc813af9193b97bba89c (patch)
treefdbbad794a42488b7ffe41eed7aba4e498335f55 /dix/extension.c
parent96c7ab27c383ec767f62a7a11e5fd76f86363fbc (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 'dix/extension.c')
-rw-r--r--dix/extension.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/dix/extension.c b/dix/extension.c
index f34866586..6940b68b0 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -89,26 +89,26 @@ AddExtension(char *name, int NumEvents, int NumErrors,
return((ExtensionEntry *) NULL);
}
- ext = xalloc(sizeof(ExtensionEntry));
+ ext = malloc(sizeof(ExtensionEntry));
if (!ext)
return(NULL);
- ext->name = xalloc(strlen(name) + 1);
+ ext->name = malloc(strlen(name) + 1);
ext->num_aliases = 0;
ext->aliases = (char **)NULL;
ext->devPrivates = NULL;
if (!ext->name)
{
- xfree(ext);
+ free(ext);
return((ExtensionEntry *) NULL);
}
strcpy(ext->name, name);
i = NumExtensions;
- newexts = (ExtensionEntry **) xrealloc(extensions,
+ newexts = (ExtensionEntry **) realloc(extensions,
(i + 1) * sizeof(ExtensionEntry *));
if (!newexts)
{
- xfree(ext->name);
- xfree(ext);
+ free(ext->name);
+ free(ext);
return((ExtensionEntry *) NULL);
}
NumExtensions++;
@@ -154,12 +154,12 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
if (!ext)
return FALSE ;
- aliases = (char **)xrealloc(ext->aliases,
+ aliases = (char **)realloc(ext->aliases,
(ext->num_aliases + 1) * sizeof(char *));
if (!aliases)
return FALSE;
ext->aliases = aliases;
- name = xalloc(strlen(alias) + 1);
+ name = malloc(strlen(alias) + 1);
if (!name)
return FALSE;
strcpy(name, alias);
@@ -249,14 +249,14 @@ CloseDownExtensions(void)
if (extensions[i]->CloseDown)
extensions[i]->CloseDown(extensions[i]);
NumExtensions = i;
- xfree(extensions[i]->name);
+ free(extensions[i]->name);
for (j = extensions[i]->num_aliases; --j >= 0;)
- xfree(extensions[i]->aliases[j]);
- xfree(extensions[i]->aliases);
+ free(extensions[i]->aliases[j]);
+ free(extensions[i]->aliases);
dixFreePrivates(extensions[i]->devPrivates);
- xfree(extensions[i]);
+ free(extensions[i]);
}
- xfree(extensions);
+ free(extensions);
extensions = (ExtensionEntry **)NULL;
lastEvent = EXTENSION_EVENT_BASE;
lastError = FirstExtensionError;
@@ -328,7 +328,7 @@ ProcListExtensions(ClientPtr client)
total_length += strlen(extensions[i]->aliases[j]) + 1;
}
reply.length = bytes_to_int32(total_length);
- buffer = bufptr = xalloc(total_length);
+ buffer = bufptr = malloc(total_length);
if (!buffer)
return(BadAlloc);
for (i=0; i<NumExtensions; i++)
@@ -352,7 +352,7 @@ ProcListExtensions(ClientPtr client)
if (reply.length)
{
WriteToClient(client, total_length, buffer);
- xfree(buffer);
+ free(buffer);
}
return(client->noClientException);
}