diff options
Diffstat (limited to 'xorg-server/Xi/opendev.c')
-rw-r--r-- | xorg-server/Xi/opendev.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c index c91bebbcf..27a959d85 100644 --- a/xorg-server/Xi/opendev.c +++ b/xorg-server/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" @@ -102,52 +102,53 @@ 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; 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; } @@ -163,5 +164,5 @@ SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *)rep); + WriteToClient(client, size, (char *) rep); } |