aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/gtmotion.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-02-11 22:01:11 +0100
committerMihai Moldovan <ionic@ionic.de>2018-02-26 00:58:46 +0100
commit41a0ba729fb67efdc5f7bd50f73f145cf5d8a153 (patch)
tree4000aa2277bf5ae33598fb0acee7ad415f73cfc1 /nx-X11/programs/Xserver/Xi/gtmotion.c
parent5bfafee5087bcbc37b7f8db246b20d7a4bba5731 (diff)
downloadnx-libs-41a0ba729fb67efdc5f7bd50f73f145cf5d8a153.tar.gz
nx-libs-41a0ba729fb67efdc5f7bd50f73f145cf5d8a153.tar.bz2
nx-libs-41a0ba729fb67efdc5f7bd50f73f145cf5d8a153.zip
Xi: reformat code, ansify
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/gtmotion.c')
-rw-r--r--nx-X11/programs/Xserver/Xi/gtmotion.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/nx-X11/programs/Xserver/Xi/gtmotion.c b/nx-X11/programs/Xserver/Xi/gtmotion.c
index 8b9dcd451..e9447e213 100644
--- a/nx-X11/programs/Xserver/Xi/gtmotion.c
+++ b/nx-X11/programs/Xserver/Xi/gtmotion.c
@@ -76,14 +76,14 @@ SOFTWARE.
int
SProcXGetDeviceMotionEvents(client)
register ClientPtr client;
- {
+{
REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start);
swapl(&stuff->stop);
- return(ProcXGetDeviceMotionEvents(client));
- }
+ return (ProcXGetDeviceMotionEvents(client));
+}
/****************************************************************************
*
@@ -98,30 +98,30 @@ ProcXGetDeviceMotionEvents(client)
INT32 *coords = NULL, *bufptr;
xGetDeviceMotionEventsReply rep;
unsigned long i;
- int num_events, axes, size = 0, tsize;
+ int num_events, axes, size = 0, tsize;
unsigned long nEvents;
DeviceIntPtr dev;
TimeStamp start, stop;
- int length = 0;
- ValuatorClassPtr v;
+ int length = 0;
+ ValuatorClassPtr v;
REQUEST(xGetDeviceMotionEventsReq);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- dev = LookupDeviceIntRec (stuff->deviceid);
+ dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL)
{
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadDevice);
+ SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
+ BadDevice);
return Success;
- }
+ }
v = dev->valuator;
if (v==NULL || v->numAxes == 0)
{
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadMatch);
+ SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
+ BadMatch);
return Success;
- }
+ }
if (dev->valuator->motionHintWindow)
MaybeStopDeviceHint(dev, client);
axes = v->numAxes;
@@ -137,32 +137,32 @@ ProcXGetDeviceMotionEvents(client)
if (CompareTimeStamps(start, stop) == LATER ||
CompareTimeStamps(start, currentTime) == LATER)
{
- WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
- return Success;
- }
+ WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
+ return Success;
+ }
if (CompareTimeStamps(stop, currentTime) == LATER)
- stop = currentTime;
+ stop = currentTime;
num_events = v->numMotionEvents;
if (num_events)
{
- size = sizeof(Time) + (axes * sizeof (INT32));
+ size = sizeof(Time) + (axes * sizeof(INT32));
tsize = num_events * size;
coords = (INT32 *) malloc(tsize);
if (!coords)
{
- SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
- BadAlloc);
+ SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
+ BadAlloc);
return Success;
- }
+ }
rep.nEvents = (v->GetMotionProc) (
dev, (xTimecoord *)coords, /* XXX */
start.milliseconds, stop.milliseconds, (ScreenPtr)NULL);
}
if (rep.nEvents > 0)
{
- length = (rep.nEvents * size +3) >> 2;
- rep.length = length;
- }
+ length = (rep.nEvents * size + 3) >> 2;
+ rep.length = length;
+ }
nEvents = rep.nEvents;
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
if (nEvents)
@@ -174,10 +174,10 @@ ProcXGetDeviceMotionEvents(client)
{
swapl(bufptr);
bufptr++;
- }
}
+ }
WriteToClient(client, length * 4, coords);
- }
+ }
if (coords)
free(coords);
return Success;
@@ -195,9 +195,9 @@ SRepXGetDeviceMotionEvents (client, size, rep)
ClientPtr client;
int size;
xGetDeviceMotionEventsReply *rep;
- {
+{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->nEvents);
WriteToClient(client, size, rep);
- }
+}