Commit 6d7083bd authored by Adam Jackson's avatar Adam Jackson 🎧

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

parent 5480c537
......@@ -40,6 +40,9 @@
* Xi/ungrdevk.c:
ANSIfy Xi/. Mostly automated via protoize(1).
* Xi/*.[ch]:
indent fixes (OMG SO UGLY), and nuke old RCS keywords.
2006-02-16 Eric Anholt <anholt@FreeBSD.org>
* Xext/Makefile.am:
......
/* $Xorg: allowev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
......@@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
/* $XFree86: xc/programs/Xserver/Xi/allowev.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */
/***********************************************************************
*
......@@ -59,14 +56,14 @@ 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/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 "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "allowev.h"
......@@ -87,8 +84,8 @@ SProcXAllowDeviceEvents(register ClientPtr client)
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time, n);
return(ProcXAllowDeviceEvents(client));
}
return (ProcXAllowDeviceEvents(client));
}
/***********************************************************************
*
......@@ -99,45 +96,42 @@ SProcXAllowDeviceEvents(register ClientPtr client)
int
ProcXAllowDeviceEvents(register ClientPtr client)
{
TimeStamp time;
DeviceIntPtr thisdev;
TimeStamp time;
DeviceIntPtr thisdev;
REQUEST(xAllowDeviceEventsReq);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
thisdev = LookupDeviceIntRec (stuff->deviceid);
if (thisdev == NULL)
{
thisdev = LookupDeviceIntRec(stuff->deviceid);
if (thisdev == NULL) {
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadDevice);
return Success;
}
}
time = ClientTimeToServerTime(stuff->time);
switch (stuff->mode)
{
case ReplayThisDevice:
AllowSome(client, time, thisdev, NOT_GRABBED);
break;
case SyncThisDevice:
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
break;
case AsyncThisDevice:
AllowSome(client, time, thisdev, THAWED);
break;
case AsyncOtherDevices:
AllowSome(client, time, thisdev, THAW_OTHERS);
break;
case SyncAll:
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
break;
case AsyncAll:
AllowSome(client, time, thisdev, THAWED_BOTH);
break;
default:
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0,
BadValue);
client->errorValue = stuff->mode;
return Success;
}
return Success;
switch (stuff->mode) {
case ReplayThisDevice:
AllowSome(client, time, thisdev, NOT_GRABBED);
break;
case SyncThisDevice:
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
break;
case AsyncThisDevice:
AllowSome(client, time, thisdev, THAWED);
break;
case AsyncOtherDevices:
AllowSome(client, time, thisdev, THAW_OTHERS);
break;
case SyncAll:
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
break;
case AsyncAll:
AllowSome(client, time, thisdev, THAWED_BOTH);
break;
default:
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadValue);
client->errorValue = stuff->mode;
return Success;
}
return Success;
}
/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.1 1996/04/15 11:18:23 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
......@@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef ALLOWEV_H
#define ALLOWEV_H 1
int
SProcXAllowDeviceEvents(
ClientPtr /* client */
);
int SProcXAllowDeviceEvents(ClientPtr /* client */
);
int
ProcXAllowDeviceEvents(
ClientPtr /* client */
);
int ProcXAllowDeviceEvents(ClientPtr /* client */
);
#endif /* ALLOWEV_H */
/* $Xorg: chgdctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
......@@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
/* $XFree86: xc/programs/Xserver/Xi/chgdctl.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */
/********************************************************************
*
......@@ -53,21 +50,21 @@ SOFTWARE.
*
*/
#define NEED_EVENTS /* for inputstr.h */
#define NEED_EVENTS /* for inputstr.h */
#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#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> /* control constants */
#include <X11/extensions/XIproto.h> /* control constants */
#include "XIstubs.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "chgdctl.h"
......@@ -88,8 +85,8 @@ SProcXChangeDeviceControl(register ClientPtr client)
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
swaps(&stuff->control, n);
return(ProcXChangeDeviceControl(client));
}
return (ProcXChangeDeviceControl(client));
}
/***********************************************************************
*
......@@ -111,89 +108,73 @@ ProcXChangeDeviceControl(ClientPtr client)
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
len = stuff->length - (sizeof(xChangeDeviceControlReq) >>2);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadDevice);
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadDevice);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_ChangeDeviceControl;
rep.length = 0;
rep.sequenceNumber = client->sequence;
switch (stuff->control)
{
case DEVICE_RESOLUTION:
r = (xDeviceResolutionCtl *) &stuff[1];
if ((len < (sizeof(xDeviceResolutionCtl)>>2)) ||
(len != (sizeof(xDeviceResolutionCtl)>>2) +
r->num_valuators))
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl,
0, BadLength);
return Success;
}
if (!dev->valuator)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
if ((dev->grab) && !SameClient(dev->grab, client))
{
rep.status = AlreadyGrabbed;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
&rep);
return Success;
}
resolution = (CARD32 *) (r + 1);
if (r->first_valuator + r->num_valuators > dev->valuator->numAxes)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
return Success;
}
status = ChangeDeviceControl(client, dev, (xDeviceCtl*) r);
if (status == Success)
{
a = &dev->valuator->axes[r->first_valuator];
for (i=0; i<r->num_valuators; i++)
if (*(resolution+i) < (a+i)->min_resolution ||
*(resolution+i) > (a+i)->max_resolution)
{
SendErrorToClient (client, IReqCode,
X_ChangeDeviceControl, 0, BadValue);
return Success;
}
for (i=0; i<r->num_valuators; i++)
(a++)->resolution = *resolution++;
}
else if (status == DeviceBusy)
{
rep.status = DeviceBusy;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
&rep);
return Success;
}
else
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
switch (stuff->control) {
case DEVICE_RESOLUTION:
r = (xDeviceResolutionCtl *) & stuff[1];
if ((len < (sizeof(xDeviceResolutionCtl) >> 2)) ||
(len != (sizeof(xDeviceResolutionCtl) >> 2) + r->num_valuators)) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl,
0, BadLength);
return Success;
}
if (!dev->valuator) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
if ((dev->grab) && !SameClient(dev->grab, client)) {
rep.status = AlreadyGrabbed;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
}
resolution = (CARD32 *) (r + 1);
if (r->first_valuator + r->num_valuators > dev->valuator->numAxes) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
return Success;
}
status = ChangeDeviceControl(client, dev, (xDeviceCtl *) r);
if (status == Success) {
a = &dev->valuator->axes[r->first_valuator];
for (i = 0; i < r->num_valuators; i++)
if (*(resolution + i) < (a + i)->min_resolution ||
*(resolution + i) > (a + i)->max_resolution) {
SendErrorToClient(client, IReqCode,
X_ChangeDeviceControl, 0, BadValue);
return Success;
}
break;
default:
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
for (i = 0; i < r->num_valuators; i++)
(a++)->resolution = *resolution++;
} else if (status == DeviceBusy) {
rep.status = DeviceBusy;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
} else {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
break;
default:
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue);
return Success;
}
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -203,12 +184,12 @@ ProcXChangeDeviceControl(ClientPtr client)
*/
void
SRepXChangeDeviceControl (ClientPtr client, int size, xChangeDeviceControlReply *rep)
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
register char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char *)rep);
}
}
/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.1 1996/04/15 11:18:25 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
......@@ -31,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGDCTL_H
#define CHGDCTL_H 1
int
SProcXChangeDeviceControl(
ClientPtr /* client */
);
int
ProcXChangeDeviceControl(
ClientPtr /* client */
);
void
SRepXChangeDeviceControl (
ClientPtr /* client */,
int /* size */,
xChangeDeviceControlReply * /* rep */
);
int SProcXChangeDeviceControl(ClientPtr /* client */
);
int ProcXChangeDeviceControl(ClientPtr /* client */
);
void SRepXChangeDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xChangeDeviceControlReply * /* rep */
);
#endif /* CHGDCTL_H */
This diff is collapsed.
/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.1 1996/04/15 11:18:26 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
......@@ -31,68 +30,52 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGFCTL_H
#define CHGFCTL_H 1
int
SProcXChangeFeedbackControl(
ClientPtr /* client */
);
int
ProcXChangeFeedbackControl(
ClientPtr /* client */
);
int
ChangeKbdFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
KbdFeedbackPtr /* k */,
xKbdFeedbackCtl * /* f */
);
int
ChangePtrFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
PtrFeedbackPtr /* p */,
xPtrFeedbackCtl * /* f */
);
int
ChangeIntegerFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
IntegerFeedbackPtr /* i */,
xIntegerFeedbackCtl * /* f */
);
int
ChangeStringFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
StringFeedbackPtr /* s */,
xStringFeedbackCtl * /* f */
);
int
ChangeBellFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
BellFeedbackPtr /* b */,
xBellFeedbackCtl * /* f */
);
int
ChangeLedFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
LedFeedbackPtr /* l */,
xLedFeedbackCtl * /* f */
);
int SProcXChangeFeedbackControl(ClientPtr /* client */
);
int ProcXChangeFeedbackControl(ClientPtr /* client */
);
int ChangeKbdFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
KbdFeedbackPtr /* k */ ,
xKbdFeedbackCtl * /* f */
);
int ChangePtrFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
PtrFeedbackPtr /* p */ ,
xPtrFeedbackCtl * /* f */
);
int ChangeIntegerFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
IntegerFeedbackPtr /* i */ ,
xIntegerFeedbackCtl * /* f */
);
int ChangeStringFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
StringFeedbackPtr /* s */ ,
xStringFeedbackCtl * /* f */
);
int ChangeBellFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
BellFeedbackPtr /* b */ ,
xBellFeedbackCtl * /* f */
);
int ChangeLedFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
LedFeedbackPtr /* l */ ,
xLedFeedbackCtl * /* f */
);
#endif /* CHGFCTL_H */
/* $Xorg: chgkbd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
......@@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
/* $XFree86: xc/programs/Xserver/Xi/chgkbd.c,v 3.5 2001/08/23 14:56:19 alanh Exp $ */
/***********************************************************************
*
......@@ -59,15 +56,15 @@ 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/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 "globals.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -89,8 +86,8 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return(ProcXChangeKeyboardDevice(client));
}
return (ProcXChangeKeyboardDevice(client));
}
/***********************************************************************
*
......@@ -100,16 +97,16 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
*/
int
ProcXChangeKeyboardDevice (register ClientPtr client)
ProcXChangeKeyboardDevice(register ClientPtr client)
{
int i;
DeviceIntPtr xkbd = inputInfo.keyboard;
DeviceIntPtr dev;
FocusClassPtr xf = xkbd->focus;
FocusClassPtr df;
KeyClassPtr k;
xChangeKeyboardDeviceReply rep;
changeDeviceNotify ev;
int i;
DeviceIntPtr xkbd = inputInfo.keyboard;
DeviceIntPtr dev;
FocusClassPtr xf = xkbd->focus;
FocusClassPtr df;
KeyClassPtr k;
xChangeKeyboardDeviceReply rep;
changeDeviceNotify ev;
REQUEST(xChangeKeyboardDeviceReq);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
......@@ -119,79 +116,75 @@ ProcXChangeKeyboardDevice (register ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
return Success;
}
}
k = dev->key;
if (k == NULL)
{
if (k == NULL) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadMatch);
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadMatch);
return Success;
}
}
if (((dev->grab) && !SameClient(dev->grab, client)) ||
((xkbd->grab) && !SameClient(xkbd->grab, client)))
((xkbd->grab) && !SameClient(xkbd->grab, client)))
rep.status = AlreadyGrabbed;
else if ((dev->sync.frozen &&
dev->sync.other && !SameClient(dev->sync.other, client)) ||
dev->sync.other && !SameClient(dev->sync.other, client)) ||
(xkbd->sync.frozen &&
xkbd->sync.other && !SameClient(xkbd->sync.other, client)))
rep.status = GrabFrozen;
else
{
if (ChangeKeyboardDevice (xkbd, dev) != Success)
{
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
else {
if (ChangeKeyboardDevice(xkbd, dev) != Success) {
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,