summaryrefslogtreecommitdiff
path: root/xserver/Xi/queryst.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-11-02 15:26:35 +0000
commitdbca69c8a4f3e2d1ccb4f89152213b2861b33af6 (patch)
treef8963ef73903a7b4374adc2354dffbaa905112ac /xserver/Xi/queryst.c
parent33b2029f322f3c238b7ba528083195ad8dde33e1 (diff)
xserver 1.5.2. tested by ckuethe@, oga@, and others.
Diffstat (limited to 'xserver/Xi/queryst.c')
-rw-r--r--xserver/Xi/queryst.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/xserver/Xi/queryst.c b/xserver/Xi/queryst.c
index c4cc5a2e6..71ab79be8 100644
--- a/xserver/Xi/queryst.c
+++ b/xserver/Xi/queryst.c
@@ -38,14 +38,10 @@ from The Open Group.
#include <dix-config.h>
#endif
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
-#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
@@ -58,9 +54,9 @@ from The Open Group.
*/
int
-SProcXQueryDeviceState(register ClientPtr client)
+SProcXQueryDeviceState(ClientPtr client)
{
- register char n;
+ char n;
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n);
@@ -74,10 +70,10 @@ SProcXQueryDeviceState(register ClientPtr client)
*/
int
-ProcXQueryDeviceState(register ClientPtr client)
+ProcXQueryDeviceState(ClientPtr client)
{
- register char n;
- int i;
+ char n;
+ int rc, i;
int num_classes = 0;
int total_length = 0;
char *buf, *savbuf;
@@ -99,11 +95,9 @@ ProcXQueryDeviceState(register ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
- dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadDevice);
- return Success;
- }
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
v = dev->valuator;
if (v != NULL && v->motionHintWindow != NULL)
@@ -126,10 +120,8 @@ ProcXQueryDeviceState(register ClientPtr client)
num_classes++;
}
buf = (char *)xalloc(total_length);
- if (!buf) {
- SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadAlloc);
- return Success;
- }
+ if (!buf)
+ return BadAlloc;
savbuf = buf;
if (k != NULL) {
@@ -187,7 +179,7 @@ ProcXQueryDeviceState(register ClientPtr client)
void
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
- register char n;
+ char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);