summaryrefslogtreecommitdiff
path: root/Xi/xiselectev.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2011-08-04 15:35:41 -0400
committerMatt Turner <mattst88@gmail.com>2011-09-21 17:12:04 -0400
commit2c7c520cfe0df30f4bc3adba59d9c62582823bf8 (patch)
treef47282ce2f815acc691cfe188850adf8d6fbfcc3 /Xi/xiselectev.c
parentc10bad3d3e8ff1b90014770fd470f9c67263e46f (diff)
Use internal temp variable for swap macros
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'Xi/xiselectev.c')
-rw-r--r--Xi/xiselectev.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 22fbaf5e7..3af4f1fb9 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -63,21 +63,20 @@ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
int
SProcXISelectEvents(ClientPtr client)
{
- char n;
int i;
xXIEventMask* evmask;
REQUEST(xXISelectEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
- swapl(&stuff->win, n);
- swaps(&stuff->num_masks, n);
+ swapl(&stuff->win);
+ swaps(&stuff->num_masks);
evmask = (xXIEventMask*)&stuff[1];
for (i = 0; i < stuff->num_masks; i++)
{
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
}
@@ -192,12 +191,10 @@ ProcXISelectEvents(ClientPtr client)
int
SProcXIGetSelectedEvents(ClientPtr client)
{
- char n;
-
REQUEST(xXIGetSelectedEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
- swapl(&stuff->win, n);
+ swapl(&stuff->win);
return (ProcXIGetSelectedEvents(client));
}
@@ -207,7 +204,6 @@ ProcXIGetSelectedEvents(ClientPtr client)
{
int rc, i;
WindowPtr win;
- char n;
char *buffer = NULL;
xXIGetSelectedEventsReply reply;
OtherInputMasks *masks;
@@ -275,8 +271,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
if (client->swapped)
{
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
}
memcpy(&evmask[1], devmask, j + 1);
@@ -299,11 +295,9 @@ ProcXIGetSelectedEvents(ClientPtr client)
void SRepXIGetSelectedEvents(ClientPtr client,
int len, xXIGetSelectedEventsReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_masks, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_masks);
WriteToClient(client, len, (char *)rep);
}