diff options
author | Trevor Woerner <twoerner@gmail.com> | 2010-10-18 11:38:28 -0400 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-19 09:00:44 +1000 |
commit | 25d1e340eec73b010c4a5b1160aa0fa762a41cd0 (patch) | |
tree | dff58e1b174f48c1a9a19574cd2bd88cc64c1593 | |
parent | ed3458c0b534a15777b7305cd594e1f9181c80b8 (diff) |
Deprecated code cleanup.
Replace calls to deprecated functions with calls to standard dynamic
memory functions in driver code.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/kbd.c | 6 | ||||
-rw-r--r-- | src/lnx_KbdMap.c | 6 | ||||
-rw-r--r-- | src/lnx_kbd.c | 10 |
3 files changed, 11 insertions, 11 deletions
@@ -118,7 +118,7 @@ SetXkbOption(InputInfoPtr pInfo, char *name, char **option) if ((s = xf86SetStrOption(pInfo->options, name, NULL))) { if (!s[0]) { - xfree(s); + free(s); *option = NULL; } else { *option = s; @@ -165,7 +165,7 @@ KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags) xf86CollectInputOptions(pInfo, kbd98Defaults, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); - if (!(pKbd = xcalloc(sizeof(KbdDevRec), 1))) + if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) return pInfo; pInfo->private = pKbd; @@ -191,7 +191,7 @@ KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags) } l = strtok(NULL, " \t\n"); } - xfree(s); + free(s); } SetXkbOption(pInfo, "XkbRules", &xkb_rules); diff --git a/src/lnx_KbdMap.c b/src/lnx_KbdMap.c index 6dde256..21bed2e 100644 --- a/src/lnx_KbdMap.c +++ b/src/lnx_KbdMap.c @@ -522,12 +522,12 @@ readKernelMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap) /* * Find the Mapping for the special server functions */ - pKbd->specialMap = (TransMapPtr) xcalloc(NUM_CUSTOMKEYS, 1); + pKbd->specialMap = (TransMapPtr) calloc(NUM_CUSTOMKEYS, 1); if (pKbd->specialMap != NULL) { pKbd->specialMap->end = NUM_CUSTOMKEYS; - pKbd->specialMap->map = (unsigned char*) xcalloc(NUM_CUSTOMKEYS, 1); + pKbd->specialMap->map = (unsigned char*) calloc(NUM_CUSTOMKEYS, 1); if (pKbd->specialMap == NULL) { - xfree(pKbd->specialMap); + free(pKbd->specialMap); pKbd->specialMap = NULL; } } diff --git a/src/lnx_kbd.c b/src/lnx_kbd.c index 4dcf492..9b3aae3 100644 --- a/src/lnx_kbd.c +++ b/src/lnx_kbd.c @@ -181,12 +181,12 @@ OpenKeyboard(InputInfoPtr pInfo) break; default: xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s); - xfree(s); + free(s); return FALSE; } xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s); - xfree(s); + free(s); s = xf86SetStrOption(pInfo->options, "Device", NULL); if (s == NULL) { @@ -196,11 +196,11 @@ OpenKeyboard(InputInfoPtr pInfo) pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); if (pInfo->fd == -1) { xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s); - xfree(s); + free(s); return FALSE; } pKbd->isConsole = FALSE; - xfree(s); + free(s); } if (pKbd->isConsole) @@ -227,7 +227,7 @@ xf86OSKbdPreInit(InputInfoPtr pInfo) pKbd->OpenKeyboard = OpenKeyboard; pKbd->vtSwitchSupported = FALSE; - pKbd->private = xcalloc(sizeof(LnxKbdPrivRec), 1); + pKbd->private = calloc(sizeof(LnxKbdPrivRec), 1); if (pKbd->private == NULL) { xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n"); return FALSE; |