diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-11-02 15:26:35 +0000 |
commit | dbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch) | |
tree | f8963ef73903a7b4374adc2354dffbaa905112ac /xserver/Xi/getkmap.c | |
parent | 33b2029f322f3c238b7ba528083195ad8dde33e1 (diff) |
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/Xi/getkmap.c')
-rw-r--r-- | xserver/Xi/getkmap.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/xserver/Xi/getkmap.c b/xserver/Xi/getkmap.c index 041e2c69f..0eec1d8df 100644 --- a/xserver/Xi/getkmap.c +++ b/xserver/Xi/getkmap.c @@ -56,13 +56,9 @@ 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 "extnsionst.h" -#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "swaprep.h" @@ -76,9 +72,9 @@ SOFTWARE. */ int -SProcXGetDeviceKeyMapping(register ClientPtr client) +SProcXGetDeviceKeyMapping(ClientPtr client) { - register char n; + char n; REQUEST(xGetDeviceKeyMappingReq); swaps(&stuff->length, n); @@ -92,39 +88,32 @@ SProcXGetDeviceKeyMapping(register ClientPtr client) */ int -ProcXGetDeviceKeyMapping(register ClientPtr client) +ProcXGetDeviceKeyMapping(ClientPtr client) { xGetDeviceKeyMappingReply rep; DeviceIntPtr dev; KeySymsPtr k; + int rc; REQUEST(xGetDeviceKeyMappingReq); REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq); - dev = LookupDeviceIntRec(stuff->deviceid); - if (dev == NULL) { - SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, - BadDevice); - return Success; - } - - if (dev->key == NULL) { - SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadMatch); - return Success; - } + rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); + if (rc != Success) + return rc; + if (dev->key == NULL) + return BadMatch; k = &dev->key->curKeySyms; if ((stuff->firstKeyCode < k->minKeyCode) || (stuff->firstKeyCode > k->maxKeyCode)) { client->errorValue = stuff->firstKeyCode; - SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue); - return Success; + return BadValue; } if (stuff->firstKeyCode + stuff->count > k->maxKeyCode + 1) { client->errorValue = stuff->count; - SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue); - return Success; + return BadValue; } rep.repType = X_Reply; @@ -154,7 +143,7 @@ void SRepXGetDeviceKeyMapping(ClientPtr client, int size, xGetDeviceKeyMappingReply * rep) { - register char n; + char n; swaps(&rep->sequenceNumber, n); swapl(&rep->length, n); |