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>
EventSwapVector[DevicePropertyNotify] = NotImplemented;
RestoreExtensionEvents();
- free(xi_all_devices.name);
- free(xi_all_master_devices.name);
+ free((void *) xi_all_devices.name);
+ free((void *) xi_all_master_devices.name);
XIBarrierReset();
}
*/
static void
-CopyDeviceName(char **namebuf, char *name)
+CopyDeviceName(char **namebuf, const char *name)
{
char *nameptr = (char *) *namebuf;
while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr) dev, dev->xkb_interest->resource);
- free(dev->name);
+ free((void *) dev->name);
classes = (ClassesPtr) &dev->key;
FreeAllDeviceClasses(classes);
{
DeviceIntPtr pointer;
DeviceIntPtr keyboard;
+ char *dev_name;
*ptr = *keybd = NULL;
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;
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;
{
InputAttributes *new_attr;
int ntags = 0;
- char **tags, **new_tags;
+ const char **tags, **new_tags;
if (!attrs)
return NULL;
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);
typedef struct _XI2Mask XI2Mask;
typedef struct _InputAttributes {
- char *product;
- char *vendor;
- char *device;
- char *pnp_id;
- char *usb_id;
- char **tags; /* null-terminated */
+ const char *product;
+ const char *vendor;
+ const char *device;
+ const char *pnp_id;
+ const char *usb_id;
+ const char **tags; /* null-terminated */
uint32_t flags;
} InputAttributes;
GrabInfoRec deviceGrab; /* grab on the device */
int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
Atom xinput_type;
- char *name;
+ const char *name;
int id;
KeyClassPtr key;
ValuatorClassPtr valuator;
static void
cmp_attr_fields(InputAttributes * attr1, InputAttributes * attr2)
{
- char **tags1, **tags2;
+ const char **tags1, **tags2;
assert(attr1 && attr2);
assert(attr1 != attr2);
{
InputAttributes orig = { 0 };
InputAttributes *new;
- char *tags[4] = { "tag1", "tag2", "tag2", NULL };
+ const char *tags[4] = { "tag1", "tag2", "tag2", NULL };
new = DuplicateInputAttributes(NULL);
assert(!new);
void *userdata;
-extern int CorePointerProc(DeviceIntPtr pDev, int what);
-extern int CoreKeyboardProc(DeviceIntPtr pDev, int what);
-
static void
fake_init_sprite(DeviceIntPtr dev)
{