summaryrefslogtreecommitdiff
path: root/src/XOpenDev.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-03-31 14:50:24 +0000
committerDaniel Stone <daniel@fooishbar.org>2006-03-31 14:50:24 +0000
commitf50ac4deec13dfd070715f636887e12f6301070f (patch)
treebe5857de4d38d644938ad796fcfaab2c37b9f99f /src/XOpenDev.c
parent6b055729fd0f89eedd2bf00befd8e42804f12b4a (diff)
Mass reindent. Sorry.XORG-7_0_99_901
Diffstat (limited to 'src/XOpenDev.c')
-rw-r--r--src/XOpenDev.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/src/XOpenDev.c b/src/XOpenDev.c
index 7930a9a..c98204d 100644
--- a/src/XOpenDev.c
+++ b/src/XOpenDev.c
@@ -60,54 +60,51 @@ SOFTWARE.
#include <X11/extensions/extutil.h>
#include "XIint.h"
-XDevice
-*XOpenDevice(dpy, id)
- register Display *dpy;
- register XID id;
- {
- register long rlen; /* raw length */
- xOpenDeviceReq *req;
- xOpenDeviceReply rep;
- XDevice *dev;
- XExtDisplayInfo *info = XInput_find_display (dpy);
-
- LockDisplay (dpy);
+XDevice * XOpenDevice(dpy, id)
+ register Display *
+ dpy;
+ register XID
+ id;
+{
+ register long rlen; /* raw length */
+ xOpenDeviceReq *req;
+ xOpenDeviceReply rep;
+ XDevice *dev;
+ XExtDisplayInfo *info = XInput_find_display(dpy);
+
+ LockDisplay(dpy);
if (_XiCheckExtInit(dpy, XInput_Initial_Release) == -1)
return ((XDevice *) NoSuchExtension);
- GetReq(OpenDevice,req);
+ GetReq(OpenDevice, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_OpenDevice;
req->deviceid = id;
- if (! _XReply (dpy, (xReply *) &rep, 0, xFalse))
- {
+ if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
return (XDevice *) NULL;
- }
+ }
rlen = rep.length << 2;
- dev = (XDevice *) Xmalloc (sizeof(XDevice) + rep.num_classes *
- sizeof (XInputClassInfo));
- if (dev)
- {
- int dlen; /* data length */
+ dev = (XDevice *) Xmalloc(sizeof(XDevice) + rep.num_classes *
+ sizeof(XInputClassInfo));
+ if (dev) {
+ int dlen; /* data length */
dev->device_id = req->deviceid;
dev->num_classes = rep.num_classes;
- dev->classes = (XInputClassInfo *) ((char *) dev + sizeof (XDevice));
+ dev->classes = (XInputClassInfo *) ((char *)dev + sizeof(XDevice));
dlen = rep.num_classes * sizeof(xInputClassInfo);
- _XRead (dpy, (char *)dev->classes, dlen);
+ _XRead(dpy, (char *)dev->classes, dlen);
/* could be padding that we still need to eat (yummy!) */
- if(rlen - dlen > 0)
- _XEatData (dpy, (unsigned long) rlen - dlen);
- }
- else
- _XEatData (dpy, (unsigned long) rlen);
+ if (rlen - dlen > 0)
+ _XEatData(dpy, (unsigned long)rlen - dlen);
+ } else
+ _XEatData(dpy, (unsigned long)rlen);
- UnlockDisplay (dpy);
+ UnlockDisplay(dpy);
SyncHandle();
return (dev);
- }
-
+}