diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-18 10:03:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-22 11:15:32 +1000 |
commit | 90aa0e4a49cdd637178a771365e1e8dab8bceb87 (patch) | |
tree | 08f00055e2d22b8af4f457188613a5776fd6787f /dix | |
parent | 693d4fdb1c7b7c789a812790122454e718602449 (diff) |
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>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/eventconvert.c | 10 | ||||
-rw-r--r-- | dix/events.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 21eed40e1..d91ba67c2 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -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; } diff --git a/dix/events.c b/dix/events.c index 0d01df512..a79cf6d2f 100644 --- a/dix/events.c +++ b/dix/events.c @@ -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; } } |