aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/setdval.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/setdval.c')
-rw-r--r--nx-X11/programs/Xserver/Xi/setdval.c83
1 files changed, 36 insertions, 47 deletions
diff --git a/nx-X11/programs/Xserver/Xi/setdval.c b/nx-X11/programs/Xserver/Xi/setdval.c
index bb6db7bcb..69a52757a 100644
--- a/nx-X11/programs/Xserver/Xi/setdval.c
+++ b/nx-X11/programs/Xserver/Xi/setdval.c
@@ -55,14 +55,14 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#include <nx-X11/X.h> /* for inputstr.h */
-#include <nx-X11/Xproto.h> /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
+#include <nx-X11/X.h> /* for inputstr.h */
+#include <nx-X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
+#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "setdval.h"
@@ -74,13 +74,12 @@ SOFTWARE.
*/
int
-SProcXSetDeviceValuators(client)
- register ClientPtr client;
- {
+SProcXSetDeviceValuators(register ClientPtr client)
+{
REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length);
- return(ProcXSetDeviceValuators(client));
- }
+ return (ProcXSetDeviceValuators(client));
+}
/***********************************************************************
*
@@ -89,11 +88,10 @@ SProcXSetDeviceValuators(client)
*/
int
-ProcXSetDeviceValuators(client)
- register ClientPtr client;
- {
+ProcXSetDeviceValuators(register ClientPtr client)
+{
DeviceIntPtr dev;
- xSetDeviceValuatorsReply rep;
+ xSetDeviceValuatorsReply rep;
REQUEST(xSetDeviceValuatorsReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
@@ -104,48 +102,41 @@ ProcXSetDeviceValuators(client)
rep.status = Success;
rep.sequenceNumber = client->sequence;
- if (stuff->length !=(sizeof(xSetDeviceValuatorsReq)>>2) +
- stuff->num_valuators)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
- BadLength);
+ if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) +
+ stuff->num_valuators) {
+ SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength);
return Success;
- }
- dev = LookupDeviceIntRec (stuff->deviceid);
- if (dev == NULL)
- {
- SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
- BadDevice);
+ }
+ dev = LookupDeviceIntRec(stuff->deviceid);
+ if (dev == NULL) {
+ SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice);
return Success;
- }
- if (dev->valuator == NULL)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- BadMatch);
+ }
+ if (dev->valuator == NULL) {
+ SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch);
return Success;
- }
+ }
- if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
- {
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- BadValue);
+ if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) {
+ SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue);
return Success;
- }
+ }
if ((dev->grab) && !SameClient(dev->grab, client))
rep.status = AlreadyGrabbed;
else
- rep.status = SetDeviceValuators (client, dev, (int *) &stuff[1],
- stuff->first_valuator, stuff->num_valuators);
+ rep.status = SetDeviceValuators(client, dev, (int *)&stuff[1],
+ stuff->first_valuator,
+ stuff->num_valuators);
if (rep.status != Success && rep.status != AlreadyGrabbed)
- SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
- rep.status);
+ SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
+ rep.status);
else
- WriteReplyToClient (client, sizeof (xSetDeviceValuatorsReply), &rep);
+ WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
return Success;
- }
+}
/***********************************************************************
*
@@ -155,12 +146,10 @@ ProcXSetDeviceValuators(client)
*/
void
-SRepXSetDeviceValuators (client, size, rep)
- ClientPtr client;
- int size;
- xSetDeviceValuatorsReply *rep;
- {
+SRepXSetDeviceValuators(ClientPtr client, int size,
+ xSetDeviceValuatorsReply * rep)
+{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
- }
+}