~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to Xi/extinit.c

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 *  Dispatch routines and initialization routines for the X input extension.
50
50
 *
51
51
 */
 
52
#define ARRAY_SIZE(_a)        (sizeof((_a)) / sizeof((_a)[0]))
52
53
 
53
54
#define  NUMTYPES 15
54
55
 
410
411
ProcIDispatch(ClientPtr client)
411
412
{
412
413
    REQUEST(xReq);
413
 
    if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data])
 
414
    if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
414
415
        return BadRequest;
415
416
 
416
417
    return (*ProcIVector[stuff->data])(client);
429
430
SProcIDispatch(ClientPtr client)
430
431
{
431
432
    REQUEST(xReq);
432
 
    if (stuff->data > IREQUESTS || !SProcIVector[stuff->data])
 
433
    if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
433
434
        return BadRequest;
434
435
 
435
436
    return (*SProcIVector[stuff->data])(client);
757
758
    swapl(&to->mods.latched_mods, n);
758
759
    swapl(&to->mods.locked_mods, n);
759
760
    swapl(&to->mods.effective_mods, n);
 
761
    swapl(&to->flags, n);
760
762
 
761
763
    ptr = (char*)(&to[1]);
762
764
    ptr += from->buttons_len * 4;
862
864
    {
863
865
        case XI_Enter:
864
866
        case XI_Leave:
 
867
        case XI_FocusIn:
 
868
        case XI_FocusOut:
865
869
            SDeviceLeaveNotifyEvent((xXILeaveEvent*)from, (xXILeaveEvent*)to);
866
870
            break;
867
871
        case XI_DeviceChanged:
1152
1156
AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
1153
1157
{
1154
1158
    dev->xinput_type = type;
1155
 
    dev->name = (char *)malloc(strlen(name) + 1);
1156
 
    strcpy(dev->name, name);
 
1159
    dev->name = strdup(name);
1157
1160
}
1158
1161
 
1159
1162
/***********************************************************************