Commit f50ac4de authored by Daniel Stone's avatar Daniel Stone

Mass reindent. Sorry.

parent 6b055729
2006-03-31 Daniel Stone <daniel@freedesktop.org>
* **/*.[ch]:
Reindent with -bad -bap -c0 -cd0 -cp0 -ncdb -ci4 -cli0 -ncs -d0 -di4
-i4 -ip4 -l80 -npcs -psl -sob -ss -ce -sc -br -cdw -lp -cbi0.
2006-03-20 Adam Jackson <ajax@freedesktop.org>
* src/Makefile.am:
......
......@@ -61,20 +61,20 @@ SOFTWARE.
#include "XIint.h"
int
XAllowDeviceEvents (dpy, dev, event_mode, time)
register Display *dpy;
XDevice *dev;
int event_mode;
Time time;
{
xAllowDeviceEventsReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
LockDisplay (dpy);
XAllowDeviceEvents(dpy, dev, event_mode, time)
register Display *dpy;
XDevice *dev;
int event_mode;
Time time;
{
xAllowDeviceEventsReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(AllowDeviceEvents,req);
GetReq(AllowDeviceEvents, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_AllowDeviceEvents;
req->deviceid = dev->device_id;
......@@ -84,5 +84,4 @@ XAllowDeviceEvents (dpy, dev, event_mode, time)
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -62,69 +62,65 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceControl (dpy, dev, control, d)
register Display *dpy;
XDevice *dev;
int control;
XDeviceControl *d;
{
XChangeDeviceControl(dpy, dev, control, d)
register Display *dpy;
XDevice *dev;
int control;
XDeviceControl *d;
{
int length;
xChangeDeviceControlReq *req;
xChangeDeviceControlReply rep;
XExtDisplayInfo *info = XInput_find_display (dpy);
xChangeDeviceControlReq *req;
xChangeDeviceControlReply rep;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay (dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl) == -1)
return (NoSuchExtension);
GetReq(ChangeDeviceControl,req);
GetReq(ChangeDeviceControl, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangeDeviceControl;
req->deviceid = dev->device_id;
req->control = control;
switch (control)
{
case DEVICE_RESOLUTION:
{
XDeviceResolutionControl *R;
xDeviceResolutionCtl r;
R = (XDeviceResolutionControl *) d;
r.control = DEVICE_RESOLUTION;
r.length = sizeof (xDeviceResolutionCtl) +
R->num_valuators * sizeof(int);
r.first_valuator = R->first_valuator;
r.num_valuators = R->num_valuators;
req->length += ((unsigned)(r.length + 3) >> 2);
length = sizeof (xDeviceResolutionCtl);
Data (dpy, (char *) &r, length);
length = r.num_valuators * sizeof(int);
Data (dpy, (char *) R->resolutions, length);
if (! _XReply (dpy, (xReply *) &rep, 0, xTrue))
{
UnlockDisplay(dpy);
SyncHandle();
return (NoSuchExtension);
}
else
return (rep.status);
}
default:
{
xDeviceCtl u;
u.control = d->control;
u.length = d->length - sizeof (int);
length = ((unsigned)(u.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &u, length);
}
}
switch (control) {
case DEVICE_RESOLUTION:
{
XDeviceResolutionControl *R;
xDeviceResolutionCtl r;
R = (XDeviceResolutionControl *) d;
r.control = DEVICE_RESOLUTION;
r.length = sizeof(xDeviceResolutionCtl) +
R->num_valuators * sizeof(int);
r.first_valuator = R->first_valuator;
r.num_valuators = R->num_valuators;
req->length += ((unsigned)(r.length + 3) >> 2);
length = sizeof(xDeviceResolutionCtl);
Data(dpy, (char *)&r, length);
length = r.num_valuators * sizeof(int);
Data(dpy, (char *)R->resolutions, length);
if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
UnlockDisplay(dpy);
SyncHandle();
return (NoSuchExtension);
} else
return (rep.status);
}
default:
{
xDeviceCtl u;
u.control = d->control;
u.length = d->length - sizeof(int);
length = ((unsigned)(u.length + 3) >> 2);
req->length += length;
length <<= 2;
Data(dpy, (char *)&u, length);
}
}
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -62,35 +62,34 @@ SOFTWARE.
#include "XIint.h"
int
XChangeFeedbackControl (dpy, dev, mask, f)
register Display *dpy;
XDevice *dev;
unsigned long mask;
XFeedbackControl *f;
{
XChangeFeedbackControl(dpy, dev, mask, f)
register Display *dpy;
XDevice *dev;
unsigned long mask;
XFeedbackControl *f;
{
int length;
xChangeFeedbackControlReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
xChangeFeedbackControlReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay (dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(ChangeFeedbackControl,req);
GetReq(ChangeFeedbackControl, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangeFeedbackControl;
req->deviceid = dev->device_id;
req->mask = mask;
req->feedbackid = f->class;
if (f->class == KbdFeedbackClass)
{
XKbdFeedbackControl *K;
xKbdFeedbackCtl k;
if (f->class == KbdFeedbackClass) {
XKbdFeedbackControl *K;
xKbdFeedbackCtl k;
K = (XKbdFeedbackControl *) f;
k.class = KbdFeedbackClass;
k.length = sizeof (xKbdFeedbackCtl);
k.length = sizeof(xKbdFeedbackCtl);
k.id = K->id;
k.click = K->click;
k.percent = K->percent;
......@@ -103,16 +102,14 @@ XChangeFeedbackControl (dpy, dev, mask, f)
length = ((unsigned)(k.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &k, length);
}
else if (f->class == PtrFeedbackClass)
{
XPtrFeedbackControl *P;
xPtrFeedbackCtl p;
Data(dpy, (char *)&k, length);
} else if (f->class == PtrFeedbackClass) {
XPtrFeedbackControl *P;
xPtrFeedbackCtl p;
P = (XPtrFeedbackControl *) f;
p.class = PtrFeedbackClass;
p.length = sizeof (xPtrFeedbackCtl);
p.length = sizeof(xPtrFeedbackCtl);
p.id = P->id;
p.num = P->accelNum;
p.denom = P->accelDenom;
......@@ -120,48 +117,42 @@ XChangeFeedbackControl (dpy, dev, mask, f)
length = ((unsigned)(p.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &p, length);
}
else if (f->class == IntegerFeedbackClass)
{
XIntegerFeedbackControl *I;
xIntegerFeedbackCtl i;
Data(dpy, (char *)&p, length);
} else if (f->class == IntegerFeedbackClass) {
XIntegerFeedbackControl *I;
xIntegerFeedbackCtl i;
I = (XIntegerFeedbackControl *) f;
i.class = IntegerFeedbackClass;
i.length = sizeof (xIntegerFeedbackCtl);
i.length = sizeof(xIntegerFeedbackCtl);
i.id = I->id;
i.int_to_display = I->int_to_display;
length = ((unsigned)(i.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &i, length);
}
else if (f->class == StringFeedbackClass)
{
XStringFeedbackControl *S;
xStringFeedbackCtl s;
Data(dpy, (char *)&i, length);
} else if (f->class == StringFeedbackClass) {
XStringFeedbackControl *S;
xStringFeedbackCtl s;
S = (XStringFeedbackControl *) f;
s.class = StringFeedbackClass;
s.length = sizeof (xStringFeedbackCtl) +
(S->num_keysyms * sizeof (KeySym));
s.length = sizeof(xStringFeedbackCtl) +
(S->num_keysyms * sizeof(KeySym));
s.id = S->id;
s.num_keysyms = S->num_keysyms;
req->length += ((unsigned)(s.length + 3) >> 2);
length = sizeof (xStringFeedbackCtl);
Data (dpy, (char *) &s, length);
length = (s.num_keysyms * sizeof (KeySym));
Data (dpy, (char *) S->syms_to_display, length);
}
else if (f->class == BellFeedbackClass)
{
XBellFeedbackControl *B;
xBellFeedbackCtl b;
length = sizeof(xStringFeedbackCtl);
Data(dpy, (char *)&s, length);
length = (s.num_keysyms * sizeof(KeySym));
Data(dpy, (char *)S->syms_to_display, length);
} else if (f->class == BellFeedbackClass) {
XBellFeedbackControl *B;
xBellFeedbackCtl b;
B = (XBellFeedbackControl *) f;
b.class = BellFeedbackClass;
b.length = sizeof (xBellFeedbackCtl);
b.length = sizeof(xBellFeedbackCtl);
b.id = B->id;
b.percent = B->percent;
b.pitch = B->pitch;
......@@ -169,39 +160,34 @@ XChangeFeedbackControl (dpy, dev, mask, f)
length = ((unsigned)(b.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &b, length);
}
else if (f->class == LedFeedbackClass)
{
XLedFeedbackControl *L;
xLedFeedbackCtl l;
Data(dpy, (char *)&b, length);
} else if (f->class == LedFeedbackClass) {
XLedFeedbackControl *L;
xLedFeedbackCtl l;
L = (XLedFeedbackControl *) f;
l.class = LedFeedbackClass;
l.length = sizeof (xLedFeedbackCtl);
l.length = sizeof(xLedFeedbackCtl);
l.id = L->id;
l.led_mask = L->led_mask;
l.led_values = L->led_values;
length = ((unsigned)(l.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &l, length);
}
else
{
xFeedbackCtl u;
Data(dpy, (char *)&l, length);
} else {
xFeedbackCtl u;
u.class = f->class;
u.length = f->length - sizeof (int);
u.length = f->length - sizeof(int);
u.id = f->id;
length = ((unsigned)(u.length + 3) >> 2);
req->length += length;
length <<= 2;
Data (dpy, (char *) &u, length);
}
Data(dpy, (char *)&u, length);
}
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -61,23 +61,23 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceKeyMapping (dpy, dev, first, syms_per_code, keysyms, count)
register Display *dpy;
XDevice *dev;
int first;
int syms_per_code;
KeySym *keysyms;
int count;
{
XChangeDeviceKeyMapping(dpy, dev, first, syms_per_code, keysyms, count)
register Display *dpy;
XDevice *dev;
int first;
int syms_per_code;
KeySym *keysyms;
int count;
{
register long nbytes;
xChangeDeviceKeyMappingReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay (dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(ChangeDeviceKeyMapping,req);
GetReq(ChangeDeviceKeyMapping, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangeDeviceKeyMapping;
req->deviceid = dev->device_id;
......@@ -85,10 +85,10 @@ XChangeDeviceKeyMapping (dpy, dev, first, syms_per_code, keysyms, count)
req->keyCodes = count;
req->keySymsPerKeyCode = syms_per_code;
req->length += count * syms_per_code;
nbytes = syms_per_code * count * sizeof (CARD32);
Data (dpy, (char *)keysyms, nbytes);
nbytes = syms_per_code * count * sizeof(CARD32);
Data(dpy, (char *)keysyms, nbytes);
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -61,28 +61,27 @@ SOFTWARE.
#include "XIint.h"
int
XChangeKeyboardDevice (dpy, dev)
register Display *dpy;
XDevice *dev;
{
xChangeKeyboardDeviceReq *req;
xChangeKeyboardDeviceReply rep;
XExtDisplayInfo *info = XInput_find_display (dpy);
LockDisplay (dpy);
XChangeKeyboardDevice(dpy, dev)
register Display *dpy;
XDevice *dev;
{
xChangeKeyboardDeviceReq *req;
xChangeKeyboardDeviceReply rep;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(ChangeKeyboardDevice,req);
GetReq(ChangeKeyboardDevice, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangeKeyboardDevice;
req->deviceid = dev->device_id;
rep.status = Success;
(void) _XReply (dpy, (xReply *) &rep, 0, xTrue);
(void)_XReply(dpy, (xReply *) & rep, 0, xTrue);
UnlockDisplay(dpy);
SyncHandle();
return (rep.status);
}
}
......@@ -61,21 +61,21 @@ SOFTWARE.
#include "XIint.h"
int
XChangePointerDevice (dpy, dev, xaxis, yaxis)
register Display *dpy;
XDevice *dev;
int xaxis;
int yaxis;
{
xChangePointerDeviceReq *req;
xChangePointerDeviceReply rep;
XExtDisplayInfo *info = XInput_find_display (dpy);
LockDisplay (dpy);
XChangePointerDevice(dpy, dev, xaxis, yaxis)
register Display *dpy;
XDevice *dev;
int xaxis;
int yaxis;
{
xChangePointerDeviceReq *req;
xChangePointerDeviceReply rep;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(ChangePointerDevice,req);
GetReq(ChangePointerDevice, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangePointerDevice;
req->deviceid = dev->device_id;
......@@ -83,10 +83,9 @@ XChangePointerDevice (dpy, dev, xaxis, yaxis)
req->yaxis = yaxis;
rep.status = Success;
(void) _XReply (dpy, (xReply *) &rep, 0, xTrue);
(void)_XReply(dpy, (xReply *) & rep, 0, xTrue);
UnlockDisplay(dpy);
SyncHandle();
return (rep.status);
}
}
......@@ -62,21 +62,21 @@ SOFTWARE.
#include "XIint.h"
int
XChangeDeviceDontPropagateList (dpy, window, count, events, mode)
register Display *dpy;
Window window;
int count;
XEventClass *events;
int mode;
{
xChangeDeviceDontPropagateListReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
LockDisplay (dpy);
XChangeDeviceDontPropagateList(dpy, window, count, events, mode)
register Display *dpy;
Window window;
int count;
XEventClass *events;
int mode;
{
xChangeDeviceDontPropagateListReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(ChangeDeviceDontPropagateList,req);
GetReq(ChangeDeviceDontPropagateList, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ChangeDeviceDontPropagateList;
req->window = window;
......@@ -85,14 +85,13 @@ XChangeDeviceDontPropagateList (dpy, window, count, events, mode)
req->length += count;
/* note: Data is a macro that uses its arguments multiple
times, so "nvalues" is changed in a separate assignment
statement */
* times, so "nvalues" is changed in a separate assignment
* statement */
count <<= 2;
Data32 (dpy, (long *) events, count);
Data32(dpy, (long *)events, count);
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -62,24 +62,23 @@ SOFTWARE.
int
XCloseDevice(dpy, dev)
register Display *dpy;
register XDevice *dev;
{
xCloseDeviceReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
register Display *dpy;
register XDevice *dev;
{
xCloseDeviceReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay (dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return (NoSuchExtension);
GetReq(CloseDevice,req);
GetReq(CloseDevice, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_CloseDevice;
req->deviceid = dev->device_id;
XFree ((char *)dev);
UnlockDisplay (dpy);
XFree((char *)dev);
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
......@@ -61,20 +61,20 @@ SOFTWARE.
#include "XIint.h"
int
XDeviceBell (dpy, dev, feedbackclass, feedbackid, percent)
register Display *dpy;
XDevice *dev;
XID feedbackclass, feedbackid;
int percent;
{
xDeviceBellReq *req;
XExtDisplayInfo *info = XInput_find_display (dpy);
LockDisplay (dpy);
XDeviceBell(dpy, dev, feedbackclass, feedbackid, percent)
register Display *dpy;
XDevice *dev;
XID feedbackclass, feedbackid;
int percent;
{
xDeviceBellReq *req;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Add_XDeviceBell) == -1)
return (NoSuchExtension);
GetReq(DeviceBell,req);
GetReq(DeviceBell, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_DeviceBell;
req->deviceid = dev->device_id;
......@@ -85,5 +85,4 @@ XDeviceBell (dpy, dev, feedbackclass, feedbackid, percent)
UnlockDisplay(dpy);
SyncHandle();
return (Success);
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -62,12 +62,11 @@ SOFTWARE.
*
*/
XFreeDeviceList (list)
XFreeDeviceList(list)
XDeviceList *list;
{
if (list != NULL)
{
XFree ((list->name) - sizeof(XDeviceList));
XFree ((XDeviceList *) list);
}
{
if (list != NULL) {
XFree((list->name) - sizeof(XDeviceList));
XFree((XDeviceList *) list);
}
}
......@@ -61,82 +61,86 @@ SOFTWARE.
#include "XIint.h"
XDeviceTimeCoord
*XGetDeviceMotionEvents (dpy, dev, start, stop, nEvents, mode, axis_count)
register Display *dpy;
XDevice *dev;
Time start;
Time stop;
int *nEvents;
int *mode;
int *axis_count;
{
xGetDeviceMotionEventsReq *req;
xGetDeviceMotionEventsReply rep;
* XGetDeviceMotionEvents(dpy, dev, start, stop, nEvents, mode, axis_count)
register Display *
dpy;
XDevice *
dev;
Time
start;
Time
stop;
int *
nEvents;
int *
mode;
int *
axis_count;
{
xGetDeviceMotionEventsReq *req;
xGetDeviceMotionEventsReply rep;
XDeviceTimeCoord *tc;
int *data, *bufp, *readp, *savp;
long size, size2;
int i, j;
XExtDisplayInfo *info = XInput_find_display (dpy);
int i, j;
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay (dpy);
LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return ((XDeviceTimeCoord *) NoSuchExtension);
GetReq(GetDeviceMotionEvents,req);
GetReq(GetDeviceMotionEvents, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_GetDeviceMotionEvents;
req->start = start;
req->stop = stop;
req->deviceid = dev->device_id;
if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
SyncHandle();
*nEvents = 0;
return (NULL);
}
}
*mode = rep.mode;
*axis_count = rep.axes;
*nEvents = rep.nEvents;
if (!rep.nEvents)
{
if (!rep.nEvents) {
UnlockDisplay(dpy);
SyncHandle();
SyncHandle();
return (NULL);
}
}
size = rep.length << 2;
size2 = rep.nEvents *