diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-07 15:37:23 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-07 15:37:23 +1030 |
commit | 0b729051c04da7068f1e6dd319190bd0a362b2c0 (patch) | |
tree | 6e15c5de67a40d04167fcf0a2e0e26af8eca11c2 /Xi/setdval.c | |
parent | b7ee005d327372c1e414ee6c526f9f7aee14bc86 (diff) | |
parent | d7c5e8bfc1aecbd23a4cbb2eab08656587aac2e8 (diff) |
Merge branch 'master' into mpx
Conflicts:
Xi/extinit.c
Xi/grabdev.c
Xi/setmode.c
Xi/ungrdev.c
dix/devices.c
dix/events.c
dix/getevents.c
include/dix.h
mi/midispcur.c
mi/misprite.c
xkb/xkbActions.c
xkb/xkbEvents.c
xkb/xkbPrKeyEv.c
Diffstat (limited to 'Xi/setdval.c')
-rw-r--r-- | Xi/setdval.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/Xi/setdval.c b/Xi/setdval.c index 61b98c790..bbab34e33 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -56,13 +56,10 @@ SOFTWARE. #include <dix-config.h> #endif -#include <X11/X.h> /* for inputstr.h */ -#include <X11/Xproto.h> /* Request macro */ #include "inputstr.h" /* DeviceIntPtr */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" -#include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" @@ -106,24 +103,17 @@ ProcXSetDeviceValuators(ClientPtr client) rep.sequenceNumber = client->sequence; if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) + - stuff->num_valuators) { - SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength); - return Success; - } + stuff->num_valuators) + return BadLength; + dev = LookupDeviceIntRec(stuff->deviceid); - if (dev == NULL) { - SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice); - return Success; - } - if (dev->valuator == NULL) { - SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch); - return Success; - } - - if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) { - SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue); - return Success; - } + if (dev == NULL) + return BadDevice; + if (dev->valuator == NULL) + return BadMatch; + + if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) + return BadValue; if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) rep.status = AlreadyGrabbed; @@ -133,11 +123,9 @@ ProcXSetDeviceValuators(ClientPtr client) stuff->num_valuators); if (rep.status != Success && rep.status != AlreadyGrabbed) - SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, - rep.status); - else - WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep); + return rep.status; + WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep); return Success; } |