indent fixes (OMG SO UGLY), and nuke old RCS keywords.

This commit is contained in:
Adam Jackson
2006-02-20 22:16:49 +00:00
parent 5480c537ce
commit 6d7083bd69
75 changed files with 3002 additions and 3742 deletions

View File

@@ -1,4 +1,3 @@
/* $Xorg: queryst.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
/*
Copyright 1998, 1998 The Open Group
@@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/Xserver/Xi/queryst.c,v 3.4 2001/01/17 22:13:26 dawes Exp $ */
/***********************************************************************
*
@@ -40,14 +38,14 @@ 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/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 "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
@@ -66,8 +64,8 @@ SProcXQueryDeviceState(register ClientPtr client)
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length, n);
return(ProcXQueryDeviceState(client));
}
return (ProcXQueryDeviceState(client));
}
/***********************************************************************
*
@@ -78,20 +76,20 @@ SProcXQueryDeviceState(register ClientPtr client)
int
ProcXQueryDeviceState(register ClientPtr client)
{
register char n;
int i;
int num_classes = 0;
int total_length = 0;
char *buf, *savbuf;
KeyClassPtr k;
xKeyState *tk;
ButtonClassPtr b;
xButtonState *tb;
ValuatorClassPtr v;
xValuatorState *tv;
xQueryDeviceStateReply rep;
DeviceIntPtr dev;
int *values;
register char n;
int i;
int num_classes = 0;
int total_length = 0;
char *buf, *savbuf;
KeyClassPtr k;
xKeyState *tk;
ButtonClassPtr b;
xButtonState *tb;
ValuatorClassPtr v;
xValuatorState *tv;
xQueryDeviceStateReply rep;
DeviceIntPtr dev;
int *values;
REQUEST(xQueryDeviceStateReq);
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
@@ -101,96 +99,83 @@ 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);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadDevice);
return Success;
}
}
v = dev->valuator;
if (v != NULL && v->motionHintWindow != NULL)
MaybeStopDeviceHint(dev, client);
k = dev->key;
if (k != NULL)
{
total_length += sizeof (xKeyState);
if (k != NULL) {
total_length += sizeof(xKeyState);
num_classes++;
}
}
b = dev->button;
if (b != NULL)
{
total_length += sizeof (xButtonState);
if (b != NULL) {
total_length += sizeof(xButtonState);
num_classes++;
}
}
if (v != NULL)
{
total_length += (sizeof(xValuatorState) +
(v->numAxes * sizeof(int)));
if (v != NULL) {
total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int)));
num_classes++;
}
buf = (char *) xalloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
BadAlloc);
}
buf = (char *)xalloc(total_length);
if (!buf) {
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadAlloc);
return Success;
}
}
savbuf = buf;
if (k != NULL)
{
if (k != NULL) {
tk = (xKeyState *) buf;
tk->class = KeyClass;
tk->length = sizeof (xKeyState);
tk->length = sizeof(xKeyState);
tk->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1;
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
tk->keys[i] = k->down[i];
buf += sizeof (xKeyState);
}
buf += sizeof(xKeyState);
}
if (b != NULL)
{
if (b != NULL) {
tb = (xButtonState *) buf;
tb->class = ButtonClass;
tb->length = sizeof (xButtonState);
tb->length = sizeof(xButtonState);
tb->num_buttons = b->numButtons;
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
tb->buttons[i] = b->down[i];
buf += sizeof (xButtonState);
}
buf += sizeof(xButtonState);
}
if (v != NULL)
{
if (v != NULL) {
tv = (xValuatorState *) buf;
tv->class = ValuatorClass;
tv->length = sizeof (xValuatorState);
tv->length = sizeof(xValuatorState);
tv->num_valuators = v->numAxes;
tv->mode = v->mode;
buf += sizeof(xValuatorState);
for (i=0, values=v->axisVal; i<v->numAxes; i++)
{
*((int *) buf) = *values++;
if (client->swapped)
{
swapl ((int *) buf, n);/* macro - braces needed */
}
buf += sizeof(int);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
*((int *)buf) = *values++;
if (client->swapped) {
swapl((int *)buf, n); /* macro - braces needed */
}
buf += sizeof(int);
}
}
rep.num_classes = num_classes;
rep.length = (total_length + 3) >> 2;
WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep);
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
if (total_length > 0)
WriteToClient (client, total_length, savbuf);
xfree (savbuf);
WriteToClient(client, total_length, savbuf);
xfree(savbuf);
return Success;
}
}
/***********************************************************************
*
@@ -200,11 +185,11 @@ ProcXQueryDeviceState(register ClientPtr client)
*/
void
SRepXQueryDeviceState (ClientPtr client, int size, xQueryDeviceStateReply *rep)
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep);
}
}