summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-15 06:00:44 -0800
committerKeith Packard <keithp@keithp.com>2014-01-12 10:14:50 -0800
commitfecc7eb1cf66db64728ee2d68cd9443df7e70879 (patch)
tree659d74fb9f18bcc8fc0a0774b71bfad3d8a050f2 /dix
parentaf04cf6968b16cc9efd17905471047e7de62058a (diff)
xi: More warning cleanup for input
Lots more const char stuff. Remove duplicate defs of CoreKeyboardProc and CorePointerProc from test/xi2/protocol-common.c Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c11
-rw-r--r--dix/inpututils.c16
2 files changed, 14 insertions, 13 deletions
diff --git a/dix/devices.c b/dix/devices.c
index a680ed8d7..3aecd1b23 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -955,7 +955,7 @@ CloseDevice(DeviceIntPtr dev)
while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr) dev, dev->xkb_interest->resource);
- free(dev->name);
+ free((void *) dev->name);
classes = (ClassesPtr) &dev->key;
FreeAllDeviceClasses(classes);
@@ -2735,6 +2735,7 @@ AllocDevicePair(ClientPtr client, const char *name,
{
DeviceIntPtr pointer;
DeviceIntPtr keyboard;
+ char *dev_name;
*ptr = *keybd = NULL;
@@ -2745,12 +2746,12 @@ AllocDevicePair(ClientPtr client, const char *name,
if (!pointer)
return BadAlloc;
- if (asprintf(&pointer->name, "%s pointer", name) == -1) {
- pointer->name = NULL;
+ if (asprintf(&dev_name, "%s pointer", name) == -1) {
RemoveDevice(pointer, FALSE);
return BadAlloc;
}
+ pointer->name = dev_name;
pointer->public.processInputProc = ProcessOtherEvent;
pointer->public.realInputProc = ProcessOtherEvent;
@@ -2771,13 +2772,13 @@ AllocDevicePair(ClientPtr client, const char *name,
return BadAlloc;
}
- if (asprintf(&keyboard->name, "%s keyboard", name) == -1) {
- keyboard->name = NULL;
+ if (asprintf(&dev_name, "%s keyboard", name) == -1) {
RemoveDevice(keyboard, FALSE);
RemoveDevice(pointer, FALSE);
return BadAlloc;
}
+ keyboard->name = dev_name;
keyboard->public.processInputProc = ProcessOtherEvent;
keyboard->public.realInputProc = ProcessOtherEvent;
diff --git a/dix/inpututils.c b/dix/inpututils.c
index a10a7c761..3e1d75fec 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -351,7 +351,7 @@ DuplicateInputAttributes(InputAttributes * attrs)
{
InputAttributes *new_attr;
int ntags = 0;
- char **tags, **new_tags;
+ const char **tags, **new_tags;
if (!attrs)
return NULL;
@@ -403,20 +403,20 @@ DuplicateInputAttributes(InputAttributes * attrs)
void
FreeInputAttributes(InputAttributes * attrs)
{
- char **tags;
+ const char **tags;
if (!attrs)
return;
- free(attrs->product);
- free(attrs->vendor);
- free(attrs->device);
- free(attrs->pnp_id);
- free(attrs->usb_id);
+ free((void *) attrs->product);
+ free((void *) attrs->vendor);
+ free((void *) attrs->device);
+ free((void *) attrs->pnp_id);
+ free((void *) attrs->usb_id);
if ((tags = attrs->tags))
while (*tags)
- free(*tags++);
+ free((void *) *tags++);
free(attrs->tags);
free(attrs);