diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-03-31 14:50:24 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2006-03-31 14:50:24 +0000 |
commit | f50ac4deec13dfd070715f636887e12f6301070f (patch) | |
tree | be5857de4d38d644938ad796fcfaab2c37b9f99f /src/XGMotion.c | |
parent | 6b055729fd0f89eedd2bf00befd8e42804f12b4a (diff) |
Mass reindent. Sorry.XORG-7_0_99_901
Diffstat (limited to 'src/XGMotion.c')
-rw-r--r-- | src/XGMotion.c | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/src/XGMotion.c b/src/XGMotion.c index 4ce41bf..077bd88 100644 --- a/src/XGMotion.c +++ b/src/XGMotion.c @@ -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 * - (sizeof (XDeviceTimeCoord) + (rep.axes * sizeof (int))); - savp = readp = (int *) Xmalloc (size); - bufp = (int *) Xmalloc (size2); - if (!bufp || !savp) - { + size2 = rep.nEvents * (sizeof(XDeviceTimeCoord) + (rep.axes * sizeof(int))); + savp = readp = (int *)Xmalloc(size); + bufp = (int *)Xmalloc(size2); + if (!bufp || !savp) { *nEvents = 0; - _XEatData (dpy, (unsigned long) size); + _XEatData(dpy, (unsigned long)size); UnlockDisplay(dpy); SyncHandle(); return (NULL); - } - _XRead (dpy, (char *) readp, size); + } + _XRead(dpy, (char *)readp, size); tc = (XDeviceTimeCoord *) bufp; - data = (int *) (tc + rep.nEvents); - for (i=0; i<*nEvents; i++,tc++) - { + data = (int *)(tc + rep.nEvents); + for (i = 0; i < *nEvents; i++, tc++) { tc->time = *readp++; tc->data = data; - for (j=0; j<*axis_count; j++) + for (j = 0; j < *axis_count; j++) *data++ = *readp++; - } - XFree ((char *)savp); + } + XFree((char *)savp); UnlockDisplay(dpy); SyncHandle(); return ((XDeviceTimeCoord *) bufp); - } +} -void XFreeDeviceMotionEvents (events) +void +XFreeDeviceMotionEvents(events) XDeviceTimeCoord *events; - { - XFree ((char *)events); - } +{ + XFree((char *)events); +} |