diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-06-10 13:21:33 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-06-10 13:21:33 +0000 |
commit | 171e929a08098b6c844887adc43879c7579dc15f (patch) | |
tree | 6b4d2e3bc20dbd4dc9a1f031416e66614c53dd21 /xserver/Xi/opendev.c | |
parent | 68781b09de2c95b87ea898c4ecf3018dfb4460d2 (diff) |
Update to xserver 1.12.2. tested by naddy@, krw@, mpi@.
Diffstat (limited to 'xserver/Xi/opendev.c')
-rw-r--r-- | xserver/Xi/opendev.c | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/xserver/Xi/opendev.c b/xserver/Xi/opendev.c index 13841dc4f..e7c00a236 100644 --- a/xserver/Xi/opendev.c +++ b/xserver/Xi/opendev.c @@ -54,11 +54,11 @@ SOFTWARE. #include <dix-config.h> #endif -#include "inputstr.h" /* DeviceIntPtr */ +#include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" -#include "windowstr.h" /* window structure */ +#include "windowstr.h" /* window structure */ #include "exglobals.h" #include "exevents.h" @@ -76,10 +76,8 @@ extern CARD8 event_base[]; int SProcXOpenDevice(ClientPtr client) { - char n; - REQUEST(xOpenDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXOpenDevice(client)); } @@ -104,55 +102,56 @@ ProcXOpenDevice(ClientPtr client) status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess); if (status == BadDevice) { /* not open */ - for (dev = inputInfo.off_devices; dev; dev = dev->next) - if (dev->id == stuff->deviceid) - break; - if (dev == NULL) - return BadDevice; - } else if (status != Success) - return status; + for (dev = inputInfo.off_devices; dev; dev = dev->next) + if (dev->id == stuff->deviceid) + break; + if (dev == NULL) + return BadDevice; + } + else if (status != Success) + return status; if (IsMaster(dev)) - return BadDevice; + return BadDevice; if (status != Success) - return status; + return status; memset(&rep, 0, sizeof(xOpenDeviceReply)); rep.repType = X_Reply; rep.RepType = X_OpenDevice; rep.sequenceNumber = client->sequence; if (dev->key != NULL) { - evbase[j].class = KeyClass; - evbase[j++].event_type_base = event_base[KeyClass]; + evbase[j].class = KeyClass; + evbase[j++].event_type_base = event_base[KeyClass]; } if (dev->button != NULL) { - evbase[j].class = ButtonClass; - evbase[j++].event_type_base = event_base[ButtonClass]; + evbase[j].class = ButtonClass; + evbase[j++].event_type_base = event_base[ButtonClass]; } if (dev->valuator != NULL) { - evbase[j].class = ValuatorClass; - evbase[j++].event_type_base = event_base[ValuatorClass]; + evbase[j].class = ValuatorClass; + evbase[j++].event_type_base = event_base[ValuatorClass]; } if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL || - dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) { - evbase[j].class = FeedbackClass; - evbase[j++].event_type_base = event_base[FeedbackClass]; + dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) { + evbase[j].class = FeedbackClass; + evbase[j++].event_type_base = event_base[FeedbackClass]; } if (dev->focus != NULL) { - evbase[j].class = FocusClass; - evbase[j++].event_type_base = event_base[FocusClass]; + evbase[j].class = FocusClass; + evbase[j++].event_type_base = event_base[FocusClass]; } if (dev->proximity != NULL) { - evbase[j].class = ProximityClass; - evbase[j++].event_type_base = event_base[ProximityClass]; + evbase[j].class = ProximityClass; + evbase[j++].event_type_base = event_base[ProximityClass]; } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; rep.length = bytes_to_int32(j * sizeof(xInputClassInfo)); rep.num_classes = j; WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep); - WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase); + WriteToClient(client, j * sizeof(xInputClassInfo), (char *) evbase); return Success; } @@ -166,9 +165,7 @@ ProcXOpenDevice(ClientPtr client) void SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - WriteToClient(client, size, (char *)rep); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + WriteToClient(client, size, (char *) rep); } |