input: don't use typecasts to access members of InternalEvent.

To avoid confusion, the member names are now postfixed with _event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-09-18 10:03:02 +10:00
commit 90aa0e4a49
8 changed files with 25 additions and 25 deletions

View file

@ -107,7 +107,7 @@ EventToCore(InternalEvent *event, xEvent *core)
case ET_KeyPress:
case ET_KeyRelease:
{
DeviceEvent *e = (DeviceEvent*)event;
DeviceEvent *e = &event->device_event;
if (e->detail.key > 0xFF)
return BadMatch;
@ -167,7 +167,7 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count)
case ET_KeyRelease:
case ET_ProximityIn:
case ET_ProximityOut:
return eventToKeyButtonPointer((DeviceEvent*)ev, xi, count);
return eventToKeyButtonPointer(&ev->device_event, xi, count);
case ET_DeviceChanged:
case ET_RawKeyPress:
case ET_RawKeyRelease:
@ -215,19 +215,19 @@ EventToXI2(InternalEvent *ev, xEvent **xi)
case ET_ButtonRelease:
case ET_KeyPress:
case ET_KeyRelease:
return eventToDeviceEvent((DeviceEvent*)ev, xi);
return eventToDeviceEvent(&ev->device_event, xi);
case ET_ProximityIn:
case ET_ProximityOut:
*xi = NULL;
return BadMatch;
case ET_DeviceChanged:
return eventToDeviceChanged((DeviceChangedEvent*)ev, xi);
return eventToDeviceChanged(&ev->changed_event, xi);
case ET_RawKeyPress:
case ET_RawKeyRelease:
case ET_RawButtonPress:
case ET_RawButtonRelease:
case ET_RawMotion:
return eventToRawEvent((RawDeviceEvent*)ev, xi);
return eventToRawEvent(&ev->raw_event, xi);
default:
break;
}

View file

@ -809,7 +809,7 @@ CheckVirtualMotion(
if (qe)
{
ev = (DeviceEvent*)qe->event;
ev = &qe->event->device_event;
switch(ev->type)
{
case ET_Motion:
@ -1130,7 +1130,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
QdEventPtr qe;
SpritePtr pSprite = device->spriteInfo->sprite;
int eventlen;
DeviceEvent *event = (DeviceEvent*)ev;
DeviceEvent *event = &ev->device_event;
NoticeTime((InternalEvent*)event);
@ -1179,7 +1179,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
(tail->device == device) &&
(tail->pScreen == pSprite->hotPhys.pScreen))
{
DeviceEvent *tailev = (DeviceEvent*)tail->event;
DeviceEvent *tailev = &tail->event->device_event;
tailev->root_x = pSprite->hotPhys.x;
tailev->root_y = pSprite->hotPhys.y;
tailev->time = event->time;
@ -1238,7 +1238,7 @@ PlayReleasedEvents(void)
will translate from sprite screen to screen 0 upon reentry
to the DIX layer */
if(!noPanoramiXExtension) {
DeviceEvent *ev = (DeviceEvent*)(qe->event);
DeviceEvent *ev = &qe->event->device_event;
switch(ev->type)
{
case ET_Motion:
@ -3993,7 +3993,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
FreezeThaw(thisDev, TRUE);
if (!grabinfo->sync.event)
grabinfo->sync.event = xcalloc(1, sizeof(InternalEvent));
*grabinfo->sync.event = *(DeviceEvent*)event;
*grabinfo->sync.event = event->device_event;
break;
}
}